提交 6b363f9f 编写于 作者: L Laurent Pinchart 提交者: Mauro Carvalho Chehab

[media] uvcvideo: Fix V4L2 button controls that share the same UVC control

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: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: NHans de Goede <hdegoede@redhat.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@redhat.com>
上级 e2b710bf
......@@ -1351,9 +1351,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册