Lines Matching refs:led

104 	struct mt6323_led	*led[MT6323_MAX_LEDS];  member
110 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_brightness() local
111 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_brightness()
127 ret = regmap_update_bits(regmap, MT6323_ISINK_CON2(led->id), in mt6323_led_hw_brightness()
134 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_off() local
135 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_off()
140 status = MT6323_ISINK_CH_EN(led->id); in mt6323_led_hw_off()
142 MT6323_ISINK_CH_EN_MASK(led->id), ~status); in mt6323_led_hw_off()
148 MT6323_RG_ISINK_CK_PDN_MASK(led->id), in mt6323_led_hw_off()
149 MT6323_RG_ISINK_CK_PDN(led->id)); in mt6323_led_hw_off()
159 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_get_led_hw_brightness() local
160 struct mt6323_leds *leds = led->parent; in mt6323_get_led_hw_brightness()
169 if (status & MT6323_RG_ISINK_CK_PDN_MASK(led->id)) in mt6323_get_led_hw_brightness()
176 if (!(status & MT6323_ISINK_CH_EN(led->id))) in mt6323_get_led_hw_brightness()
179 ret = regmap_read(regmap, MT6323_ISINK_CON2(led->id), &status); in mt6323_get_led_hw_brightness()
190 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_hw_on() local
191 struct mt6323_leds *leds = led->parent; in mt6323_led_hw_on()
202 MT6323_RG_ISINK_CK_SEL_MASK(led->id), 0); in mt6323_led_hw_on()
206 status = MT6323_RG_ISINK_CK_PDN(led->id); in mt6323_led_hw_on()
208 MT6323_RG_ISINK_CK_PDN_MASK(led->id), in mt6323_led_hw_on()
216 MT6323_ISINK_CH_EN_MASK(led->id), in mt6323_led_hw_on()
217 MT6323_ISINK_CH_EN(led->id)); in mt6323_led_hw_on()
225 ret = regmap_update_bits(regmap, MT6323_ISINK_CON0(led->id), in mt6323_led_hw_on()
231 ret = regmap_update_bits(regmap, MT6323_ISINK_CON1(led->id), in mt6323_led_hw_on()
244 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_set_blink() local
245 struct mt6323_leds *leds = led->parent; in mt6323_led_set_blink()
286 if (!led->current_brightness) { in mt6323_led_set_blink()
290 led->current_brightness = cdev->max_brightness; in mt6323_led_set_blink()
293 ret = regmap_update_bits(regmap, MT6323_ISINK_CON0(led->id), in mt6323_led_set_blink()
299 ret = regmap_update_bits(regmap, MT6323_ISINK_CON1(led->id), in mt6323_led_set_blink()
311 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_set_brightness() local
312 struct mt6323_leds *leds = led->parent; in mt6323_led_set_brightness()
317 if (!led->current_brightness && brightness) { in mt6323_led_set_brightness()
331 led->current_brightness = brightness; in mt6323_led_set_brightness()
341 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev); in mt6323_led_set_dt_default() local
345 led->cdev.name = of_get_property(np, "label", NULL) ? : np->name; in mt6323_led_set_dt_default()
346 led->cdev.default_trigger = of_get_property(np, in mt6323_led_set_dt_default()
356 led->current_brightness = ret; in mt6323_led_set_dt_default()
376 struct mt6323_led *led; in mt6323_led_probe() local
411 if (reg >= MT6323_MAX_LEDS || leds->led[reg]) { in mt6323_led_probe()
417 led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL); in mt6323_led_probe()
418 if (!led) { in mt6323_led_probe()
423 leds->led[reg] = led; in mt6323_led_probe()
424 leds->led[reg]->id = reg; in mt6323_led_probe()
425 leds->led[reg]->cdev.max_brightness = MT6323_MAX_BRIGHTNESS; in mt6323_led_probe()
426 leds->led[reg]->cdev.brightness_set_blocking = in mt6323_led_probe()
428 leds->led[reg]->cdev.blink_set = mt6323_led_set_blink; in mt6323_led_probe()
429 leds->led[reg]->cdev.brightness_get = in mt6323_led_probe()
431 leds->led[reg]->parent = leds; in mt6323_led_probe()
433 ret = mt6323_led_set_dt_default(&leds->led[reg]->cdev, child); in mt6323_led_probe()
440 ret = devm_led_classdev_register(dev, &leds->led[reg]->cdev); in mt6323_led_probe()
446 leds->led[reg]->cdev.dev->of_node = child; in mt6323_led_probe()
462 for (i = 0 ; leds->led[i] ; i++) in mt6323_led_remove()
463 mt6323_led_hw_off(&leds->led[i]->cdev); in mt6323_led_remove()