Message ID | 20250507-ov9282-flash-strobe-v4-9-72b299c1b7c9@linux.dev |
---|---|
State | New |
Headers | show |
Series | Add strobe/flash duration v4l2 ctrl & use it for ov9282 | expand |
On Mon, May 26, 2025 at 08:24:40PM +0000, Sakari Ailus wrote: > Hi Richard, Hi Sakari, thanks for the review! > > On Wed, May 07, 2025 at 09:51:38AM +0200, Richard Leitner wrote: > > Add read-only V4L2_CID_FLASH_STROBE_SOURCE control. Its value is fixed > > to V4L2_FLASH_STROBE_SOURCE_EXTERNAL as the camera sensor triggers the > > strobe based on its register settings. > > Is strobe source control relevant for the sensor? It's triggering the flash > but the flash LED isn't connected to it, is it? Exactly. The sensor is only triggering a "strobe output" pin, but no LEDs are on the sensor module. Nonetheless at least in our use-case the LEDs are switched directly by this output pin of the sensor (via some FET circuit). So to be honest I don't know if it is relevant, or not. I guess the sensor in this case is a "external strobe source" as seen from the kernel, isn't it? > > > > > Signed-off-by: Richard Leitner <richard.leitner@linux.dev> > > --- > > drivers/media/i2c/ov9282.c | 11 ++++++++++- > > 1 file changed, 10 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c > > index 0bbdf08d7cda8f72e05fdc292aa69a4c821e4e03..09d522d5977ec6fb82028ddb6015f05c9328191d 100644 > > --- a/drivers/media/i2c/ov9282.c > > +++ b/drivers/media/i2c/ov9282.c > > @@ -1368,11 +1368,12 @@ static int ov9282_init_controls(struct ov9282 *ov9282) > > struct v4l2_ctrl_handler *ctrl_hdlr = &ov9282->ctrl_handler; > > const struct ov9282_mode *mode = ov9282->cur_mode; > > struct v4l2_fwnode_device_properties props; > > + struct v4l2_ctrl *ctrl; > > u32 hblank_min; > > u32 lpfr; > > int ret; > > > > - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 12); > > + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 13); > > if (ret) > > return ret; > > > > @@ -1447,6 +1448,14 @@ static int ov9282_init_controls(struct ov9282 *ov9282) > > v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, V4L2_CID_FLASH_DURATION, > > 0, 13900, 1, 8); > > > > + ctrl = v4l2_ctrl_new_std_menu(ctrl_hdlr, &ov9282_ctrl_ops, > > + V4L2_CID_FLASH_STROBE_SOURCE, > > + V4L2_FLASH_STROBE_SOURCE_EXTERNAL, > > + ~(1 << V4L2_FLASH_STROBE_SOURCE_EXTERNAL), > > + V4L2_FLASH_STROBE_SOURCE_EXTERNAL); > > + if (ctrl) > > + ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; > > + > > ret = v4l2_fwnode_device_parse(ov9282->dev, &props); > > if (!ret) { > > /* Failure sets ctrl_hdlr->error, which we check afterwards anyway */ > > > > -- > Regards, > > Sakari Ailus thanks & regards;rl
diff --git a/drivers/media/i2c/ov9282.c b/drivers/media/i2c/ov9282.c index 0bbdf08d7cda8f72e05fdc292aa69a4c821e4e03..09d522d5977ec6fb82028ddb6015f05c9328191d 100644 --- a/drivers/media/i2c/ov9282.c +++ b/drivers/media/i2c/ov9282.c @@ -1368,11 +1368,12 @@ static int ov9282_init_controls(struct ov9282 *ov9282) struct v4l2_ctrl_handler *ctrl_hdlr = &ov9282->ctrl_handler; const struct ov9282_mode *mode = ov9282->cur_mode; struct v4l2_fwnode_device_properties props; + struct v4l2_ctrl *ctrl; u32 hblank_min; u32 lpfr; int ret; - ret = v4l2_ctrl_handler_init(ctrl_hdlr, 12); + ret = v4l2_ctrl_handler_init(ctrl_hdlr, 13); if (ret) return ret; @@ -1447,6 +1448,14 @@ static int ov9282_init_controls(struct ov9282 *ov9282) v4l2_ctrl_new_std(ctrl_hdlr, &ov9282_ctrl_ops, V4L2_CID_FLASH_DURATION, 0, 13900, 1, 8); + ctrl = v4l2_ctrl_new_std_menu(ctrl_hdlr, &ov9282_ctrl_ops, + V4L2_CID_FLASH_STROBE_SOURCE, + V4L2_FLASH_STROBE_SOURCE_EXTERNAL, + ~(1 << V4L2_FLASH_STROBE_SOURCE_EXTERNAL), + V4L2_FLASH_STROBE_SOURCE_EXTERNAL); + if (ctrl) + ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; + ret = v4l2_fwnode_device_parse(ov9282->dev, &props); if (!ret) { /* Failure sets ctrl_hdlr->error, which we check afterwards anyway */
Add read-only V4L2_CID_FLASH_STROBE_SOURCE control. Its value is fixed to V4L2_FLASH_STROBE_SOURCE_EXTERNAL as the camera sensor triggers the strobe based on its register settings. Signed-off-by: Richard Leitner <richard.leitner@linux.dev> --- drivers/media/i2c/ov9282.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)