From: Hans de Goede <hdegoede@redhat.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org
Subject: Re: [PATCH] uvcvideo: Fix V4L2 button controls that share the same UVC control
Date: Fri, 11 May 2012 15:57:12 +0200 [thread overview]
Message-ID: <4FAD1AB8.5010103@redhat.com> (raw)
In-Reply-To: <1336744559-9247-1-git-send-email-laurent.pinchart@ideasonboard.com>
looks good, ack.
Acked-by: Hans de Goede <hdegoede@redhat.com>
On 05/11/2012 03:55 PM, Laurent Pinchart wrote:
> The Logitech pan/tilt reset UVC control contains two V4L2 button
> controls to reset pan and tilt. As the UVC control is not marked as
> auto-update, the button bits are set but never reset. A pan reset that
> follows a tilt reset would thus reset both pan and tilt.
>
> Fix this by not caching the control value of write-only controls. All
> standard UVC controls are either readable or auto-update, so this will
> not cause any regression and will not result in extra USB requests.
>
> Reported-by: Hans de Goede<hdegoede@redhat.com>
> Signed-off-by: Laurent Pinchart<laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/video/uvc/uvc_ctrl.c | 7 +++++--
> 1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/video/uvc/uvc_ctrl.c b/drivers/media/video/uvc/uvc_ctrl.c
> index 28363b7..3bc119b 100644
> --- a/drivers/media/video/uvc/uvc_ctrl.c
> +++ b/drivers/media/video/uvc/uvc_ctrl.c
> @@ -1348,9 +1348,12 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
>
> /* Reset the loaded flag for auto-update controls that were
> * marked as loaded in uvc_ctrl_get/uvc_ctrl_set to prevent
> - * uvc_ctrl_get from using the cached value.
> + * uvc_ctrl_get from using the cached value, and for write-only
> + * controls to prevent uvc_ctrl_set from setting bits not
> + * explicitly set by the user.
> */
> - if (ctrl->info.flags& UVC_CTRL_FLAG_AUTO_UPDATE)
> + if (ctrl->info.flags& UVC_CTRL_FLAG_AUTO_UPDATE ||
> + !(ctrl->info.flags& UVC_CTRL_FLAG_GET_CUR))
> ctrl->loaded = 0;
>
> if (!ctrl->dirty)
prev parent reply other threads:[~2012-05-11 13:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-11 13:55 [PATCH] uvcvideo: Fix V4L2 button controls that share the same UVC control Laurent Pinchart
2012-05-11 13:57 ` Hans de Goede [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4FAD1AB8.5010103@redhat.com \
--to=hdegoede@redhat.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.