summaryrefslogtreecommitdiff
path: root/drivers/media/platform/vivid/vivid-core.c
diff options
context:
space:
mode:
authorJohan Korsnes <johan.korsnes@gmail.com>2019-06-18 03:37:18 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2019-06-21 17:26:21 -0400
commit448e11538f71933ba0ebd156bb176cf66827d6fd (patch)
treecd86891d41548f556cb86b2f8734a6aa9f03a591 /drivers/media/platform/vivid/vivid-core.c
parentb1b9b7bee370b552517efed60b41228838364e14 (diff)
media: vivid: make input dv_timings per-input
Make the following properties per-input -DV Timings Signal Mode -DV Timings These properties need to be per-input in order to implement proper HDMI (dis)connect-behavior, where the signal mode will be used to signify whether or not there is an input device connected. Signed-off-by: Johan Korsnes <johan.korsnes@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/platform/vivid/vivid-core.c')
-rw-r--r--drivers/media/platform/vivid/vivid-core.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/media/platform/vivid/vivid-core.c b/drivers/media/platform/vivid/vivid-core.c
index beb2e566a43c..f481f1768184 100644
--- a/drivers/media/platform/vivid/vivid-core.c
+++ b/drivers/media/platform/vivid/vivid-core.c
@@ -1005,7 +1005,8 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
tvnorms_cap = V4L2_STD_ALL;
if (dev->output_type[0] == SVID)
tvnorms_out = V4L2_STD_ALL;
- dev->dv_timings_cap = def_dv_timings;
+ for (i = 0; i < MAX_INPUTS; i++)
+ dev->dv_timings_cap[i] = def_dv_timings;
dev->dv_timings_out = def_dv_timings;
dev->tv_freq = 2804 /* 175.25 * 16 */;
dev->tv_audmode = V4L2_TUNER_MODE_STEREO;
@@ -1035,6 +1036,15 @@ static int vivid_create_instance(struct platform_device *pdev, int inst)
if (ret)
goto unreg_dev;
+ /* enable/disable interface specific controls */
+ if (dev->num_inputs && dev->input_type[0] != HDMI) {
+ v4l2_ctrl_activate(dev->ctrl_dv_timings_signal_mode, false);
+ v4l2_ctrl_activate(dev->ctrl_dv_timings, false);
+ } else if (dev->num_inputs && dev->input_type[0] == HDMI) {
+ v4l2_ctrl_activate(dev->ctrl_std_signal_mode, false);
+ v4l2_ctrl_activate(dev->ctrl_standard, false);
+ }
+
/*
* update the capture and output formats to do a proper initial
* configuration.