V4L2 flash functions and data structures
struct v4l2_flash_ctrl_data #
flash control initialization data, filled basing on the features declared by the LED flash class driver in the v4l2_flash_config
Definition
;
Members
config: initialization data for a controlcid: contains v4l2 flash control id if the config field was initialized, 0 otherwise
struct v4l2_flash_ops #
V4L2 flash operations
Definition
;
Members
external_strobe_set: Setup strobing the flash by hardware pin state assertion.intensity_to_led_brightness: Convert intensity to brightness in a device specific mannerled_brightness_to_intensity: convert brightness to intensity in a device specific manner.
struct v4l2_flash_config #
V4L2 Flash sub-device initialization data
Definition
;
Members
dev_name: the name of the media entity, unique in the systemintensity: non-flash strobe constraints for the LEDflash_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>has_external_strobe: external strobe capability
struct v4l2_flash #
Flash sub-device context
Definition
;
Members
fled_cdev: LED flash class device controlled by this sub-deviceiled_cdev: LED class device representing indicator LED associated with the LED flash class deviceops: V4L2 specific flash opssd: V4L2 sub-devicehdl: flash controls handlerctrls: array of pointers to controls, whose values define the sub-device state
v4l2_subdev_to_v4l2_flash() #
struct v4l2_flash * Returns a struct v4l2_flash from the struct v4l2_subdev embedded on it.
Parameters
struct v4l2_subdev *sd: pointer tostruct v4l2_subdev
v4l2_ctrl_to_v4l2_flash() #
struct v4l2_flash * Returns a struct v4l2_flash from the struct v4l2_ctrl embedded on it.
Parameters
struct v4l2_ctrl *c: pointer tostruct v4l2_ctrl
v4l2_flash_init() #
struct v4l2_flash * initialize V4L2 flash led sub-device
Parameters
struct device *dev: flash device, e.g. an I2C devicestruct fwnode_handle *fwn: fwnode_handle of the LED, may be NULL if the same as device'sstruct led_classdev_flash *fled_cdev: LED flash class device to wrapconst struct v4l2_flash_ops *ops: V4L2 Flash device opsstruct v4l2_flash_config *config: initialization data for V4L2 Flash sub-device
Description
Create V4L2 Flash sub-device wrapping given LED subsystem device. The ops pointer is stored by the V4L2 flash framework. No references are held to config nor its contents once this function has returned.
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.
v4l2_flash_indicator_init() #
struct v4l2_flash * initialize V4L2 indicator sub-device
Parameters
struct device *dev: flash device, e.g. an I2C devicestruct fwnode_handle *fwn: fwnode_handle of the LED, may be NULL if the same as device'sstruct led_classdev *iled_cdev: LED flash class device representing the indicator LEDstruct v4l2_flash_config *config: initialization data for V4L2 Flash sub-device
Description
Create V4L2 Flash sub-device wrapping given LED subsystem device. The ops pointer is stored by the V4L2 flash framework. No references are held to config nor its contents once this function has returned.
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.
v4l2_flash_release() #
void release V4L2 Flash sub-device
Parameters
struct v4l2_flash *v4l2_flash: the V4L2 Flash sub-device to release
Description
Release V4L2 Flash sub-device.