summaryrefslogtreecommitdiff
path: root/drivers/media/platform/rcar-vin/rcar-v4l2.c
diff options
context:
space:
mode:
authorNiklas Söderlund <niklas.soderlund+renesas@ragnatech.se>2018-04-14 14:57:10 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-04-20 16:58:50 +0300
commit4f554bde63f94539f7d4cc44e2f1f9f3cb9ccdb3 (patch)
tree557966f8bd8efd34f786cfc67b65be7270c12622 /drivers/media/platform/rcar-vin/rcar-v4l2.c
parent897e371389e7751438bf59409cc7098b9599ce21 (diff)
downloadlinux-4f554bde63f94539f7d4cc44e2f1f9f3cb9ccdb3.tar.xz
media: rcar-vin: cache video standard
At stream on time the driver should not query the subdevice for which standard are used. Instead it should be cached when userspace sets the standard and used at stream on time. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/rcar-vin/rcar-v4l2.c')
-rw-r--r--drivers/media/platform/rcar-vin/rcar-v4l2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
index 84cad5d8c93a..9cdd00391c5c 100644
--- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
+++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
@@ -475,6 +475,8 @@ static int rvin_s_std(struct file *file, void *priv, v4l2_std_id a)
if (ret < 0)
return ret;
+ vin->std = a;
+
/* Changing the standard will change the width/height */
return rvin_reset_format(vin);
}
@@ -482,9 +484,13 @@ static int rvin_s_std(struct file *file, void *priv, v4l2_std_id a)
static int rvin_g_std(struct file *file, void *priv, v4l2_std_id *a)
{
struct rvin_dev *vin = video_drvdata(file);
- struct v4l2_subdev *sd = vin_to_source(vin);
- return v4l2_subdev_call(sd, video, g_std, a);
+ if (v4l2_subdev_has_op(vin_to_source(vin), pad, dv_timings_cap))
+ return -ENOIOCTLCMD;
+
+ *a = vin->std;
+
+ return 0;
}
static int rvin_subscribe_event(struct v4l2_fh *fh,