aboutsummaryrefslogtreecommitdiffstats
path: root/include/media/v4l2-flash-led-class.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/media/v4l2-flash-led-class.h')
-rw-r--r--include/media/v4l2-flash-led-class.h48
1 files changed, 35 insertions, 13 deletions
diff --git a/include/media/v4l2-flash-led-class.h b/include/media/v4l2-flash-led-class.h
index f9dcd54c1745..5c1d50f78e12 100644
--- a/include/media/v4l2-flash-led-class.h
+++ b/include/media/v4l2-flash-led-class.h
@@ -56,8 +56,7 @@ struct v4l2_flash_ops {
* struct v4l2_flash_config - V4L2 Flash sub-device initialization data
* @dev_name: the name of the media entity,
* unique in the system
- * @torch_intensity: constraints for the LED in torch mode
- * @indicator_intensity: constraints for the indicator LED
+ * @intensity: non-flash strobe constraints for the LED
* @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
@@ -66,8 +65,7 @@ struct v4l2_flash_ops {
*/
struct v4l2_flash_config {
char dev_name[32];
- struct led_flash_setting torch_intensity;
- struct led_flash_setting indicator_intensity;
+ struct led_flash_setting intensity;
u32 flash_faults;
unsigned int has_external_strobe:1;
};
@@ -85,7 +83,7 @@ struct v4l2_flash_config {
*/
struct v4l2_flash {
struct led_classdev_flash *fled_cdev;
- struct led_classdev_flash *iled_cdev;
+ struct led_classdev *iled_cdev;
const struct v4l2_flash_ops *ops;
struct v4l2_subdev sd;
@@ -110,12 +108,13 @@ static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c)
* @dev: flash device, e.g. an I2C device
* @fwn: fwnode_handle of the LED, may be NULL if the same as device's
* @fled_cdev: LED flash class device to wrap
- * @iled_cdev: LED flash class device representing indicator LED associated
- * with fled_cdev, may be NULL
* @ops: V4L2 Flash device ops
* @config: initialization data for V4L2 Flash sub-device
*
* 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.
*
* Returns: A valid pointer, or, when an error occurs, the return
* value is encoded using ERR_PTR(). Use IS_ERR() to check and
@@ -124,9 +123,27 @@ static inline struct v4l2_flash *v4l2_ctrl_to_v4l2_flash(struct v4l2_ctrl *c)
struct v4l2_flash *v4l2_flash_init(
struct device *dev, struct fwnode_handle *fwn,
struct led_classdev_flash *fled_cdev,
- struct led_classdev_flash *iled_cdev,
- const struct v4l2_flash_ops *ops,
- struct v4l2_flash_config *config);
+ const struct v4l2_flash_ops *ops, struct v4l2_flash_config *config);
+
+/**
+ * v4l2_flash_indicator_init - initialize V4L2 indicator sub-device
+ * @dev: flash device, e.g. an I2C device
+ * @fwn: fwnode_handle of the LED, may be NULL if the same as device's
+ * @iled_cdev: LED flash class device representing the indicator LED
+ * @config: initialization data for V4L2 Flash sub-device
+ *
+ * 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.
+ *
+ * Returns: 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.
+ */
+struct v4l2_flash *v4l2_flash_indicator_init(
+ struct device *dev, struct fwnode_handle *fwn,
+ struct led_classdev *iled_cdev, struct v4l2_flash_config *config);
/**
* v4l2_flash_release - release V4L2 Flash sub-device
@@ -140,9 +157,14 @@ void v4l2_flash_release(struct v4l2_flash *v4l2_flash);
static inline struct v4l2_flash *v4l2_flash_init(
struct device *dev, struct fwnode_handle *fwn,
struct led_classdev_flash *fled_cdev,
- struct led_classdev_flash *iled_cdev,
- const struct v4l2_flash_ops *ops,
- struct v4l2_flash_config *config)
+ const struct v4l2_flash_ops *ops, struct v4l2_flash_config *config)
+{
+ return NULL;
+}
+
+static inline struct v4l2_flash *v4l2_flash_indicator_init(
+ struct device *dev, struct fwnode_handle *fwn,
+ struct led_classdev *iled_cdev, struct v4l2_flash_config *config)
{
return NULL;
}