Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af2d68d1 authored by Hans Verkuil's avatar Hans Verkuil Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b781e6be
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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;