1.17. V4L2 flash functions and data structures¶
-
struct
v4l2_flash_config
¶ V4L2 Flash sub-device initialization data
Definition
struct v4l2_flash_config {
char dev_name[32];
struct led_flash_setting torch_intensity;
struct led_flash_setting indicator_intensity;
u32 flash_faults;
unsigned int has_external_strobe:1;
};
Members
char dev_name[32]
- the name of the media entity, unique in the system
struct led_flash_setting torch_intensity
- constraints for the LED in torch mode
struct led_flash_setting indicator_intensity
- constraints for the indicator LED
u32 flash_faults
- bitmask of flash faults that the LED flash class device can report; corresponding LED_FAULT* bit definitions are available in the header file <linux/led-class-flash.h>
unsigned int:1 has_external_strobe
- external strobe capability
-
struct
v4l2_flash
¶ Flash sub-device context
Definition
struct v4l2_flash {
struct led_classdev_flash * fled_cdev;
struct led_classdev_flash * iled_cdev;
const struct v4l2_flash_ops * ops;
struct v4l2_subdev sd;
struct v4l2_ctrl_handler hdl;
struct v4l2_ctrl ** ctrls;
};
Members
struct led_classdev_flash * fled_cdev
- LED flash class device controlled by this sub-device
struct led_classdev_flash * iled_cdev
- LED class device representing indicator LED associated with the LED flash class device
const struct v4l2_flash_ops * ops
- V4L2 specific flash ops
struct v4l2_subdev sd
- V4L2 sub-device
struct v4l2_ctrl_handler hdl
- flash controls handler
struct v4l2_ctrl ** ctrls
- array of pointers to controls, whose values define the sub-device state
-
struct v4l2_flash *
v4l2_flash_init
(struct device * dev, struct device_node * of_node, struct led_classdev_flash * fled_cdev, struct led_classdev_flash * iled_cdev, const struct v4l2_flash_ops * ops, struct v4l2_flash_config * config)¶ initialize V4L2 flash led sub-device
Parameters
struct device * dev
- flash device, e.g. an I2C device
struct device_node * of_node
- of_node of the LED, may be NULL if the same as device’s
struct led_classdev_flash * fled_cdev
- LED flash class device to wrap
struct led_classdev_flash * iled_cdev
- LED flash class device representing indicator LED associated with fled_cdev, may be NULL
const struct v4l2_flash_ops * ops
- V4L2 Flash device ops
struct v4l2_flash_config * config
- initialization data for V4L2 Flash sub-device
Description
Create V4L2 Flash sub-device wrapping given LED subsystem device.
Return
A valid pointer, or, when an error occurs, the return
value is encoded using ERR_PTR()
. Use IS_ERR()
to check and
PTR_ERR()
to obtain the numeric return value.
-
void
v4l2_flash_release
(struct v4l2_flash * v4l2_flash)¶ release V4L2 Flash sub-device
Parameters
struct v4l2_flash * v4l2_flash
- the V4L2 Flash sub-device to release
Description
Release V4L2 Flash sub-device.