usb: gadget: uvc: Add grey and I420 YUV UVC format support

uvc_formats[] needs to be updated with bitsperpixel,fcc tuple so that
these formats can be passed by user space to S_FMT ioctl.

user space must use streaming/uncompressed/u/guidFormat to specify
the guid.

user space must use streaming/uncompressed/u/bBitsPerPixel to set
the bitsperpixel. In this case they are 8 and 12 respectively
for grey and yuv420.

GUID for these formats taken from drivers/media/usb/uvc/uvc_driver.c

V4L2_PIX_FMT_GREY:

	{ 'Y',  '8',  ' ',  ' ', 0x00, 0x00, 0x10, 0x00,
	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

	(bitsperpixel) : 8

V4L2_PIX_FMT_YUV420:

	{ 'I',  '4',  '2',  '0', 0x00, 0x00, 0x10, 0x00, \
	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}

	(bitsperpixel) : 12

Change-Id: I6c164e4d77d4af03223f16a088ee743fbf0878b9
Signed-off-by: Akash Kumar <[email protected]>
This commit is contained in:
Akash Kumar 2025-10-13 15:54:38 +05:30
commit 0308b8b14b

View file

@ -58,6 +58,8 @@ struct uvc_format {
static struct uvc_format uvc_formats[] = {
{ 16, V4L2_PIX_FMT_YUYV },
{ 0, V4L2_PIX_FMT_MJPEG },
{ 12, V4L2_PIX_FMT_YUV420 },
{ 8, V4L2_PIX_FMT_GREY },
};
static int