]> bbs.cooldavid.org Git - net-next-2.6.git/commit
V4L/DVB: uvcvideo: Clamp control values to the minimum and maximum values
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sat, 23 Jan 2010 10:07:53 +0000 (07:07 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 26 Feb 2010 18:11:04 +0000 (15:11 -0300)
commite54532e591cd5b9ce77dbc8d9786ae9f600f101a
tree725c07637e0197acd3176827299d4186962221e4
parent59529081e092506edb81a42d914e2d0522f65ca7
V4L/DVB: uvcvideo: Clamp control values to the minimum and maximum values

When setting a control, the V4L2 specification requires drivers to
either clamp the control value to the [minimum, maximum] range or return
the -ERANGE error.

Fix the driver to clamp control values to the valid range in
uvc_ctrl_set() and make sure the value differs from the minimum by an
integer multiple of step.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Márton Németh <nm127@freemail.hu>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/video/uvc/uvc_ctrl.c
drivers/media/video/uvc/uvc_v4l2.c