]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
pwm_backlight: add device tree support for Low Threshold Brightness
authorPhilip, Avinash <avinashphilip@ti.com>
Fri, 28 Sep 2012 00:20:20 +0000 (10:20 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 5 Oct 2012 04:01:23 +0000 (14:01 +1000)
Some backlights perform poorly when driven by a PWM with a short
duty-cycle.  For such devices, the low threshold can be used to specify a
lower bound for the duty-cycle and should be chosen to exclude the
problematic range.

Add device tree probing support for
platform_pwm_backlight_data,lth_brightness, putting
low-threshold-brightness as the optional property's name.

Signed-off-by: Philip, Avinash <avinashphilip@ti.com>
Cc: Thierry Reding <thierry.reding@avionic-design.de>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Documentation/devicetree/bindings/video/backlight/pwm-backlight.txt
drivers/video/backlight/pwm_bl.c

index 1e4fc727f3b180f84242a3d77b3854ad113b4a60..4e2991214e54b42023378a5b6b36df1dfa3ad9cf 100644 (file)
@@ -14,6 +14,15 @@ Required properties:
 Optional properties:
   - pwm-names: a list of names for the PWM devices specified in the
                "pwms" property (see PWM binding[0])
+  - low-threshold-brightness: brightness threshold low level. Low threshold
+    brightness set to value so that backlight present on low end of
+    brightness.
+    Some panels, backlight would absent if duty percentage of PWM wave is less
+    than certain level (say 20%). By setting low-threshold-brightness to a
+    value above (percentage of brightness-levels max) 50 (20% of 255, if 255
+    is max). On setting low-threshold-brightness, range of brightness-levels
+    is calculated in a region of low-threshold-brightness to brightness-levels
+    max.
 
 [0]: Documentation/devicetree/bindings/pwm/pwm.txt
 
@@ -25,4 +34,5 @@ Example:
 
                brightness-levels = <0 4 8 16 32 64 128 255>;
                default-brightness-level = <6>;
+               low-threshold-brightness = <50>;
        };
index 069983ca49ff89da5d241649283e11f2699b6d9e..91ebf6f110872bf6f0505c433e6fc6e3d8a8030e 100644 (file)
@@ -143,6 +143,11 @@ static int pwm_backlight_parse_dt(struct device *dev,
 
                data->dft_brightness = value;
                data->max_brightness--;
+
+               ret = of_property_read_u32(node, "low-threshold-brightness",
+                                          &value);
+               if (!ret)
+                       data->lth_brightness = value;
        }
 
        /*