Skip to content

Commit

Permalink
leds: lp8860: Add DT parsing to retrieve the trigger node
Browse files Browse the repository at this point in the history
Add the ability to parse the DT and set the default
trigger mode for the LED.

Signed-off-by: Dan Murphy <dmurphy@ti.com>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
  • Loading branch information
Dan Murphy authored and Jacek Anaszewski committed Jan 8, 2018
1 parent 3829a7e commit 50aa46c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/leds/leds-lp8860.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ static int lp8860_probe(struct i2c_client *client,
return -ENOMEM;

for_each_available_child_of_node(np, child_node) {
led->led_dev.default_trigger = of_get_property(child_node,
"linux,default-trigger",
NULL);

ret = of_property_read_string(child_node, "label", &name);
if (!ret)
snprintf(led->label, sizeof(led->label), "%s:%s",
Expand Down

0 comments on commit 50aa46c

Please sign in to comment.