Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'backlight-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight

Pull backlight updates from Lee Jones:
"New Functionality:

- Add new Device Tree binding for Monolithic Power (MPS) MP3309C
step-up converter

- Document brightness-levels in bindings for; generic, LED and PWM

Bug Fixes:

- Ensure PWMs are disabled on .shutdown(), .suspend() and .remove()"

* tag 'backlight-next-6.7' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight:
dt-bindings: backlight: Add brightness-levels related common properties
backlight: pwm_bl: Disable PWM on shutdown, suspend and remove
dt-bindings: backlight: Add MPS MP3309C

+120 -31
+17
Documentation/devicetree/bindings/leds/backlight/common.yaml
··· 33 33 due to restrictions in a specific system, such as mounting conditions. 34 34 $ref: /schemas/types.yaml#/definitions/uint32 35 35 36 + brightness-levels: 37 + description: 38 + Array of distinct brightness levels. The levels must be in the range 39 + accepted by the underlying LED device. Typically these are in the range 40 + from 0 to 255, but any range starting at 0 will do, as long as they are 41 + accepted by the LED. 42 + The 0 value means a 0% of brightness (darkest/off), while the last value 43 + in the array represents a full 100% brightness (brightest). 44 + If this array is not provided, the driver default mapping is used. 45 + $ref: /schemas/types.yaml#/definitions/uint32-array 46 + 47 + default-brightness-level: 48 + description: 49 + The default brightness level (index into the array defined by the 50 + "brightness-levels" property). 51 + $ref: /schemas/types.yaml#/definitions/uint32 52 + 36 53 additionalProperties: true
+4 -15
Documentation/devicetree/bindings/leds/backlight/led-backlight.yaml
··· 16 16 can also be used to describe a backlight device controlled by the output of 17 17 a LED driver. 18 18 19 + allOf: 20 + - $ref: common.yaml# 21 + 19 22 properties: 20 23 compatible: 21 24 const: led-backlight ··· 29 26 items: 30 27 maxItems: 1 31 28 32 - brightness-levels: 33 - description: 34 - Array of distinct brightness levels. The levels must be in the range 35 - accepted by the underlying LED devices. This is used to translate a 36 - backlight brightness level into a LED brightness level. If it is not 37 - provided, the identity mapping is used. 38 - $ref: /schemas/types.yaml#/definitions/uint32-array 39 - 40 - default-brightness-level: 41 - description: 42 - The default brightness level (index into the array defined by the 43 - "brightness-levels" property). 44 - $ref: /schemas/types.yaml#/definitions/uint32 45 - 46 29 required: 47 30 - compatible 48 31 - leds 49 32 50 - additionalProperties: false 33 + unevaluatedProperties: false 51 34 52 35 examples: 53 36 - |
+73
Documentation/devicetree/bindings/leds/backlight/mps,mp3309c.yaml
··· 1 + # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 + %YAML 1.2 3 + --- 4 + $id: http://devicetree.org/schemas/leds/backlight/mps,mp3309c.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: MPS MP3309C backlight 8 + 9 + maintainers: 10 + - Flavio Suligoi <f.suligoi@asem.it> 11 + 12 + description: | 13 + The Monolithic Power (MPS) MP3309C is a WLED step-up converter, featuring a 14 + programmable switching frequency to optimize efficiency. 15 + It supports two different dimming modes: 16 + 17 + - analog mode, via I2C commands (default) 18 + - PWM controlled mode. 19 + 20 + The datasheet is available at: 21 + https://www.monolithicpower.com/en/mp3309c.html 22 + 23 + allOf: 24 + - $ref: common.yaml# 25 + 26 + properties: 27 + compatible: 28 + const: mps,mp3309c 29 + 30 + reg: 31 + maxItems: 1 32 + 33 + pwms: 34 + description: if present, the backlight is controlled in PWM mode. 35 + maxItems: 1 36 + 37 + enable-gpios: 38 + description: GPIO used to enable the backlight in "analog-i2c" dimming mode. 39 + maxItems: 1 40 + 41 + mps,overvoltage-protection-microvolt: 42 + description: Overvoltage protection (13.5V, 24V or 35.5V). 43 + enum: [ 13500000, 24000000, 35500000 ] 44 + default: 35500000 45 + 46 + mps,no-sync-mode: 47 + description: disable synchronous rectification mode 48 + type: boolean 49 + 50 + required: 51 + - compatible 52 + - reg 53 + - max-brightness 54 + - default-brightness 55 + 56 + unevaluatedProperties: false 57 + 58 + examples: 59 + - | 60 + i2c { 61 + #address-cells = <1>; 62 + #size-cells = <0>; 63 + 64 + /* Backlight with PWM control */ 65 + backlight_pwm: backlight@17 { 66 + compatible = "mps,mp3309c"; 67 + reg = <0x17>; 68 + pwms = <&pwm1 0 3333333 0>; /* 300 Hz --> (1/f) * 1*10^9 */ 69 + max-brightness = <100>; 70 + default-brightness = <80>; 71 + mps,overvoltage-protection-microvolt = <24000000>; 72 + }; 73 + };
+4 -16
Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
··· 11 11 - Daniel Thompson <daniel.thompson@linaro.org> 12 12 - Jingoo Han <jingoohan1@gmail.com> 13 13 14 + allOf: 15 + - $ref: common.yaml# 16 + 14 17 properties: 15 18 compatible: 16 19 const: pwm-backlight ··· 42 39 Delay in ms between disabling the backlight using GPIO and setting PWM 43 40 value to 0. 44 41 45 - brightness-levels: 46 - description: 47 - Array of distinct brightness levels. Typically these are in the range 48 - from 0 to 255, but any range starting at 0 will do. The actual brightness 49 - level (PWM duty cycle) will be interpolated from these values. 0 means a 50 - 0% duty cycle (darkest/off), while the last value in the array represents 51 - a 100% duty cycle (brightest). 52 - $ref: /schemas/types.yaml#/definitions/uint32-array 53 - 54 - default-brightness-level: 55 - description: 56 - The default brightness level (index into the array defined by the 57 - "brightness-levels" property). 58 - $ref: /schemas/types.yaml#/definitions/uint32 59 - 60 42 num-interpolated-steps: 61 43 description: 62 44 Number of interpolated steps between each value of brightness-levels ··· 57 69 - compatible 58 70 - pwms 59 71 60 - additionalProperties: false 72 + unevaluatedProperties: false 61 73 62 74 examples: 63 75 - |
+22
drivers/video/backlight/pwm_bl.c
··· 626 626 { 627 627 struct backlight_device *bl = platform_get_drvdata(pdev); 628 628 struct pwm_bl_data *pb = bl_get_data(bl); 629 + struct pwm_state state; 629 630 630 631 backlight_device_unregister(bl); 631 632 pwm_backlight_power_off(pb); 633 + pwm_get_state(pb->pwm, &state); 634 + state.duty_cycle = 0; 635 + state.enabled = false; 636 + pwm_apply_state(pb->pwm, &state); 632 637 633 638 if (pb->exit) 634 639 pb->exit(&pdev->dev); ··· 643 638 { 644 639 struct backlight_device *bl = platform_get_drvdata(pdev); 645 640 struct pwm_bl_data *pb = bl_get_data(bl); 641 + struct pwm_state state; 646 642 647 643 pwm_backlight_power_off(pb); 644 + pwm_get_state(pb->pwm, &state); 645 + state.duty_cycle = 0; 646 + state.enabled = false; 647 + pwm_apply_state(pb->pwm, &state); 648 648 } 649 649 650 650 #ifdef CONFIG_PM_SLEEP ··· 657 647 { 658 648 struct backlight_device *bl = dev_get_drvdata(dev); 659 649 struct pwm_bl_data *pb = bl_get_data(bl); 650 + struct pwm_state state; 660 651 661 652 if (pb->notify) 662 653 pb->notify(pb->dev, 0); 663 654 664 655 pwm_backlight_power_off(pb); 656 + 657 + /* 658 + * Note that disabling the PWM doesn't guarantee that the output stays 659 + * at its inactive state. However without the PWM disabled, the PWM 660 + * driver refuses to suspend. So disable here even though this might 661 + * enable the backlight on poorly designed boards. 662 + */ 663 + pwm_get_state(pb->pwm, &state); 664 + state.duty_cycle = 0; 665 + state.enabled = false; 666 + pwm_apply_state(pb->pwm, &state); 665 667 666 668 if (pb->notify_after) 667 669 pb->notify_after(pb->dev, 0);