media: rcar-vin: add G/S_PARM ioctls
authorVladimir Barinov <vladimir.barinov@cogentembedded.com>
Fri, 24 Sep 2021 13:51:38 +0000 (14:51 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 19 Oct 2021 07:08:38 +0000 (08:08 +0100)
This adds g/s_parm ioctls for parallel interface.

Signed-off-by: Vladimir Barinov <vladimir.barinov@cogentembedded.com>
Signed-off-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/platform/rcar-vin/rcar-v4l2.c

index bdeff51..a5bfa76 100644 (file)
@@ -527,6 +527,24 @@ static int rvin_s_selection(struct file *file, void *fh,
        return 0;
 }
 
+static int rvin_g_parm(struct file *file, void *priv,
+                      struct v4l2_streamparm *parm)
+{
+       struct rvin_dev *vin = video_drvdata(file);
+       struct v4l2_subdev *sd = vin_to_source(vin);
+
+       return v4l2_g_parm_cap(&vin->vdev, sd, parm);
+}
+
+static int rvin_s_parm(struct file *file, void *priv,
+                      struct v4l2_streamparm *parm)
+{
+       struct rvin_dev *vin = video_drvdata(file);
+       struct v4l2_subdev *sd = vin_to_source(vin);
+
+       return v4l2_s_parm_cap(&vin->vdev, sd, parm);
+}
+
 static int rvin_g_pixelaspect(struct file *file, void *priv,
                              int type, struct v4l2_fract *f)
 {
@@ -743,6 +761,9 @@ static const struct v4l2_ioctl_ops rvin_ioctl_ops = {
        .vidioc_g_selection             = rvin_g_selection,
        .vidioc_s_selection             = rvin_s_selection,
 
+       .vidioc_g_parm                  = rvin_g_parm,
+       .vidioc_s_parm                  = rvin_s_parm,
+
        .vidioc_g_pixelaspect           = rvin_g_pixelaspect,
 
        .vidioc_enum_input              = rvin_enum_input,