From 1e5e7cc794b5a332c23216dade0a2e937d694b7f Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Mon, 9 Apr 2018 10:33:31 +0200 Subject: dt-bindings: pwm-backlight: Add a num-interpolation-steps property The num-interpolated-steps property specifies the number of interpolated steps between each value of brightness-level table. This is useful for high resolution PWMs to not have to list out every possible value in the brightness-level array. Signed-off-by: Enric Balletbo i Serra Acked-by: Daniel Thompson Reviewed-by: Rob Herring Signed-off-by: Lee Jones --- .../bindings/leds/backlight/pwm-backlight.txt | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'Documentation/devicetree/bindings/leds') diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt index 310810906613..ce9b5746b774 100644 --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt @@ -21,6 +21,11 @@ Optional properties: and enabling the backlight using GPIO. - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO and setting PWM value to 0. + - num-interpolated-steps: Number of interpolated steps between each value + of brightness-levels table. This way a high + resolution pwm duty cycle can be used without + having to list out every possible value in the + brightness-level array. [0]: Documentation/devicetree/bindings/pwm/pwm.txt [1]: Documentation/devicetree/bindings/gpio/gpio.txt @@ -39,3 +44,17 @@ Example: post-pwm-on-delay-ms = <10>; pwm-off-delay-ms = <10>; }; + +Example using num-interpolation-steps: + + backlight { + compatible = "pwm-backlight"; + pwms = <&pwm 0 5000000>; + + brightness-levels = <0 2048 4096 8192 16384 65535>; + num-interpolated-steps = <2048>; + default-brightness-level = <4096>; + + power-supply = <&vdd_bl_reg>; + enable-gpios = <&gpio 58 0>; + }; -- cgit v1.2.3-59-g8ed1b From c8cc0f0460bb53e1a731097c7cdfdb4973c7cfcf Mon Sep 17 00:00:00 2001 From: Enric Balletbo i Serra Date: Mon, 9 Apr 2018 10:33:33 +0200 Subject: dt-bindings: pwm-backlight: Move brightness-levels to optional The patch 'backlight: pwm_bl: compute brightness of LED linearly to human eye' introduced a default brightness-levels table that is used when brightness-levels is not available in the dts. So move brightness-levels and default-brightness-level to be optional. Signed-off-by: Enric Balletbo i Serra Reviewed-by: Rob Herring Acked-by: Daniel Thompson Signed-off-by: Lee Jones --- .../devicetree/bindings/leds/backlight/pwm-backlight.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'Documentation/devicetree/bindings/leds') diff --git a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt index ce9b5746b774..64fa2fbd98c9 100644 --- a/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt +++ b/Documentation/devicetree/bindings/leds/backlight/pwm-backlight.txt @@ -3,13 +3,6 @@ pwm-backlight bindings Required properties: - compatible: "pwm-backlight" - pwms: OF device-tree PWM specification (see PWM binding[0]) - - brightness-levels: Array of distinct brightness levels. Typically these - are in the range from 0 to 255, but any range starting at 0 will do. - The actual brightness level (PWM duty cycle) will be interpolated - from these values. 0 means a 0% duty cycle (darkest/off), while the - last value in the array represents a 100% duty cycle (brightest). - - default-brightness-level: the default brightness level (index into the - array defined by the "brightness-levels" property) - power-supply: regulator for supply voltage Optional properties: @@ -21,6 +14,14 @@ Optional properties: and enabling the backlight using GPIO. - pwm-off-delay-ms: Delay in ms between disabling the backlight using GPIO and setting PWM value to 0. + - brightness-levels: Array of distinct brightness levels. Typically these + are in the range from 0 to 255, but any range starting at + 0 will do. The actual brightness level (PWM duty cycle) + will be interpolated from these values. 0 means a 0% duty + cycle (darkest/off), while the last value in the array + represents a 100% duty cycle (brightest). + - default-brightness-level: The default brightness level (index into the + array defined by the "brightness-levels" property). - num-interpolated-steps: Number of interpolated steps between each value of brightness-levels table. This way a high resolution pwm duty cycle can be used without -- cgit v1.2.3-59-g8ed1b