Lines Matching full:leds

3  * LEDs driver for Freescale MC13783/MC13892/MC34708
7 * Based on leds-da903x:
19 #include <linux/leds.h>
33 struct mc13xxx_leds *leds; member
58 struct mc13xxx_leds *leds = led->leds; in mc13xxx_led_set() local
106 return mc13xxx_reg_rmw(leds->master, leds->devtype->ledctrl_base + reg, in mc13xxx_led_set()
115 struct mc13xxx_leds *leds = platform_get_drvdata(pdev); in mc13xxx_led_probe_dt() local
126 of_get_child_by_name(dev_of_node(dev->parent), "leds"); in mc13xxx_led_probe_dt()
132 leds->devtype->num_regs); in mc13xxx_led_probe_dt()
149 pdata->led[i].id = leds->devtype->led_min + tmp; in mc13xxx_led_probe_dt()
181 struct mc13xxx_leds *leds; in mc13xxx_led_probe() local
185 leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL); in mc13xxx_led_probe()
186 if (!leds) in mc13xxx_led_probe()
189 leds->devtype = devtype; in mc13xxx_led_probe()
190 leds->master = mcdev; in mc13xxx_led_probe()
191 platform_set_drvdata(pdev, leds); in mc13xxx_led_probe()
200 leds->num_leds = pdata->num_leds; in mc13xxx_led_probe()
202 if ((leds->num_leds < 1) || in mc13xxx_led_probe()
203 (leds->num_leds > (devtype->led_max - devtype->led_min + 1))) { in mc13xxx_led_probe()
204 dev_err(dev, "Invalid LED count %d\n", leds->num_leds); in mc13xxx_led_probe()
208 leds->led = devm_kcalloc(dev, leds->num_leds, sizeof(*leds->led), in mc13xxx_led_probe()
210 if (!leds->led) in mc13xxx_led_probe()
214 ret = mc13xxx_reg_write(mcdev, leds->devtype->ledctrl_base + i, in mc13xxx_led_probe()
220 for (i = 0; i < leds->num_leds; i++) { in mc13xxx_led_probe()
240 leds->led[i].id = id; in mc13xxx_led_probe()
241 leds->led[i].leds = leds; in mc13xxx_led_probe()
242 leds->led[i].cdev.name = name; in mc13xxx_led_probe()
243 leds->led[i].cdev.default_trigger = trig; in mc13xxx_led_probe()
244 leds->led[i].cdev.flags = LED_CORE_SUSPENDRESUME; in mc13xxx_led_probe()
245 leds->led[i].cdev.brightness_set_blocking = mc13xxx_led_set; in mc13xxx_led_probe()
246 leds->led[i].cdev.max_brightness = mc13xxx_max_brightness(id); in mc13xxx_led_probe()
248 ret = led_classdev_register(dev->parent, &leds->led[i].cdev); in mc13xxx_led_probe()
257 led_classdev_unregister(&leds->led[i].cdev); in mc13xxx_led_probe()
264 struct mc13xxx_leds *leds = platform_get_drvdata(pdev); in mc13xxx_led_remove() local
267 for (i = 0; i < leds->num_leds; i++) in mc13xxx_led_remove()
268 led_classdev_unregister(&leds->led[i].cdev); in mc13xxx_led_remove()
309 MODULE_DESCRIPTION("LEDs driver for Freescale MC13XXX PMIC");