media: stm32-dcmi: add g/s_parm framerate support
authorHugues Fruchet <hugues.fruchet@st.com>
Thu, 8 Feb 2018 11:00:45 +0000 (06:00 -0500)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Mon, 26 Feb 2018 15:30:44 +0000 (10:30 -0500)
Add g/s_parm framerate support by calling subdev
g/s_frame_interval ops.
This allows user to control sensor framerate by
calling ioctl G/S_PARM.

Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/stm32/stm32-dcmi.c

index 6baea432e38296619be964cd2dd2ce8cf5dc1012..cc104a0805e29f01ba8820daf6eb7e7034c868ac 100644 (file)
@@ -1164,6 +1164,22 @@ static int dcmi_enum_framesizes(struct file *file, void *fh,
        return 0;
 }
 
+static int dcmi_g_parm(struct file *file, void *priv,
+                      struct v4l2_streamparm *p)
+{
+       struct stm32_dcmi *dcmi = video_drvdata(file);
+
+       return v4l2_g_parm_cap(video_devdata(file), dcmi->entity.subdev, p);
+}
+
+static int dcmi_s_parm(struct file *file, void *priv,
+                      struct v4l2_streamparm *p)
+{
+       struct stm32_dcmi *dcmi = video_drvdata(file);
+
+       return v4l2_s_parm_cap(video_devdata(file), dcmi->entity.subdev, p);
+}
+
 static int dcmi_enum_frameintervals(struct file *file, void *fh,
                                    struct v4l2_frmivalenum *fival)
 {
@@ -1266,6 +1282,9 @@ static const struct v4l2_ioctl_ops dcmi_ioctl_ops = {
        .vidioc_g_input                 = dcmi_g_input,
        .vidioc_s_input                 = dcmi_s_input,
 
+       .vidioc_g_parm                  = dcmi_g_parm,
+       .vidioc_s_parm                  = dcmi_s_parm,
+
        .vidioc_enum_framesizes         = dcmi_enum_framesizes,
        .vidioc_enum_frameintervals     = dcmi_enum_frameintervals,