Lines Matching refs:led
31 struct pm8058_led *led; in pm8058_led_set() local
36 led = container_of(cled, struct pm8058_led, cdev); in pm8058_led_set()
37 switch (led->ledtype) { in pm8058_led_set()
51 ret = regmap_update_bits(led->map, led->reg, mask, val); in pm8058_led_set()
58 struct pm8058_led *led; in pm8058_led_get() local
62 led = container_of(cled, struct pm8058_led, cdev); in pm8058_led_get()
64 ret = regmap_read(led->map, led->reg, &val); in pm8058_led_get()
70 switch (led->ledtype) { in pm8058_led_get()
92 struct pm8058_led *led; in pm8058_led_probe() local
99 led = devm_kzalloc(dev, sizeof(*led), GFP_KERNEL); in pm8058_led_probe()
100 if (!led) in pm8058_led_probe()
103 led->ledtype = (u32)(unsigned long)of_device_get_match_data(dev); in pm8058_led_probe()
110 led->map = map; in pm8058_led_probe()
114 ret = of_property_read_u32(np, "reg", &led->reg); in pm8058_led_probe()
120 led->cdev.brightness_set = pm8058_led_set; in pm8058_led_probe()
121 led->cdev.brightness_get = pm8058_led_get; in pm8058_led_probe()
122 if (led->ledtype == PM8058_LED_TYPE_COMMON) in pm8058_led_probe()
126 led->cdev.max_brightness = maxbright; in pm8058_led_probe()
131 led->cdev.brightness = pm8058_led_get(&led->cdev); in pm8058_led_probe()
133 led->cdev.brightness = maxbright; in pm8058_led_probe()
134 pm8058_led_set(&led->cdev, maxbright); in pm8058_led_probe()
136 led->cdev.brightness = LED_OFF; in pm8058_led_probe()
137 pm8058_led_set(&led->cdev, LED_OFF); in pm8058_led_probe()
141 if (led->ledtype == PM8058_LED_TYPE_KEYPAD || in pm8058_led_probe()
142 led->ledtype == PM8058_LED_TYPE_FLASH) in pm8058_led_probe()
143 led->cdev.flags = LED_CORE_SUSPENDRESUME; in pm8058_led_probe()
147 ret = devm_led_classdev_register_ext(dev, &led->cdev, &init_data); in pm8058_led_probe()