Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1259536
| From | Laurent Pinchart <laurent.pinchart@ideasonboard.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2 4/6] usb/uvc: Support for V4L2_CTRL_WHICH_DEF_VAL |
| Date | 2015-10-30 15:30 +0100 |
| Message-ID | <qpiQP-6Tg-35@gated-at.bofh.it> (permalink) |
| References | <qoStk-7jq-5@gated-at.bofh.it> <qoStk-7jq-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Hi Ricardo,
Thank you for the patch.
On Thursday 29 October 2015 11:10:30 Ricardo Ribalda Delgado wrote:
> This driver does not use the control infrastructure.
> Add support for the new field which on structure
> v4l2_ext_controls
>
> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/usb/uvc/uvc_v4l2.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/media/usb/uvc/uvc_v4l2.c
> b/drivers/media/usb/uvc/uvc_v4l2.c index 2764f43607c1..d7723ce772b3 100644
> --- a/drivers/media/usb/uvc/uvc_v4l2.c
> +++ b/drivers/media/usb/uvc/uvc_v4l2.c
> @@ -983,6 +983,22 @@ static int uvc_ioctl_g_ext_ctrls(struct file *file,
> void *fh, unsigned int i;
> int ret;
>
> + if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL) {
> + for (i = 0; i < ctrls->count; ++ctrl, ++i) {
> + struct v4l2_queryctrl qc = { .id = ctrl->id };
> +
> + ret = uvc_query_v4l2_ctrl(chain, &qc);
> + if (ret < 0) {
> + ctrls->error_idx = i;
> + return ret;
> + }
> +
> + ctrl->value = qc.default_value;
> + }
> +
> + return 0;
> + }
> +
> ret = uvc_ctrl_begin(chain);
> if (ret < 0)
> return ret;
> @@ -1010,6 +1026,10 @@ static int uvc_ioctl_s_try_ext_ctrls(struct uvc_fh
> *handle, unsigned int i;
> int ret;
>
> + /* Default value cannot be changed */
> + if (ctrls->which == V4L2_CTRL_WHICH_DEF_VAL)
> + return -EINVAL;
> +
> ret = uvc_ctrl_begin(chain);
> if (ret < 0)
> return ret;
--
Regards,
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2 0/6] Support getting default values from any control Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - 2015-10-29 11:20 +0100
[PATCH v2 4/6] usb/uvc: Support for V4L2_CTRL_WHICH_DEF_VAL Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - 2015-10-29 11:20 +0100
Re: [PATCH v2 4/6] usb/uvc: Support for V4L2_CTRL_WHICH_DEF_VAL Laurent Pinchart <laurent.pinchart@ideasonboard.com> - 2015-10-30 15:30 +0100
[PATCH v2 5/6] media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> - 2015-10-29 11:20 +0100
Re: [PATCH v2 5/6] media/usb/pvrusb2: Support for V4L2_CTRL_WHICH_DEF_VAL Mike Isely <isely@isely.net> - 2015-10-29 16:40 +0100
csiph-web