Skip to content

Commit e8e65d9

Browse files
ribaldaHans Verkuil
authored andcommitted
media: uvcvideo: Fix comments in uvc_meta_detect_msxu
The comments can be more precise. Let's fix them. Fixes: 6cb786f ("media: uvcvideo: Auto-set UVC_QUIRK_MSXU_META") Cc: stable+noautosel@kernel.org # Coment change only, no need to backport Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
1 parent f4da0de commit e8e65d9

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

drivers/media/usb/uvc/uvc_metadata.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,10 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
196196
if (!data)
197197
return -ENOMEM;
198198

199-
/* Check if the metadata is already enabled. */
199+
/*
200+
* Check if the metadata is already enabled, or if the device always
201+
* returns metadata.
202+
*/
200203
ret = uvc_query_ctrl(dev, UVC_GET_CUR, entity->id, dev->intfnum,
201204
MSXU_CONTROL_METADATA, data, sizeof(*data));
202205
if (ret)
@@ -208,9 +211,11 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
208211
}
209212

210213
/*
211-
* We have seen devices that require 1 to enable the metadata, others
212-
* requiring a value != 1 and others requiring a value >1. Luckily for
213-
* us, the value from GET_MAX seems to work all the time.
214+
* Set the value of MSXU_CONTROL_METADATA to the value reported by
215+
* GET_MAX to enable production of MSXU metadata. The GET_MAX request
216+
* reports the maximum size of the metadata, if its value is 0 then MSXU
217+
* metadata is not supported. For more information, see
218+
* https://learn.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5#2229-metadata-control
214219
*/
215220
ret = uvc_query_ctrl(dev, UVC_GET_MAX, entity->id, dev->intfnum,
216221
MSXU_CONTROL_METADATA, data, sizeof(*data));

0 commit comments

Comments
 (0)