@@ -1784,6 +1784,16 @@ int uvc_ctrl_get(struct uvc_video_chain *chain,
id = UVC_CTRL_DATA_DEF;
query = UVC_GET_DEF;
break;
+ case V4L2_CTRL_WHICH_MIN_VAL:
+ flag = UVC_CTRL_FLAG_GET_MIN;
+ id = UVC_CTRL_DATA_MIN;
+ query = UVC_GET_MIN;
+ break;
+ case V4L2_CTRL_WHICH_MAX_VAL:
+ flag = UVC_CTRL_FLAG_GET_MAX;
+ id = UVC_CTRL_DATA_MAX;
+ query = UVC_GET_MAX;
+ break;
case V4L2_CTRL_WHICH_CUR_VAL:
default:
return __uvc_ctrl_get(chain, ctrl, mapping, xctrl);
@@ -1038,7 +1038,9 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file, void *fh,
if (ret < 0)
return ret;
- if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL) {
+ if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL ||
+ ctrls->which == V4L2_CTRL_WHICH_MIN_VAL ||
+ ctrls->which == V4L2_CTRL_WHICH_MAX_VAL) {
for (i = 0; i < ctrls->count; ++ctrl, ++i) {
ret = uvc_ctrl_get(chain, ctrl, ctrls->which);
if (ret < 0) {
Add support for V4L2_CTRL_WHICH_MIN/MAX_VAL in uvc driver. It is useful for the V4L2_CID_UVC_REGION_OF_INTEREST_RECT control. Signed-off-by: Yunke Cao <yunkec@google.com> --- drivers/media/usb/uvc/uvc_ctrl.c | 10 ++++++++++ drivers/media/usb/uvc/uvc_v4l2.c | 4 +++- 2 files changed, 13 insertions(+), 1 deletion(-)