Lines Matching refs:fled_cdev

17 #define has_flash_op(fled_cdev, op)				\  argument
18 (fled_cdev && fled_cdev->ops->op)
20 #define call_flash_op(fled_cdev, op, args...) \ argument
21 ((has_flash_op(fled_cdev, op)) ? \
22 (fled_cdev->ops->op(fled_cdev, args)) : \
41 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_brightness_store() local
56 ret = led_set_flash_brightness(fled_cdev, state); in flash_brightness_store()
70 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_brightness_show() local
73 led_update_flash_brightness(fled_cdev); in flash_brightness_show()
75 return sprintf(buf, "%u\n", fled_cdev->brightness.val); in flash_brightness_show()
83 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in max_flash_brightness_show() local
85 return sprintf(buf, "%u\n", fled_cdev->brightness.max); in max_flash_brightness_show()
93 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_strobe_store() local
111 ret = led_set_flash_strobe(fled_cdev, state); in flash_strobe_store()
124 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_strobe_show() local
129 ret = led_get_flash_strobe(fled_cdev, &state); in flash_strobe_show()
141 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_timeout_store() local
156 ret = led_set_flash_timeout(fled_cdev, flash_timeout); in flash_timeout_store()
170 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_timeout_show() local
172 return sprintf(buf, "%u\n", fled_cdev->timeout.val); in flash_timeout_show()
180 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in max_flash_timeout_show() local
182 return sprintf(buf, "%u\n", fled_cdev->timeout.max); in max_flash_timeout_show()
190 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in flash_fault_show() local
195 ret = led_get_flash_fault(fled_cdev, &fault); in flash_fault_show()
254 struct led_classdev_flash *fled_cdev = lcdev_to_flcdev(led_cdev); in led_flash_resume() local
256 call_flash_op(fled_cdev, flash_brightness_set, in led_flash_resume()
257 fled_cdev->brightness.val); in led_flash_resume()
258 call_flash_op(fled_cdev, timeout_set, fled_cdev->timeout.val); in led_flash_resume()
261 static void led_flash_init_sysfs_groups(struct led_classdev_flash *fled_cdev) in led_flash_init_sysfs_groups() argument
263 struct led_classdev *led_cdev = &fled_cdev->led_cdev; in led_flash_init_sysfs_groups()
264 const struct led_flash_ops *ops = fled_cdev->ops; in led_flash_init_sysfs_groups()
265 const struct attribute_group **flash_groups = fled_cdev->sysfs_groups; in led_flash_init_sysfs_groups()
284 struct led_classdev_flash *fled_cdev, in led_classdev_flash_register_ext() argument
291 if (!fled_cdev) in led_classdev_flash_register_ext()
294 led_cdev = &fled_cdev->led_cdev; in led_classdev_flash_register_ext()
300 ops = fled_cdev->ops; in led_classdev_flash_register_ext()
307 led_flash_init_sysfs_groups(fled_cdev); in led_classdev_flash_register_ext()
319 void led_classdev_flash_unregister(struct led_classdev_flash *fled_cdev) in led_classdev_flash_unregister() argument
321 if (!fled_cdev) in led_classdev_flash_unregister()
324 led_classdev_unregister(&fled_cdev->led_cdev); in led_classdev_flash_unregister()
334 struct led_classdev_flash *fled_cdev, in devm_led_classdev_flash_register_ext() argument
345 ret = led_classdev_flash_register_ext(parent, fled_cdev, init_data); in devm_led_classdev_flash_register_ext()
351 *dr = fled_cdev; in devm_led_classdev_flash_register_ext()
370 struct led_classdev_flash *fled_cdev) in devm_led_classdev_flash_unregister() argument
374 devm_led_classdev_flash_match, fled_cdev)); in devm_led_classdev_flash_unregister()
389 int led_set_flash_timeout(struct led_classdev_flash *fled_cdev, u32 timeout) in led_set_flash_timeout() argument
391 struct led_classdev *led_cdev = &fled_cdev->led_cdev; in led_set_flash_timeout()
392 struct led_flash_setting *s = &fled_cdev->timeout; in led_set_flash_timeout()
398 return call_flash_op(fled_cdev, timeout_set, s->val); in led_set_flash_timeout()
404 int led_get_flash_fault(struct led_classdev_flash *fled_cdev, u32 *fault) in led_get_flash_fault() argument
406 return call_flash_op(fled_cdev, fault_get, fault); in led_get_flash_fault()
410 int led_set_flash_brightness(struct led_classdev_flash *fled_cdev, in led_set_flash_brightness() argument
413 struct led_classdev *led_cdev = &fled_cdev->led_cdev; in led_set_flash_brightness()
414 struct led_flash_setting *s = &fled_cdev->brightness; in led_set_flash_brightness()
420 return call_flash_op(fled_cdev, flash_brightness_set, s->val); in led_set_flash_brightness()
426 int led_update_flash_brightness(struct led_classdev_flash *fled_cdev) in led_update_flash_brightness() argument
428 struct led_flash_setting *s = &fled_cdev->brightness; in led_update_flash_brightness()
431 if (has_flash_op(fled_cdev, flash_brightness_get)) { in led_update_flash_brightness()
432 int ret = call_flash_op(fled_cdev, flash_brightness_get, in led_update_flash_brightness()