Lines Matching full:leds

8 #include <linux/leds.h>
108 * @max_period: Maximum period for all LEDs
109 * @max_leds: Maximum number of supported LEDs
111 * @max_brightness: Maximum brightness for all LEDs
156 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_brightness() local
157 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_led_hw_brightness()
158 struct regmap *regmap = leds->hw->regmap; in mt6323_led_hw_brightness()
181 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_off() local
182 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_led_hw_off()
183 struct regmap *regmap = leds->hw->regmap; in mt6323_led_hw_off()
207 struct mt6323_leds *leds = led->parent; in mt6323_get_led_hw_brightness() local
208 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_get_led_hw_brightness()
209 struct regmap *regmap = leds->hw->regmap; in mt6323_get_led_hw_brightness()
239 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_on() local
240 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_led_hw_on()
241 struct regmap *regmap = leds->hw->regmap; in mt6323_led_hw_on()
294 struct mt6323_leds *leds = led->parent; in mt6323_led_set_blink() local
295 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_led_set_blink()
296 const struct mt6323_hwspec *spec = leds->pdata->spec; in mt6323_led_set_blink()
297 struct regmap *regmap = leds->hw->regmap; in mt6323_led_set_blink()
332 mutex_lock(&leds->lock); in mt6323_led_set_blink()
354 mutex_unlock(&leds->lock); in mt6323_led_set_blink()
363 struct mt6323_leds *leds = led->parent; in mt6323_led_set_brightness() local
366 mutex_lock(&leds->lock); in mt6323_led_set_brightness()
384 mutex_unlock(&leds->lock); in mt6323_led_set_brightness()
392 struct mt6323_leds *leds = led->parent; in mtk_wled_hw_on() local
393 const struct mt6323_regs *regs = leds->pdata->regs; in mtk_wled_hw_on()
394 struct regmap *regmap = leds->hw->regmap; in mtk_wled_hw_on()
426 struct mt6323_leds *leds = led->parent; in mtk_wled_hw_off() local
427 const struct mt6323_regs *regs = leds->pdata->regs; in mtk_wled_hw_off()
428 struct regmap *regmap = leds->hw->regmap; in mtk_wled_hw_off()
457 struct mt6323_leds *leds = led->parent; in mt6323_get_wled_brightness() local
458 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_get_wled_brightness()
459 struct regmap *regmap = leds->hw->regmap; in mt6323_get_wled_brightness()
477 struct mt6323_leds *leds = led->parent; in mt6323_wled_set_brightness() local
480 mutex_lock(&leds->lock); in mt6323_wled_set_brightness()
495 mutex_unlock(&leds->lock); in mt6323_wled_set_brightness()
531 struct mt6323_leds *leds; in mt6323_led_probe() local
540 leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL); in mt6323_led_probe()
541 if (!leds) in mt6323_led_probe()
544 platform_set_drvdata(pdev, leds); in mt6323_led_probe()
545 leds->dev = dev; in mt6323_led_probe()
546 leds->pdata = device_get_match_data(dev); in mt6323_led_probe()
547 regs = leds->pdata->regs; in mt6323_led_probe()
548 spec = leds->pdata->spec; in mt6323_led_probe()
552 * leds->hw points to the underlying bus for the register in mt6323_led_probe()
555 leds->hw = hw; in mt6323_led_probe()
556 mutex_init(&leds->lock); in mt6323_led_probe()
559 ret = regmap_update_bits(leds->hw->regmap, regs->top_ckpdn[0], in mt6323_led_probe()
562 dev_err(leds->dev, in mt6323_led_probe()
578 leds->led[reg]) { in mt6323_led_probe()
589 leds->led[reg] = led; in mt6323_led_probe()
590 leds->led[reg]->id = reg; in mt6323_led_probe()
591 leds->led[reg]->cdev.max_brightness = spec->max_brightness; in mt6323_led_probe()
594 leds->led[reg]->cdev.brightness_set_blocking = in mt6323_led_probe()
596 leds->led[reg]->cdev.brightness_get = in mt6323_led_probe()
599 leds->led[reg]->cdev.brightness_set_blocking = in mt6323_led_probe()
601 leds->led[reg]->cdev.blink_set = mt6323_led_set_blink; in mt6323_led_probe()
602 leds->led[reg]->cdev.brightness_get = in mt6323_led_probe()
605 leds->led[reg]->parent = leds; in mt6323_led_probe()
607 ret = mt6323_led_set_dt_default(&leds->led[reg]->cdev, child); in mt6323_led_probe()
609 dev_err(leds->dev, in mt6323_led_probe()
616 ret = devm_led_classdev_register_ext(dev, &leds->led[reg]->cdev, in mt6323_led_probe()
629 struct mt6323_leds *leds = platform_get_drvdata(pdev); in mt6323_led_remove() local
630 const struct mt6323_regs *regs = leds->pdata->regs; in mt6323_led_remove()
633 /* Turn the LEDs off on driver removal. */ in mt6323_led_remove()
634 for (i = 0 ; leds->led[i] ; i++) in mt6323_led_remove()
635 mt6323_led_hw_off(&leds->led[i]->cdev); in mt6323_led_remove()
637 regmap_update_bits(leds->hw->regmap, regs->top_ckpdn[0], in mt6323_led_remove()
641 mutex_destroy(&leds->lock); in mt6323_led_remove()
685 /* There are no LEDs in MT6332. Only WLEDs are present. */