summaryrefslogtreecommitdiff
path: root/drivers/media/usb/uvc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2025-07-15 21:52:54 +0300
committerHans Verkuil <hverkuil+cisco@kernel.org>2025-09-13 18:34:59 +0200
commit1ab40529ad52f339975886a6a9e815dfdcb8d011 (patch)
treeb5aa8cf6c4d95ffd8b543d36a5c71bea42a24c12 /drivers/media/usb/uvc
parent50c320a5f7065de7b0bcba67f72d23e40188bc70 (diff)
media: uvcvideo: Move MSXU_CONTROL_METADATA definition to header
Move the MSXU_CONTROL_METADATA control definitino to the include/linux/usb/uvc.h header, alongside the corresponding XU GUID. Add a UVC_ prefix to avoid namespace clashes. While at it, add the definition for the other controls for that extension unit, as defined in https://learn.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5#222-extension-unit-controls. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'drivers/media/usb/uvc')
-rw-r--r--drivers/media/usb/uvc/uvc_metadata.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/media/usb/uvc/uvc_metadata.c b/drivers/media/usb/uvc/uvc_metadata.c
index 7368400734a3..b35111d08759 100644
--- a/drivers/media/usb/uvc/uvc_metadata.c
+++ b/drivers/media/usb/uvc/uvc_metadata.c
@@ -171,7 +171,6 @@ static struct uvc_entity *uvc_meta_find_msxu(struct uvc_device *dev)
return NULL;
}
-#define MSXU_CONTROL_METADATA 0x9
static int uvc_meta_detect_msxu(struct uvc_device *dev)
{
u32 *data __free(kfree) = NULL;
@@ -195,7 +194,7 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
* returns metadata.
*/
ret = uvc_query_ctrl(dev, UVC_GET_CUR, entity->id, dev->intfnum,
- MSXU_CONTROL_METADATA, data, sizeof(*data));
+ UVC_MSXU_CONTROL_METADATA, data, sizeof(*data));
if (ret)
return 0;
@@ -205,23 +204,23 @@ static int uvc_meta_detect_msxu(struct uvc_device *dev)
}
/*
- * Set the value of MSXU_CONTROL_METADATA to the value reported by
+ * Set the value of UVC_MSXU_CONTROL_METADATA to the value reported by
* GET_MAX to enable production of MSXU metadata. The GET_MAX request
* reports the maximum size of the metadata, if its value is 0 then MSXU
* metadata is not supported. For more information, see
* https://learn.microsoft.com/en-us/windows-hardware/drivers/stream/uvc-extensions-1-5#2229-metadata-control
*/
ret = uvc_query_ctrl(dev, UVC_GET_MAX, entity->id, dev->intfnum,
- MSXU_CONTROL_METADATA, data, sizeof(*data));
+ UVC_MSXU_CONTROL_METADATA, data, sizeof(*data));
if (ret || !*data)
return 0;
/*
- * If we can set MSXU_CONTROL_METADATA, the device will report
+ * If we can set UVC_MSXU_CONTROL_METADATA, the device will report
* metadata.
*/
ret = uvc_query_ctrl(dev, UVC_SET_CUR, entity->id, dev->intfnum,
- MSXU_CONTROL_METADATA, data, sizeof(*data));
+ UVC_MSXU_CONTROL_METADATA, data, sizeof(*data));
if (!ret)
dev->quirks |= UVC_QUIRK_MSXU_META;