Lines Matching defs:led

140  * @led:		the array that contains the state of individual
149 struct mt6323_led *led[MAX_SUPPORTED_LEDS];
155 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
156 struct mt6323_leds *leds = led->parent;
173 ret = regmap_update_bits(regmap, ISINK_CON(regs->isink_con[2], led->id),
180 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
181 struct mt6323_leds *leds = led->parent;
187 status = ISINK_CH_EN(led->id);
189 ISINK_CH_EN_MASK(led->id), ~status);
195 RG_ISINK_CK_PDN_MASK(led->id),
196 RG_ISINK_CK_PDN(led->id));
206 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
207 struct mt6323_leds *leds = led->parent;
217 if (status & RG_ISINK_CK_PDN_MASK(led->id))
224 if (!(status & ISINK_CH_EN(led->id)))
227 ret = regmap_read(regmap, ISINK_CON(regs->isink_con[2], led->id), &status);
238 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
239 struct mt6323_leds *leds = led->parent;
251 RG_ISINK_CK_SEL_MASK(led->id), 0);
255 status = RG_ISINK_CK_PDN(led->id);
257 RG_ISINK_CK_PDN_MASK(led->id),
265 ISINK_CH_EN_MASK(led->id),
266 ISINK_CH_EN(led->id));
274 ret = regmap_update_bits(regmap, ISINK_CON(regs->isink_con[0], led->id),
280 ret = regmap_update_bits(regmap, ISINK_CON(regs->isink_con[1], led->id),
293 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
294 struct mt6323_leds *leds = led->parent;
324 * which the led is ON.
337 if (!led->current_brightness) {
341 led->current_brightness = cdev->max_brightness;
344 ret = regmap_update_bits(regmap, ISINK_CON(regs->isink_con[0], led->id),
350 ret = regmap_update_bits(regmap, ISINK_CON(regs->isink_con[1], led->id),
362 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
363 struct mt6323_leds *leds = led->parent;
368 if (!led->current_brightness && brightness) {
382 led->current_brightness = brightness;
391 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
392 struct mt6323_leds *leds = led->parent;
412 ret = regmap_set_bits(regmap, regs->iwled_en_ctrl, BIT(led->id));
416 ret = regmap_set_bits(regmap, regs->iwled_en_ctrl, BIT(led->id + 1));
425 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
426 struct mt6323_leds *leds = led->parent;
431 ret = regmap_clear_bits(regmap, regs->iwled_en_ctrl, BIT(led->id + 1));
435 ret = regmap_clear_bits(regmap, regs->iwled_en_ctrl, BIT(led->id));
456 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
457 struct mt6323_leds *leds = led->parent;
468 status &= BIT(led->id) | BIT(led->id + 1);
470 return status ? led->current_brightness : 0;
476 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
477 struct mt6323_leds *leds = led->parent;
483 if (!led->current_brightness)
493 led->current_brightness = brightness;
503 struct mt6323_led *led = container_of(cdev, struct mt6323_led, cdev);
516 led->current_brightness = ret;
533 struct mt6323_led *led;
574 dev_err(dev, "Failed to read led 'reg' property\n");
579 leds->led[reg]) {
580 dev_err(dev, "Invalid led reg %u\n", reg);
585 led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL);
586 if (!led) {
593 leds->led[reg] = led;
594 leds->led[reg]->id = reg;
595 leds->led[reg]->cdev.max_brightness = spec->max_brightness;
598 leds->led[reg]->cdev.brightness_set_blocking =
600 leds->led[reg]->cdev.brightness_get =
603 leds->led[reg]->cdev.brightness_set_blocking =
605 leds->led[reg]->cdev.blink_set = mt6323_led_set_blink;
606 leds->led[reg]->cdev.brightness_get =
609 leds->led[reg]->parent = leds;
611 ret = mt6323_led_set_dt_default(&leds->led[reg]->cdev, child);
620 ret = devm_led_classdev_register_ext(dev, &leds->led[reg]->cdev,
642 for (i = 0 ; leds->led[i] ; i++)
643 mt6323_led_hw_off(&leds->led[i]->cdev);
717 { .compatible = "mediatek,mt6323-led", .data = &mt6323_pdata},
718 { .compatible = "mediatek,mt6331-led", .data = &mt6331_pdata },
719 { .compatible = "mediatek,mt6332-led", .data = &mt6332_pdata },
728 .name = "mt6323-led",