summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivi.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2013-03-12 03:56:55 -0300
committerMauro Carvalho Chehab <mchehab@redhat.com>2013-03-24 14:11:22 -0300
commitaf2d68d1be24972a79b1616cf7d4d29137841f87 (patch)
treefae6be2d99a37fa47b1f8aab40e07fa7c24454e8 /drivers/media/platform/vivi.c
parentb781e6be79a394cd6980e9cd8fd5c25822d152b6 (diff)
downloadop-kernel-dev-af2d68d1be24972a79b1616cf7d4d29137841f87.zip
op-kernel-dev-af2d68d1be24972a79b1616cf7d4d29137841f87.tar.gz
[media] vivi: add v4l2_ctrl_modify_range test case
Update the brighness range depending on the selected input. Useful for testing control range events. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/platform/vivi.c')
-rw-r--r--drivers/media/platform/vivi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c
index c46d2e8..85bc314 100644
--- a/drivers/media/platform/vivi.c
+++ b/drivers/media/platform/vivi.c
@@ -1093,6 +1093,15 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
return 0;
dev->input = i;
+ /*
+ * Modify the brightness range depending on the input.
+ * This makes it easy to use vivi to test if applications can
+ * handle control range modifications and is also how this is
+ * typically used in practice as different inputs may be hooked
+ * up to different receivers with different control ranges.
+ */
+ v4l2_ctrl_modify_range(dev->brightness,
+ 128 * i, 255 + 128 * i, 1, 127 + 128 * i);
precalculate_bars(dev);
precalculate_line(dev);
return 0;
OpenPOWER on IntegriCloud