aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-09-15 06:50:17 -0400
committerBryan Wu <cooloney@gmail.com>2013-10-22 13:57:34 -0400
commitf65f0a1a9836abbfbe5c9b8fa0452e4d8eb7bf00 (patch)
tree852d6c106ac0a7b0458dff11a798f053f07f8090 /drivers/leds
parent2491c5c8c99dfcf2519ca73798be60f874a2b16e (diff)
leds: lp55xx: enable setting default trigger
This enables setting a default trigger on an LP55xx channel, either from platform data or device tree. This mechanism is identical to the mechanism for GPIO LEDs and references the common LEDs device tree bindings. Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Tested-by: Milo Kim <milo.kim@ti.com> Acked-by: Milo Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <cooloney@gmail.com>
Diffstat (limited to 'drivers/leds')
-rw-r--r--drivers/leds/leds-lp55xx-common.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/leds/leds-lp55xx-common.c b/drivers/leds/leds-lp55xx-common.c
index 351825b96f16..075acf5b9fab 100644
--- a/drivers/leds/leds-lp55xx-common.c
+++ b/drivers/leds/leds-lp55xx-common.c
@@ -165,6 +165,7 @@ static int lp55xx_init_led(struct lp55xx_led *led,
165 led->led_current = pdata->led_config[chan].led_current; 165 led->led_current = pdata->led_config[chan].led_current;
166 led->max_current = pdata->led_config[chan].max_current; 166 led->max_current = pdata->led_config[chan].max_current;
167 led->chan_nr = pdata->led_config[chan].chan_nr; 167 led->chan_nr = pdata->led_config[chan].chan_nr;
168 led->cdev.default_trigger = pdata->led_config[chan].default_trigger;
168 169
169 if (led->chan_nr >= max_channel) { 170 if (led->chan_nr >= max_channel) {
170 dev_err(dev, "Use channel numbers between 0 and %d\n", 171 dev_err(dev, "Use channel numbers between 0 and %d\n",
@@ -586,6 +587,8 @@ int lp55xx_of_populate_pdata(struct device *dev, struct device_node *np)
586 of_property_read_string(child, "chan-name", &cfg[i].name); 587 of_property_read_string(child, "chan-name", &cfg[i].name);
587 of_property_read_u8(child, "led-cur", &cfg[i].led_current); 588 of_property_read_u8(child, "led-cur", &cfg[i].led_current);
588 of_property_read_u8(child, "max-cur", &cfg[i].max_current); 589 of_property_read_u8(child, "max-cur", &cfg[i].max_current);
590 cfg[i].default_trigger =
591 of_get_property(child, "linux,default-trigger", NULL);
589 592
590 i++; 593 i++;
591 } 594 }