Lines Matching full:leds
17 #include <linux/leds.h>
120 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_brightness() local
121 struct regmap *regmap = leds->hw->regmap; in mt6323_led_hw_brightness()
144 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_off() local
145 struct regmap *regmap = leds->hw->regmap; in mt6323_led_hw_off()
169 struct mt6323_leds *leds = led->parent; in mt6323_get_led_hw_brightness() local
170 struct regmap *regmap = leds->hw->regmap; in mt6323_get_led_hw_brightness()
200 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_on() local
201 struct regmap *regmap = leds->hw->regmap; in mt6323_led_hw_on()
254 struct mt6323_leds *leds = led->parent; in mt6323_led_set_blink() local
255 struct regmap *regmap = leds->hw->regmap; in mt6323_led_set_blink()
290 mutex_lock(&leds->lock); in mt6323_led_set_blink()
312 mutex_unlock(&leds->lock); in mt6323_led_set_blink()
321 struct mt6323_leds *leds = led->parent; in mt6323_led_set_brightness() local
324 mutex_lock(&leds->lock); in mt6323_led_set_brightness()
342 mutex_unlock(&leds->lock); in mt6323_led_set_brightness()
384 struct mt6323_leds *leds; in mt6323_led_probe() local
390 leds = devm_kzalloc(dev, sizeof(*leds), GFP_KERNEL); in mt6323_led_probe()
391 if (!leds) in mt6323_led_probe()
394 platform_set_drvdata(pdev, leds); in mt6323_led_probe()
395 leds->dev = dev; in mt6323_led_probe()
398 * leds->hw points to the underlying bus for the register in mt6323_led_probe()
401 leds->hw = hw; in mt6323_led_probe()
402 mutex_init(&leds->lock); in mt6323_led_probe()
405 ret = regmap_update_bits(leds->hw->regmap, MT6323_TOP_CKPDN0, in mt6323_led_probe()
408 dev_err(leds->dev, in mt6323_led_probe()
420 if (reg >= MT6323_MAX_LEDS || leds->led[reg]) { in mt6323_led_probe()
432 leds->led[reg] = led; in mt6323_led_probe()
433 leds->led[reg]->id = reg; in mt6323_led_probe()
434 leds->led[reg]->cdev.max_brightness = MT6323_MAX_BRIGHTNESS; in mt6323_led_probe()
435 leds->led[reg]->cdev.brightness_set_blocking = in mt6323_led_probe()
437 leds->led[reg]->cdev.blink_set = mt6323_led_set_blink; in mt6323_led_probe()
438 leds->led[reg]->cdev.brightness_get = in mt6323_led_probe()
440 leds->led[reg]->parent = leds; in mt6323_led_probe()
442 ret = mt6323_led_set_dt_default(&leds->led[reg]->cdev, child); in mt6323_led_probe()
444 dev_err(leds->dev, in mt6323_led_probe()
449 ret = devm_led_classdev_register(dev, &leds->led[reg]->cdev); in mt6323_led_probe()
455 leds->led[reg]->cdev.dev->of_node = child; in mt6323_led_probe()
467 struct mt6323_leds *leds = platform_get_drvdata(pdev); in mt6323_led_remove() local
470 /* Turn the LEDs off on driver removal. */ in mt6323_led_remove()
471 for (i = 0 ; leds->led[i] ; i++) in mt6323_led_remove()
472 mt6323_led_hw_off(&leds->led[i]->cdev); in mt6323_led_remove()
474 regmap_update_bits(leds->hw->regmap, MT6323_TOP_CKPDN0, in mt6323_led_remove()
478 mutex_destroy(&leds->lock); in mt6323_led_remove()