summaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorSowjanya Komatineni <skomatineni@nvidia.com>2020-12-11 18:02:35 +0100
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-01-04 12:57:39 +0100
commit52b21a0aed900b99b4fc5ee3d71d55d36e7f4621 (patch)
tree8236e0e68320e2f549d0802141faa896694390cd /drivers/staging
parent4281d115a4eba3b7767a214ed09613c2e1f0c4ea (diff)
downloadlinux-stable-52b21a0aed900b99b4fc5ee3d71d55d36e7f4621.tar.gz
linux-stable-52b21a0aed900b99b4fc5ee3d71d55d36e7f4621.tar.bz2
linux-stable-52b21a0aed900b99b4fc5ee3d71d55d36e7f4621.zip
media: tegra-video: Add support for EDID ioctl ops
This patch adds support for EDID get and set v4l2 ioctl ops to use with HDMI to CSI bridges. Signed-off-by: Sowjanya Komatineni <skomatineni@nvidia.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/media/tegra-video/vi.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/staging/media/tegra-video/vi.c b/drivers/staging/media/tegra-video/vi.c
index d01e88de6b31..bc38136eae35 100644
--- a/drivers/staging/media/tegra-video/vi.c
+++ b/drivers/staging/media/tegra-video/vi.c
@@ -721,6 +721,32 @@ static int tegra_channel_s_selection(struct file *file, void *fh,
return ret;
}
+static int tegra_channel_g_edid(struct file *file, void *fh,
+ struct v4l2_edid *edid)
+{
+ struct tegra_vi_channel *chan = video_drvdata(file);
+ struct v4l2_subdev *subdev;
+
+ subdev = tegra_channel_get_remote_source_subdev(chan);
+ if (!v4l2_subdev_has_op(subdev, pad, get_edid))
+ return -ENOTTY;
+
+ return v4l2_subdev_call(subdev, pad, get_edid, edid);
+}
+
+static int tegra_channel_s_edid(struct file *file, void *fh,
+ struct v4l2_edid *edid)
+{
+ struct tegra_vi_channel *chan = video_drvdata(file);
+ struct v4l2_subdev *subdev;
+
+ subdev = tegra_channel_get_remote_source_subdev(chan);
+ if (!v4l2_subdev_has_op(subdev, pad, set_edid))
+ return -ENOTTY;
+
+ return v4l2_subdev_call(subdev, pad, set_edid, edid);
+}
+
static int tegra_channel_g_dv_timings(struct file *file, void *fh,
struct v4l2_dv_timings *timings)
{
@@ -873,6 +899,8 @@ static const struct v4l2_ioctl_ops tegra_channel_ioctl_ops = {
.vidioc_unsubscribe_event = v4l2_event_unsubscribe,
.vidioc_g_selection = tegra_channel_g_selection,
.vidioc_s_selection = tegra_channel_s_selection,
+ .vidioc_g_edid = tegra_channel_g_edid,
+ .vidioc_s_edid = tegra_channel_s_edid,
.vidioc_g_dv_timings = tegra_channel_g_dv_timings,
.vidioc_s_dv_timings = tegra_channel_s_dv_timings,
.vidioc_query_dv_timings = tegra_channel_query_dv_timings,