Skip to content

Commit bdacede

Browse files
jwrdegoedegregkh
authored andcommitted
media: uvcvideo: Fix uvc_ctrl_fixup_xu_info() not having any effect
commit 93df48d upstream. uvc_ctrl_add_info() calls uvc_ctrl_get_flags() which will override the fixed-up flags set by uvc_ctrl_fixup_xu_info(). uvc_ctrl_init_xu_ctrl() already calls uvc_ctrl_get_flags() before calling uvc_ctrl_add_info(), so the uvc_ctrl_get_flags() call in uvc_ctrl_add_info() is not necessary for xu ctrls. This commit moves the uvc_ctrl_get_flags() call for normal controls from uvc_ctrl_add_info() to uvc_ctrl_init_ctrl(), so that we no longer call uvc_ctrl_get_flags() twice for xu controls and so that we no longer override the fixed-up flags set by uvc_ctrl_fixup_xu_info(). This fixes the xu motor controls not working properly on a Logitech 046d:08cc, and presumably also on the other Logitech models which have a quirk for this in the uvc_ctrl_fixup_xu_info() function. Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bc8a557 commit bdacede

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

drivers/media/usb/uvc/uvc_ctrl.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2033,13 +2033,6 @@ static int uvc_ctrl_add_info(struct uvc_device *dev, struct uvc_control *ctrl,
20332033
goto done;
20342034
}
20352035

2036-
/*
2037-
* Retrieve control flags from the device. Ignore errors and work with
2038-
* default flag values from the uvc_ctrl array when the device doesn't
2039-
* properly implement GET_INFO on standard controls.
2040-
*/
2041-
uvc_ctrl_get_flags(dev, ctrl, &ctrl->info);
2042-
20432036
ctrl->initialized = 1;
20442037

20452038
uvc_trace(UVC_TRACE_CONTROL, "Added control %pUl/%u to device %s "
@@ -2262,6 +2255,13 @@ static void uvc_ctrl_init_ctrl(struct uvc_device *dev, struct uvc_control *ctrl)
22622255
if (uvc_entity_match_guid(ctrl->entity, info->entity) &&
22632256
ctrl->index == info->index) {
22642257
uvc_ctrl_add_info(dev, ctrl, info);
2258+
/*
2259+
* Retrieve control flags from the device. Ignore errors
2260+
* and work with default flag values from the uvc_ctrl
2261+
* array when the device doesn't properly implement
2262+
* GET_INFO on standard controls.
2263+
*/
2264+
uvc_ctrl_get_flags(dev, ctrl, &ctrl->info);
22652265
break;
22662266
}
22672267
}

0 commit comments

Comments
 (0)