Searched refs:v4l2_flash (Results 1 - 4 of 4) sorted by relevance

/linux-4.4.14/drivers/media/v4l2-core/
H A Dv4l2-flash-led-class.c20 #define has_flash_op(v4l2_flash, op) \
21 (v4l2_flash && v4l2_flash->ops->op)
23 #define call_flash_op(v4l2_flash, op, arg) \
24 (has_flash_op(v4l2_flash, op) ? \
25 v4l2_flash->ops->op(v4l2_flash, arg) : \
37 * the 'ctrls' array in the struct v4l2_flash.
82 static void v4l2_flash_set_led_brightness(struct v4l2_flash *v4l2_flash, v4l2_flash_set_led_brightness() argument
85 struct v4l2_ctrl **ctrls = v4l2_flash->ctrls; v4l2_flash_set_led_brightness()
88 if (has_flash_op(v4l2_flash, intensity_to_led_brightness)) v4l2_flash_set_led_brightness()
89 brightness = call_flash_op(v4l2_flash, v4l2_flash_set_led_brightness()
101 if (has_flash_op(v4l2_flash, led_brightness_to_intensity)) v4l2_flash_set_led_brightness()
102 ctrl->val = call_flash_op(v4l2_flash, v4l2_flash_set_led_brightness()
110 led_set_brightness(&v4l2_flash->fled_cdev->led_cdev, v4l2_flash_set_led_brightness()
113 led_set_brightness(&v4l2_flash->iled_cdev->led_cdev, v4l2_flash_set_led_brightness()
118 static int v4l2_flash_update_led_brightness(struct v4l2_flash *v4l2_flash, v4l2_flash_update_led_brightness() argument
121 struct v4l2_ctrl **ctrls = v4l2_flash->ctrls; v4l2_flash_update_led_brightness()
134 led_cdev = &v4l2_flash->fled_cdev->led_cdev; v4l2_flash_update_led_brightness()
136 led_cdev = &v4l2_flash->iled_cdev->led_cdev; v4l2_flash_update_led_brightness()
143 if (has_flash_op(v4l2_flash, led_brightness_to_intensity)) v4l2_flash_update_led_brightness()
144 ctrl->val = call_flash_op(v4l2_flash, v4l2_flash_update_led_brightness()
156 struct v4l2_flash *v4l2_flash = v4l2_ctrl_to_v4l2_flash(c); v4l2_flash_g_volatile_ctrl() local
157 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; v4l2_flash_g_volatile_ctrl()
164 return v4l2_flash_update_led_brightness(v4l2_flash, c); v4l2_flash_g_volatile_ctrl()
198 struct v4l2_flash *v4l2_flash = v4l2_ctrl_to_v4l2_flash(c); v4l2_flash_s_ctrl() local
199 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; v4l2_flash_s_ctrl()
201 struct v4l2_ctrl **ctrls = v4l2_flash->ctrls; v4l2_flash_s_ctrl()
218 ret = call_flash_op(v4l2_flash, v4l2_flash_s_ctrl()
225 ret = call_flash_op(v4l2_flash, v4l2_flash_s_ctrl()
236 v4l2_flash_set_led_brightness(v4l2_flash, v4l2_flash_s_ctrl()
252 return call_flash_op(v4l2_flash, external_strobe_set, v4l2_flash_s_ctrl()
276 v4l2_flash_set_led_brightness(v4l2_flash, c); v4l2_flash_s_ctrl()
297 static void __fill_ctrl_init_data(struct v4l2_flash *v4l2_flash, __fill_ctrl_init_data() argument
301 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; __fill_ctrl_init_data()
340 if (v4l2_flash->iled_cdev) { __fill_ctrl_init_data()
407 static int v4l2_flash_init_controls(struct v4l2_flash *v4l2_flash, v4l2_flash_init_controls() argument
416 v4l2_flash->ctrls = devm_kzalloc(v4l2_flash->sd.dev, v4l2_flash_init_controls()
417 sizeof(*v4l2_flash->ctrls) * v4l2_flash_init_controls()
419 if (!v4l2_flash->ctrls) v4l2_flash_init_controls()
428 __fill_ctrl_init_data(v4l2_flash, flash_cfg, ctrl_init_data); v4l2_flash_init_controls()
434 v4l2_ctrl_handler_init(&v4l2_flash->hdl, num_ctrls); v4l2_flash_init_controls()
443 ctrl = v4l2_ctrl_new_std_menu(&v4l2_flash->hdl, v4l2_flash_init_controls()
450 ctrl = v4l2_ctrl_new_std(&v4l2_flash->hdl, v4l2_flash_init_controls()
462 v4l2_flash->ctrls[i] = ctrl; v4l2_flash_init_controls()
467 if (v4l2_flash->hdl.error) { v4l2_flash_init_controls()
468 ret = v4l2_flash->hdl.error; v4l2_flash_init_controls()
472 v4l2_ctrl_handler_setup(&v4l2_flash->hdl); v4l2_flash_init_controls()
474 v4l2_flash->sd.ctrl_handler = &v4l2_flash->hdl; v4l2_flash_init_controls()
479 v4l2_ctrl_handler_free(&v4l2_flash->hdl); v4l2_flash_init_controls()
483 static int __sync_device_with_v4l2_controls(struct v4l2_flash *v4l2_flash) __sync_device_with_v4l2_controls() argument
485 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; __sync_device_with_v4l2_controls()
486 struct v4l2_ctrl **ctrls = v4l2_flash->ctrls; __sync_device_with_v4l2_controls()
489 v4l2_flash_set_led_brightness(v4l2_flash, ctrls[TORCH_INTENSITY]); __sync_device_with_v4l2_controls()
492 v4l2_flash_set_led_brightness(v4l2_flash, __sync_device_with_v4l2_controls()
517 ret = call_flash_op(v4l2_flash, external_strobe_set, __sync_device_with_v4l2_controls()
529 struct v4l2_flash *v4l2_flash = v4l2_subdev_to_v4l2_flash(sd); v4l2_flash_open() local
530 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; v4l2_flash_open()
532 struct led_classdev_flash *iled_cdev = v4l2_flash->iled_cdev; v4l2_flash_open()
557 ret = __sync_device_with_v4l2_controls(v4l2_flash); v4l2_flash_open()
578 struct v4l2_flash *v4l2_flash = v4l2_subdev_to_v4l2_flash(sd); v4l2_flash_close() local
579 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; v4l2_flash_close()
581 struct led_classdev_flash *iled_cdev = v4l2_flash->iled_cdev; v4l2_flash_close()
589 if (v4l2_flash->ctrls[STROBE_SOURCE]) v4l2_flash_close()
590 ret = v4l2_ctrl_s_ctrl(v4l2_flash->ctrls[STROBE_SOURCE], v4l2_flash_close()
621 struct v4l2_flash *v4l2_flash_init( v4l2_flash_init()
628 struct v4l2_flash *v4l2_flash; v4l2_flash_init() local
638 v4l2_flash = devm_kzalloc(led_cdev->dev, sizeof(*v4l2_flash), v4l2_flash_init()
640 if (!v4l2_flash) v4l2_flash_init()
643 sd = &v4l2_flash->sd; v4l2_flash_init()
644 v4l2_flash->fled_cdev = fled_cdev; v4l2_flash_init()
645 v4l2_flash->iled_cdev = iled_cdev; v4l2_flash_init()
646 v4l2_flash->ops = ops; v4l2_flash_init()
660 ret = v4l2_flash_init_controls(v4l2_flash, config); v4l2_flash_init()
673 return v4l2_flash; v4l2_flash_init()
685 void v4l2_flash_release(struct v4l2_flash *v4l2_flash) v4l2_flash_release() argument
690 if (IS_ERR_OR_NULL(v4l2_flash)) v4l2_flash_release()
693 sd = &v4l2_flash->sd; v4l2_flash_release()
694 led_cdev = &v4l2_flash->fled_cdev->led_cdev; v4l2_flash_release()
/linux-4.4.14/include/media/
H A Dv4l2-flash-led-class.h20 struct v4l2_flash;
38 int (*external_strobe_set)(struct v4l2_flash *v4l2_flash,
42 (struct v4l2_flash *v4l2_flash, s32 intensity);
45 (struct v4l2_flash *v4l2_flash, enum led_brightness);
69 * struct v4l2_flash - Flash sub-device context
79 struct v4l2_flash { struct
89 static inline struct v4l2_flash *v4l2_subdev_to_v4l2_flash( v4l2_subdev_to_v4l2_flash()
92 return container_of(sd, struct v4l2_flash, sd); v4l2_subdev_to_v4l2_flash()
95 static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c) v4l2_ctrl_to_v4l2_flash()
97 return container_of(c->handler, struct v4l2_flash, hdl); v4l2_ctrl_to_v4l2_flash()
117 struct v4l2_flash *v4l2_flash_init(
126 * @v4l2_flash: the V4L2 Flash sub-device to release
130 void v4l2_flash_release(struct v4l2_flash *v4l2_flash);
133 static inline struct v4l2_flash *v4l2_flash_init( v4l2_flash_init()
143 static inline void v4l2_flash_release(struct v4l2_flash *v4l2_flash) v4l2_flash_release() argument
/linux-4.4.14/drivers/leds/
H A Dleds-aat1290.c72 struct v4l2_flash *v4l2_flash; member in struct:aat1290_led
398 struct v4l2_flash *v4l2_flash, aat1290_intensity_to_brightness()
401 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; aat1290_intensity_to_brightness()
412 static s32 aat1290_brightness_to_intensity(struct v4l2_flash *v4l2_flash, aat1290_brightness_to_intensity() argument
415 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; aat1290_brightness_to_intensity()
421 static int aat1290_led_external_strobe_set(struct v4l2_flash *v4l2_flash, aat1290_led_external_strobe_set() argument
424 struct aat1290_led *led = fled_cdev_to_led(v4l2_flash->fled_cdev); aat1290_led_external_strobe_set()
425 struct led_classdev_flash *fled_cdev = v4l2_flash->fled_cdev; aat1290_led_external_strobe_set()
528 led->v4l2_flash = v4l2_flash_init(dev, sub_node, fled_cdev, NULL, aat1290_led_probe()
530 if (IS_ERR(led->v4l2_flash)) { aat1290_led_probe()
531 ret = PTR_ERR(led->v4l2_flash); aat1290_led_probe()
549 v4l2_flash_release(led->v4l2_flash); aat1290_led_remove()
397 aat1290_intensity_to_brightness( struct v4l2_flash *v4l2_flash, s32 intensity) aat1290_intensity_to_brightness() argument
H A Dleds-max77693.c68 struct v4l2_flash *v4l2_flash; member in struct:max77693_sub_led
857 struct v4l2_flash *v4l2_flash, max77693_led_external_strobe_set()
861 flcdev_to_sub_led(v4l2_flash->fled_cdev); max77693_led_external_strobe_set()
969 sub_led->v4l2_flash = v4l2_flash_init(dev, sub_node, fled_cdev, NULL, max77693_register_led()
971 if (IS_ERR(sub_led->v4l2_flash)) { max77693_register_led()
972 ret = PTR_ERR(sub_led->v4l2_flash); max77693_register_led()
1049 v4l2_flash_release(sub_leds[FLED1].v4l2_flash); max77693_led_probe()
1063 v4l2_flash_release(sub_leds[FLED1].v4l2_flash); max77693_led_remove()
1069 v4l2_flash_release(sub_leds[FLED2].v4l2_flash); max77693_led_remove()
856 max77693_led_external_strobe_set( struct v4l2_flash *v4l2_flash, bool enable) max77693_led_external_strobe_set() argument

Completed in 176 milliseconds