diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2010-04-25 15:23:24 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-05-19 11:58:43 -0400 |
commit | a90ef69c1f67319ddbba0170767c660c7fb5d4c9 (patch) | |
tree | 80ef25cdc97a38870e0c6145b3acbd0bf1be05bd /drivers/media/video | |
parent | 61421206833a4085d9bdf35b2b84cd9a67dfdfac (diff) |
V4L/DVB: uvcvideo: Flag relative controls as write-only
The UVC relative controls (exposure time, iris, focus, zoom, pan/tilt)
are write-only (despite the UVC specification stating that the GET_CUR
request is mandatory). Mark the controls as such, and report the related
V4L2 controls V4L2_CTRL_FLAG_WRITE_ONLY.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video')
-rw-r--r-- | drivers/media/video/uvc/uvc_ctrl.c | 28 |
1 files changed, 16 insertions, 12 deletions
diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c index 5d6d7bda2336..2703c9524396 100644 --- a/drivers/media/video/uvc/uvc_ctrl.c +++ b/drivers/media/video/uvc/uvc_ctrl.c | |||
@@ -217,8 +217,7 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
217 | .selector = UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL, | 217 | .selector = UVC_CT_EXPOSURE_TIME_RELATIVE_CONTROL, |
218 | .index = 4, | 218 | .index = 4, |
219 | .size = 1, | 219 | .size = 1, |
220 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR | 220 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_RESTORE, |
221 | | UVC_CONTROL_RESTORE, | ||
222 | }, | 221 | }, |
223 | { | 222 | { |
224 | .entity = UVC_GUID_UVC_CAMERA, | 223 | .entity = UVC_GUID_UVC_CAMERA, |
@@ -233,8 +232,9 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
233 | .selector = UVC_CT_FOCUS_RELATIVE_CONTROL, | 232 | .selector = UVC_CT_FOCUS_RELATIVE_CONTROL, |
234 | .index = 6, | 233 | .index = 6, |
235 | .size = 2, | 234 | .size = 2, |
236 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE | 235 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_MIN |
237 | | UVC_CONTROL_AUTO_UPDATE, | 236 | | UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES |
237 | | UVC_CONTROL_GET_DEF | UVC_CONTROL_AUTO_UPDATE, | ||
238 | }, | 238 | }, |
239 | { | 239 | { |
240 | .entity = UVC_GUID_UVC_CAMERA, | 240 | .entity = UVC_GUID_UVC_CAMERA, |
@@ -249,8 +249,7 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
249 | .selector = UVC_CT_IRIS_RELATIVE_CONTROL, | 249 | .selector = UVC_CT_IRIS_RELATIVE_CONTROL, |
250 | .index = 8, | 250 | .index = 8, |
251 | .size = 1, | 251 | .size = 1, |
252 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_CUR | 252 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_AUTO_UPDATE, |
253 | | UVC_CONTROL_AUTO_UPDATE, | ||
254 | }, | 253 | }, |
255 | { | 254 | { |
256 | .entity = UVC_GUID_UVC_CAMERA, | 255 | .entity = UVC_GUID_UVC_CAMERA, |
@@ -265,8 +264,9 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
265 | .selector = UVC_CT_ZOOM_RELATIVE_CONTROL, | 264 | .selector = UVC_CT_ZOOM_RELATIVE_CONTROL, |
266 | .index = 10, | 265 | .index = 10, |
267 | .size = 3, | 266 | .size = 3, |
268 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE | 267 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_MIN |
269 | | UVC_CONTROL_AUTO_UPDATE, | 268 | | UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES |
269 | | UVC_CONTROL_GET_DEF | UVC_CONTROL_AUTO_UPDATE, | ||
270 | }, | 270 | }, |
271 | { | 271 | { |
272 | .entity = UVC_GUID_UVC_CAMERA, | 272 | .entity = UVC_GUID_UVC_CAMERA, |
@@ -281,8 +281,9 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
281 | .selector = UVC_CT_PANTILT_RELATIVE_CONTROL, | 281 | .selector = UVC_CT_PANTILT_RELATIVE_CONTROL, |
282 | .index = 12, | 282 | .index = 12, |
283 | .size = 4, | 283 | .size = 4, |
284 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE | 284 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_MIN |
285 | | UVC_CONTROL_AUTO_UPDATE, | 285 | | UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES |
286 | | UVC_CONTROL_GET_DEF | UVC_CONTROL_AUTO_UPDATE, | ||
286 | }, | 287 | }, |
287 | { | 288 | { |
288 | .entity = UVC_GUID_UVC_CAMERA, | 289 | .entity = UVC_GUID_UVC_CAMERA, |
@@ -297,8 +298,9 @@ static struct uvc_control_info uvc_ctrls[] = { | |||
297 | .selector = UVC_CT_ROLL_RELATIVE_CONTROL, | 298 | .selector = UVC_CT_ROLL_RELATIVE_CONTROL, |
298 | .index = 14, | 299 | .index = 14, |
299 | .size = 2, | 300 | .size = 2, |
300 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_RANGE | 301 | .flags = UVC_CONTROL_SET_CUR | UVC_CONTROL_GET_MIN |
301 | | UVC_CONTROL_AUTO_UPDATE, | 302 | | UVC_CONTROL_GET_MAX | UVC_CONTROL_GET_RES |
303 | | UVC_CONTROL_GET_DEF | UVC_CONTROL_AUTO_UPDATE, | ||
302 | }, | 304 | }, |
303 | { | 305 | { |
304 | .entity = UVC_GUID_UVC_CAMERA, | 306 | .entity = UVC_GUID_UVC_CAMERA, |
@@ -842,6 +844,8 @@ int uvc_query_v4l2_ctrl(struct uvc_video_chain *chain, | |||
842 | strlcpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); | 844 | strlcpy(v4l2_ctrl->name, mapping->name, sizeof v4l2_ctrl->name); |
843 | v4l2_ctrl->flags = 0; | 845 | v4l2_ctrl->flags = 0; |
844 | 846 | ||
847 | if (!(ctrl->info->flags & UVC_CONTROL_GET_CUR)) | ||
848 | v4l2_ctrl->flags |= V4L2_CTRL_FLAG_WRITE_ONLY; | ||
845 | if (!(ctrl->info->flags & UVC_CONTROL_SET_CUR)) | 849 | if (!(ctrl->info->flags & UVC_CONTROL_SET_CUR)) |
846 | v4l2_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; | 850 | v4l2_ctrl->flags |= V4L2_CTRL_FLAG_READ_ONLY; |
847 | 851 | ||