[PATCH v2 4/6] media: uvcvideo: Document how to format GUIDs

Ricardo Ribalda posted 6 patches 2 months, 3 weeks ago
[PATCH v2 4/6] media: uvcvideo: Document how to format GUIDs
Posted by Ricardo Ribalda 2 months, 3 weeks ago
Manual formatting the GUIDs can lead to errors, document a
programmatically way to format the GUIDs from lsusb into something tha
the driver can use.

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
---
 include/linux/usb/uvc.h | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/include/linux/usb/uvc.h b/include/linux/usb/uvc.h
index b939a01da11466747249c64c72a3ea40cd364a59..dea23aabbad48270c807463c1a7e1c0d1b79fc1f 100644
--- a/include/linux/usb/uvc.h
+++ b/include/linux/usb/uvc.h
@@ -10,6 +10,14 @@
 
 /* ------------------------------------------------------------------------
  * GUIDs
+ *
+ * The GUID returned by lsusb can be converted to this format with the
+ * following python snippet:
+ *
+ * import uuid
+ * id = "{01234567-89ab-cdef-0123-456789abcdef}"
+ * le = uuid.UUID(id).bytes_le
+ * print("{" + ", ".join([f"0x{b:02x}" for b in le]) + "}")
  */
 #define UVC_GUID_UVC_CAMERA \
 	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \

-- 
2.52.0.rc1.455.g30608eb744-goog
Re: [PATCH v2 4/6] media: uvcvideo: Document how to format GUIDs
Posted by Laurent Pinchart 1 month, 2 weeks ago
Hi Ricardo,

Thank you for the patch.

On Wed, Nov 19, 2025 at 07:37:13PM +0000, Ricardo Ribalda wrote:
> Manual formatting the GUIDs can lead to errors, document a
> programmatically way to format the GUIDs from lsusb into something tha

s/tha/that/

> the driver can use.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
> ---
>  include/linux/usb/uvc.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/usb/uvc.h b/include/linux/usb/uvc.h
> index b939a01da11466747249c64c72a3ea40cd364a59..dea23aabbad48270c807463c1a7e1c0d1b79fc1f 100644
> --- a/include/linux/usb/uvc.h
> +++ b/include/linux/usb/uvc.h
> @@ -10,6 +10,14 @@
>  
>  /* ------------------------------------------------------------------------
>   * GUIDs
> + *
> + * The GUID returned by lsusb can be converted to this format with the
> + * following python snippet:
> + *
> + * import uuid
> + * id = "{01234567-89ab-cdef-0123-456789abcdef}"
> + * le = uuid.UUID(id).bytes_le
> + * print("{" + ", ".join([f"0x{b:02x}" for b in le]) + "}")

Note that lsusb has changed the endianness of the printed GUID at some
point :-/ That was in 2017 though, so I think we can ignore the issue
now.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

>   */
>  #define UVC_GUID_UVC_CAMERA \
>  	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \

-- 
Regards,

Laurent Pinchart
Re: [PATCH v2 4/6] media: uvcvideo: Document how to format GUIDs
Posted by Hans de Goede 2 months ago
Hi,

On 19-Nov-25 8:37 PM, Ricardo Ribalda wrote:
> Manual formatting the GUIDs can lead to errors, document a
> programmatically way to format the GUIDs from lsusb into something tha
> the driver can use.
> 
> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>

Thanks patch looks good to me:

Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>

Since this is independent of the rest of the series I've merged this into my local
uvc/for-next branch which I will push out later today.

Regards,

Hans



> ---
>  include/linux/usb/uvc.h | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/include/linux/usb/uvc.h b/include/linux/usb/uvc.h
> index b939a01da11466747249c64c72a3ea40cd364a59..dea23aabbad48270c807463c1a7e1c0d1b79fc1f 100644
> --- a/include/linux/usb/uvc.h
> +++ b/include/linux/usb/uvc.h
> @@ -10,6 +10,14 @@
>  
>  /* ------------------------------------------------------------------------
>   * GUIDs
> + *
> + * The GUID returned by lsusb can be converted to this format with the
> + * following python snippet:
> + *
> + * import uuid
> + * id = "{01234567-89ab-cdef-0123-456789abcdef}"
> + * le = uuid.UUID(id).bytes_le
> + * print("{" + ", ".join([f"0x{b:02x}" for b in le]) + "}")
>   */
>  #define UVC_GUID_UVC_CAMERA \
>  	{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \
>