diff options
author | Laurent Pinchart <laurent.pinchart@skynet.be> | 2009-02-14 17:26:56 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-03-30 11:42:51 -0400 |
commit | 72362422f3a9cb66e26fa9f0d90d3ef5241e78ba (patch) | |
tree | 5a59c61da4a1bf1adf487f3279cb5f2c494b66f7 /drivers/media/video/uvc | |
parent | 4a5aa62bd5e27d90ceb11bc256de659d5c99e0dc (diff) |
V4L/DVB (10650): uvcvideo: Initialize streaming parameters with the probe control value
The UVC specification requires SET_CUR requests on the streaming commit control
to use values retrieved from a successful GET_CUR request on the probe control.
Initialize streaming parameters with the probe control current value to make
sure the driver always complies.
Signed-off-by: Laurent Pinchart <laurent.pinchart@skynet.be>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_video.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c index 7ebb89539c36..9139086f940a 100644 --- a/drivers/media/video/uvc/uvc_video.c +++ b/drivers/media/video/uvc/uvc_video.c | |||
@@ -1026,11 +1026,20 @@ int uvc_video_init(struct uvc_video_device *video) | |||
1026 | */ | 1026 | */ |
1027 | usb_set_interface(video->dev->udev, video->streaming->intfnum, 0); | 1027 | usb_set_interface(video->dev->udev, video->streaming->intfnum, 0); |
1028 | 1028 | ||
1029 | /* Some webcams don't suport GET_DEF requests on the probe control. We | 1029 | /* Set the streaming probe control with default streaming parameters |
1030 | * fall back to GET_CUR if GET_DEF fails. | 1030 | * retrieved from the device. Webcams that don't suport GET_DEF |
1031 | * requests on the probe control will just keep their current streaming | ||
1032 | * parameters. | ||
1031 | */ | 1033 | */ |
1032 | if ((ret = uvc_get_video_ctrl(video, probe, 1, GET_DEF)) < 0 && | 1034 | if (uvc_get_video_ctrl(video, probe, 1, GET_DEF) == 0) |
1033 | (ret = uvc_get_video_ctrl(video, probe, 1, GET_CUR)) < 0) | 1035 | uvc_set_video_ctrl(video, probe, 1); |
1036 | |||
1037 | /* Initialize the streaming parameters with the probe control current | ||
1038 | * value. This makes sure SET_CUR requests on the streaming commit | ||
1039 | * control will always use values retrieved from a successful GET_CUR | ||
1040 | * request on the probe control, as required by the UVC specification. | ||
1041 | */ | ||
1042 | if ((ret = uvc_get_video_ctrl(video, probe, 1, GET_CUR)) < 0) | ||
1034 | return ret; | 1043 | return ret; |
1035 | 1044 | ||
1036 | /* Check if the default format descriptor exists. Use the first | 1045 | /* Check if the default format descriptor exists. Use the first |