Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uvcvideo: Run uvc_ctrl_init_ctrl for all controls

The function uvc_ctrl_init_ctrl() is called for every control for every
entity, but it exits early if the entity is a extension unit. The comment
claims that this is done to avoid querying XU controls during probe.

We only query a control if its entity GUIDs and index matches the
uvc_ctrls list. There are only controls for the following GUIDs:
UVC_GUID_UVC_PROCESSING, UVC_GUID_UVC_CAMERA and
UVC_GUID_EXT_GPIO_CONTROLLER.

In other words, XU controls will not be queried even without this
condition.

In future patches we want to add ChromeOS XU controls that need to the
initialized. We will make sure that all cameras with ChromeOS XU can
be queried at probe time.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Hans de Goede <hansg@kernel.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Ricardo Ribalda and committed by
Hans Verkuil
04ddfcdb c01ae95e

-9
-9
drivers/media/usb/uvc/uvc_ctrl.c
··· 3181 3181 { 3182 3182 unsigned int i; 3183 3183 3184 - /* 3185 - * XU controls initialization requires querying the device for control 3186 - * information. As some buggy UVC devices will crash when queried 3187 - * repeatedly in a tight loop, delay XU controls initialization until 3188 - * first use. 3189 - */ 3190 - if (UVC_ENTITY_TYPE(ctrl->entity) == UVC_VC_EXTENSION_UNIT) 3191 - return; 3192 - 3193 3184 for (i = 0; i < ARRAY_SIZE(uvc_ctrls); ++i) { 3194 3185 const struct uvc_control_info *info = &uvc_ctrls[i]; 3195 3186