diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-09-30 08:04:03 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-12-11 08:15:01 -0500 |
commit | c4d99f89e20c87c8e2a992ce4cf9aa4325dc7fa7 (patch) | |
tree | 958beaec46982f52a2b32a1836ffcae5b1eb5130 /drivers/media/video/uvc | |
parent | 3afedb95858bcc117b207a7c0a6767fe891bdfe9 (diff) |
[media] uvcvideo: Ignore GET_RES error for XU controls
GET_RES request support is mandatory for extension units, but some
cameras still choke on it (one example is the Logitech QuickCam PTZ that
returns a single byte for the PTZ relative control instead of four).
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 17 | ||||
-rw-r--r-- | drivers/media/video/uvc/uvcvideo.h | 1 |
2 files changed, 16 insertions, 2 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index 254d32688843..3e849d977bd4 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -878,8 +878,21 @@ static int uvc_ctrl_populate_cache(struct uvc_video_chain *chain, | |||
878 | chain->dev->intfnum, ctrl->info.selector, | 878 | chain->dev->intfnum, ctrl->info.selector, |
879 | uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES), | 879 | uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES), |
880 | ctrl->info.size); | 880 | ctrl->info.size); |
881 | if (ret < 0) | 881 | if (ret < 0) { |
882 | return ret; | 882 | if (UVC_ENTITY_TYPE(ctrl->entity) != |
883 | UVC_VC_EXTENSION_UNIT) | ||
884 | return ret; | ||
885 | |||
886 | /* GET_RES is mandatory for XU controls, but some | ||
887 | * cameras still choke on it. Ignore errors and set the | ||
888 | * resolution value to zero. | ||
889 | */ | ||
890 | uvc_warn_once(chain->dev, UVC_WARN_XU_GET_RES, | ||
891 | "UVC non compliance - GET_RES failed on " | ||
892 | "an XU control. Enabling workaround.\n"); | ||
893 | memset(uvc_ctrl_data(ctrl, UVC_CTRL_DATA_RES), 0, | ||
894 | ctrl->info.size); | ||
895 | } | ||
883 | } | 896 | } |
884 | 897 | ||
885 | ctrl->cached = 1; | 898 | ctrl->cached = 1; |
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index 882159aab610..2b84cbb49665 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h | |||
@@ -477,6 +477,7 @@ struct uvc_driver { | |||
477 | 477 | ||
478 | #define UVC_WARN_MINMAX 0 | 478 | #define UVC_WARN_MINMAX 0 |
479 | #define UVC_WARN_PROBE_DEF 1 | 479 | #define UVC_WARN_PROBE_DEF 1 |
480 | #define UVC_WARN_XU_GET_RES 2 | ||
480 | 481 | ||
481 | extern unsigned int uvc_clock_param; | 482 | extern unsigned int uvc_clock_param; |
482 | extern unsigned int uvc_no_drop_param; | 483 | extern unsigned int uvc_no_drop_param; |