Lines Matching defs:led
96 * @led: the array that contains the state of individual
104 struct mt6323_led *led[MT6323_MAX_LEDS];
110 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
111 struct mt6323_leds *leds = led->parent;
127 ret = regmap_update_bits(regmap, MT6323_ISINK_CON2(led->id),
134 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
135 struct mt6323_leds *leds = led->parent;
140 status = MT6323_ISINK_CH_EN(led->id);
142 MT6323_ISINK_CH_EN_MASK(led->id), ~status);
148 MT6323_RG_ISINK_CK_PDN_MASK(led->id),
149 MT6323_RG_ISINK_CK_PDN(led->id));
159 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
160 struct mt6323_leds *leds = led->parent;
169 if (status & MT6323_RG_ISINK_CK_PDN_MASK(led->id))
176 if (!(status & MT6323_ISINK_CH_EN(led->id)))
179 ret = regmap_read(regmap, MT6323_ISINK_CON2(led->id), &status);
190 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
191 struct mt6323_leds *leds = led->parent;
202 MT6323_RG_ISINK_CK_SEL_MASK(led->id), 0);
206 status = MT6323_RG_ISINK_CK_PDN(led->id);
208 MT6323_RG_ISINK_CK_PDN_MASK(led->id),
216 MT6323_ISINK_CH_EN_MASK(led->id),
217 MT6323_ISINK_CH_EN(led->id));
225 ret = regmap_update_bits(regmap, MT6323_ISINK_CON0(led->id),
231 ret = regmap_update_bits(regmap, MT6323_ISINK_CON1(led->id),
244 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
245 struct mt6323_leds *leds = led->parent;
273 * which the led is ON.
286 if (!led->current_brightness) {
290 led->current_brightness = cdev->max_brightness;
293 ret = regmap_update_bits(regmap, MT6323_ISINK_CON0(led->id),
299 ret = regmap_update_bits(regmap, MT6323_ISINK_CON1(led->id),
311 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
312 struct mt6323_leds *leds = led->parent;
317 if (!led->current_brightness && brightness) {
331 led->current_brightness = brightness;
341 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
351 led->current_brightness = ret;
371 struct mt6323_led *led;
404 dev_err(dev, "Failed to read led 'reg' property\n");
408 if (reg >= MT6323_MAX_LEDS || leds->led[reg]) {
409 dev_err(dev, "Invalid led reg %u\n", reg);
414 led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL);
415 if (!led) {
420 leds->led[reg] = led;
421 leds->led[reg]->id = reg;
422 leds->led[reg]->cdev.max_brightness = MT6323_MAX_BRIGHTNESS;
423 leds->led[reg]->cdev.brightness_set_blocking =
425 leds->led[reg]->cdev.blink_set = mt6323_led_set_blink;
426 leds->led[reg]->cdev.brightness_get =
428 leds->led[reg]->parent = leds;
430 ret = mt6323_led_set_dt_default(&leds->led[reg]->cdev, child);
439 ret = devm_led_classdev_register_ext(dev, &leds->led[reg]->cdev,
460 for (i = 0 ; leds->led[i] ; i++)
461 mt6323_led_hw_off(&leds->led[i]->cdev);
473 { .compatible = "mediatek,mt6323-led" },
482 .name = "mt6323-led",