diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2013-03-12 02:56:55 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2013-03-24 13:11:22 -0400 |
commit | af2d68d1be24972a79b1616cf7d4d29137841f87 (patch) | |
tree | fae6be2d99a37fa47b1f8aab40e07fa7c24454e8 | |
parent | b781e6be79a394cd6980e9cd8fd5c25822d152b6 (diff) |
[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>
-rw-r--r-- | drivers/media/platform/vivi.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c index c46d2e8677a5..85bc314382d3 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) | |||
1093 | return 0; | 1093 | return 0; |
1094 | 1094 | ||
1095 | dev->input = i; | 1095 | dev->input = i; |
1096 | /* | ||
1097 | * Modify the brightness range depending on the input. | ||
1098 | * This makes it easy to use vivi to test if applications can | ||
1099 | * handle control range modifications and is also how this is | ||
1100 | * typically used in practice as different inputs may be hooked | ||
1101 | * up to different receivers with different control ranges. | ||
1102 | */ | ||
1103 | v4l2_ctrl_modify_range(dev->brightness, | ||
1104 | 128 * i, 255 + 128 * i, 1, 127 + 128 * i); | ||
1096 | precalculate_bars(dev); | 1105 | precalculate_bars(dev); |
1097 | precalculate_line(dev); | 1106 | precalculate_line(dev); |
1098 | return 0; | 1107 | return 0; |