summaryrefslogtreecommitdiff
path: root/drivers/leds/leds-pwm.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2014-04-06 15:20:24 -0700
committerBryan Wu <cooloney@gmail.com>2014-05-08 14:28:07 +0800
commitb0571e7e4ec4d62b27711758417c388042f7bae7 (patch)
tree5955d8df122121f629d058aa40c181d19a8f4dd9 /drivers/leds/leds-pwm.c
parentd19a8a7078a9a8e254c030bcdb6732d26cbd6c16 (diff)
downloadlinux-b0571e7e4ec4d62b27711758417c388042f7bae7.tar.gz
linux-b0571e7e4ec4d62b27711758417c388042f7bae7.tar.xz
leds: leds-pwm: add DT support for LEDs wired to supply
The non-DT driver allowed an active low property to be specified, but DT is missing this in its description. Add the property to the DT binding document, making it optional. It defaults to active high, which retains compatibility with existing descriptions. This should only be used for causes where the LED is wired to supply, and the PWM does not sensibly support its own inversion. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds/leds-pwm.c')
-rw-r--r--drivers/leds/leds-pwm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/leds/leds-pwm.c b/drivers/leds/leds-pwm.c
index 8bd225df14de..f5cf1b0f2748 100644
--- a/drivers/leds/leds-pwm.c
+++ b/drivers/leds/leds-pwm.c
@@ -154,6 +154,7 @@ static int led_pwm_create_of(struct device *dev, struct led_pwm_priv *priv)
led.default_trigger = of_get_property(child,
"linux,default-trigger", NULL);
+ led.active_low = of_property_read_bool(child, "active-low");
of_property_read_u32(child, "max-brightness",
&led.max_brightness);