Skip to content

Commit

Permalink
[media] vivi: add v4l2_ctrl_modify_range test case
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 24, 2013
1 parent b781e6b commit af2d68d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/media/platform/vivi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit af2d68d

Please sign in to comment.