aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/leds/leds-lp5523.c
diff options
context:
space:
mode:
authorKim, Milo <Milo.Kim@ti.com>2012-08-22 15:32:29 +0800
committerBryan Wu <bryan.wu@canonical.com>2012-09-11 18:32:41 +0800
commit94b43b677104e50b9f8dd75aacb3c69e16089a68 (patch)
tree991fa64dbabaa3eee5c0dd900a4bbe5ca0c0e3aa /drivers/leds/leds-lp5523.c
parent127aedc8ecae2628511533ddeb239e99e4bed5e8 (diff)
downloadkernel_goldelico_gta04-94b43b677104e50b9f8dd75aacb3c69e16089a68.zip
kernel_goldelico_gta04-94b43b677104e50b9f8dd75aacb3c69e16089a68.tar.gz
kernel_goldelico_gta04-94b43b677104e50b9f8dd75aacb3c69e16089a68.tar.bz2
leds-lp5523: add channel name in the platform data
The name of each led channel is configurable. If the name is NULL, just use the channel id for making the channel name Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com> Signed-off-by: Bryan Wu <bryan.wu@canonical.com>
Diffstat (limited to 'drivers/leds/leds-lp5523.c')
-rw-r--r--drivers/leds/leds-lp5523.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index fbc12ac..9fd9a92 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -846,10 +846,14 @@ static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
return -EINVAL;
}
- snprintf(name, sizeof(name), "%s:channel%d",
- pdata->label ?: "lp5523", chan);
+ if (pdata->led_config[chan].name) {
+ led->cdev.name = pdata->led_config[chan].name;
+ } else {
+ snprintf(name, sizeof(name), "%s:channel%d",
+ pdata->label ?: "lp5523", chan);
+ led->cdev.name = name;
+ }
- led->cdev.name = name;
led->cdev.brightness_set = lp5523_set_brightness;
res = led_classdev_register(dev, &led->cdev);
if (res < 0) {