Lines Matching full:leds
3 * Driver for LEDs connected to the Intel Cherry Trail Whiskey Cove PMIC
14 #include <linux/leds.h>
77 struct cht_wc_led leds[CHT_WC_LED_COUNT]; member
340 struct cht_wc_leds *leds; in cht_wc_leds_probe() local
352 leds = devm_kzalloc(&pdev->dev, sizeof(*leds), GFP_KERNEL); in cht_wc_leds_probe()
353 if (!leds) in cht_wc_leds_probe()
361 leds->leds[0].regs = &cht_wc_led_regs[0]; in cht_wc_leds_probe()
362 leds->leds[0].regmap = pmic->regmap; in cht_wc_leds_probe()
363 ret = cht_wc_led_save_regs(&leds->leds[0], &leds->led1_initial_regs); in cht_wc_leds_probe()
370 leds->leds[0].cdev.default_trigger = "max170xx_battery-charging-blink-full-solid"; in cht_wc_leds_probe()
373 leds->leds[0].cdev.default_trigger = "bq27520-0-charging-blink-full-solid"; in cht_wc_leds_probe()
376 leds->leds[0].cdev.default_trigger = "bq27542-0-charging-blink-full-solid"; in cht_wc_leds_probe()
384 struct cht_wc_led *led = &leds->leds[i]; in cht_wc_leds_probe()
402 platform_set_drvdata(pdev, leds); in cht_wc_leds_probe()
408 struct cht_wc_leds *leds = platform_get_drvdata(pdev); in cht_wc_leds_remove() local
412 led_classdev_unregister(&leds->leds[i].cdev); in cht_wc_leds_remove()
415 if (!(leds->led1_initial_regs.ctrl & CHT_WC_LED1_SWCTL)) in cht_wc_leds_remove()
416 cht_wc_led_restore_regs(&leds->leds[0], &leds->led1_initial_regs); in cht_wc_leds_remove()
421 struct cht_wc_leds *leds = platform_get_drvdata(pdev); in cht_wc_leds_disable() local
425 cht_wc_leds_brightness_set(&leds->leds[i].cdev, 0); in cht_wc_leds_disable()
428 if (!(leds->led1_initial_regs.ctrl & CHT_WC_LED1_SWCTL)) in cht_wc_leds_disable()
429 cht_wc_led_restore_regs(&leds->leds[0], &leds->led1_initial_regs); in cht_wc_leds_disable()
432 /* On suspend save current settings and turn LEDs off */
435 struct cht_wc_leds *leds = dev_get_drvdata(dev); in cht_wc_leds_suspend() local
439 ret = cht_wc_led_save_regs(&leds->leds[i], &leds->leds[i].saved_regs); in cht_wc_leds_suspend()
451 struct cht_wc_leds *leds = dev_get_drvdata(dev); in cht_wc_leds_resume() local
455 cht_wc_led_restore_regs(&leds->leds[i], &leds->leds[i].saved_regs); in cht_wc_leds_resume()
474 MODULE_DESCRIPTION("Intel Cherry Trail Whiskey Cove PMIC LEDs driver");