diff options
-rw-r--r-- | Documentation/devicetree/bindings/leds/leds-lp55xx.txt | 10 | ||||
-rw-r--r-- | drivers/leds/leds-lp55xx-common.c | 3 | ||||
-rw-r--r-- | include/linux/platform_data/leds-lp55xx.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt index a61727f9a6d1..d221e75d90fa 100644 --- a/Documentation/devicetree/bindings/leds/leds-lp55xx.txt +++ b/Documentation/devicetree/bindings/leds/leds-lp55xx.txt | |||
@@ -17,12 +17,15 @@ Optional properties: | |||
17 | 2: D1~6 with VOUT, D7~9 with VDD | 17 | 2: D1~6 with VOUT, D7~9 with VDD |
18 | 3: D1~9 are connected to VOUT | 18 | 3: D1~9 are connected to VOUT |
19 | 19 | ||
20 | Alternatively, each child can have specific channel name | 20 | Alternatively, each child can have a specific channel name and trigger: |
21 | - chan-name: Name of each channel name | 21 | - chan-name (optional): name of channel |
22 | - linux,default-trigger (optional): see | ||
23 | Documentation/devicetree/bindings/leds/common.txt | ||
22 | 24 | ||
23 | example 1) LP5521 | 25 | example 1) LP5521 |
24 | 3 LED channels, external clock used. Channel names are 'lp5521_pri:channel0', | 26 | 3 LED channels, external clock used. Channel names are 'lp5521_pri:channel0', |
25 | 'lp5521_pri:channel1' and 'lp5521_pri:channel2' | 27 | 'lp5521_pri:channel1' and 'lp5521_pri:channel2', with a heartbeat trigger |
28 | on channel 0. | ||
26 | 29 | ||
27 | lp5521@32 { | 30 | lp5521@32 { |
28 | compatible = "national,lp5521"; | 31 | compatible = "national,lp5521"; |
@@ -33,6 +36,7 @@ lp5521@32 { | |||
33 | chan0 { | 36 | chan0 { |
34 | led-cur = /bits/ 8 <0x2f>; | 37 | led-cur = /bits/ 8 <0x2f>; |
35 | max-cur = /bits/ 8 <0x5f>; | 38 | max-cur = /bits/ 8 <0x5f>; |
39 | linux,default-trigger = "heartbeat"; | ||
36 | }; | 40 | }; |
37 | 41 | ||
38 | chan1 { | 42 | chan1 { |
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 | } |
diff --git a/include/linux/platform_data/leds-lp55xx.h b/include/linux/platform_data/leds-lp55xx.h index 51a2ff579d60..c32de4dcec54 100644 --- a/include/linux/platform_data/leds-lp55xx.h +++ b/include/linux/platform_data/leds-lp55xx.h | |||
@@ -22,6 +22,7 @@ | |||
22 | 22 | ||
23 | struct lp55xx_led_config { | 23 | struct lp55xx_led_config { |
24 | const char *name; | 24 | const char *name; |
25 | const char *default_trigger; | ||
25 | u8 chan_nr; | 26 | u8 chan_nr; |
26 | u8 led_current; /* mA x10, 0 if led is not connected */ | 27 | u8 led_current; /* mA x10, 0 if led is not connected */ |
27 | u8 max_current; | 28 | u8 max_current; |