mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: Bryan Wu <[email protected]>
This commit is contained in:
parent
127aedc8ec
commit
94b43b6771
3 changed files with 26 additions and 6 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue