Re: [PATCH 26/28] media: ov2680: Add g_skip_frames op support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hans,

Thank you for the patch.

On Wed, Jun 07, 2023 at 06:47:10PM +0200, Hans de Goede wrote:
> Add support for v4l2_subdev_sensor_ops.g_skip_frames.

The .g_skip_frames() subdev operation was a mistake in hindsight, and
should probably not be used in new drivers (or existing drivers that
don't use it yet). Why do you need it ?

> Signed-off-by: Hans de Goede <hdegoede@xxxxxxxxxx>
> ---
>  drivers/media/i2c/ov2680.c | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/drivers/media/i2c/ov2680.c b/drivers/media/i2c/ov2680.c
> index 867df602ee53..9e4f0bcbe979 100644
> --- a/drivers/media/i2c/ov2680.c
> +++ b/drivers/media/i2c/ov2680.c
> @@ -62,6 +62,8 @@
>  
>  #define OV2680_FRAME_RATE			30
>  
> +#define OV2680_SKIP_FRAMES			3
> +
>  #define OV2680_NATIVE_WIDTH			1616
>  #define OV2680_NATIVE_HEIGHT			1216
>  #define OV2680_NATIVE_START_LEFT		0
> @@ -759,6 +761,12 @@ static int ov2680_enum_frame_interval(struct v4l2_subdev *sd,
>  	return 0;
>  }
>  
> +static int ov2680_g_skip_frames(struct v4l2_subdev *sd, u32 *frames)
> +{
> +	*frames = OV2680_SKIP_FRAMES;
> +	return 0;
> +}
> +
>  static int ov2680_s_ctrl(struct v4l2_ctrl *ctrl)
>  {
>  	struct v4l2_subdev *sd = ctrl_to_sd(ctrl);
> @@ -806,6 +814,10 @@ static const struct v4l2_subdev_video_ops ov2680_video_ops = {
>  	.s_stream		= ov2680_s_stream,
>  };
>  
> +static const struct v4l2_subdev_sensor_ops ov2680_sensor_ops = {
> +	.g_skip_frames	= ov2680_g_skip_frames,
> +};
> +
>  static const struct v4l2_subdev_pad_ops ov2680_pad_ops = {
>  	.init_cfg		= ov2680_init_cfg,
>  	.enum_mbus_code		= ov2680_enum_mbus_code,
> @@ -820,6 +832,7 @@ static const struct v4l2_subdev_pad_ops ov2680_pad_ops = {
>  static const struct v4l2_subdev_ops ov2680_subdev_ops = {
>  	.video	= &ov2680_video_ops,
>  	.pad	= &ov2680_pad_ops,
> +	.sensor = &ov2680_sensor_ops,
>  };
>  
>  static int ov2680_mode_init(struct ov2680_dev *sensor)

-- 
Regards,

Laurent Pinchart



[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux