162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */ 262306a36Sopenharmony_ci/* 362306a36Sopenharmony_ci * v4l2 uvc internal API header 462306a36Sopenharmony_ci * 562306a36Sopenharmony_ci * Some commonly needed functions for uvc drivers 662306a36Sopenharmony_ci */ 762306a36Sopenharmony_ci 862306a36Sopenharmony_ci#ifndef __LINUX_V4L2_UVC_H 962306a36Sopenharmony_ci#define __LINUX_V4L2_UVC_H 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci/* ------------------------------------------------------------------------ 1262306a36Sopenharmony_ci * GUIDs 1362306a36Sopenharmony_ci */ 1462306a36Sopenharmony_ci#define UVC_GUID_UVC_CAMERA \ 1562306a36Sopenharmony_ci {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 1662306a36Sopenharmony_ci 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01} 1762306a36Sopenharmony_ci#define UVC_GUID_UVC_OUTPUT \ 1862306a36Sopenharmony_ci {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 1962306a36Sopenharmony_ci 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02} 2062306a36Sopenharmony_ci#define UVC_GUID_UVC_MEDIA_TRANSPORT_INPUT \ 2162306a36Sopenharmony_ci {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 2262306a36Sopenharmony_ci 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03} 2362306a36Sopenharmony_ci#define UVC_GUID_UVC_PROCESSING \ 2462306a36Sopenharmony_ci {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 2562306a36Sopenharmony_ci 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01} 2662306a36Sopenharmony_ci#define UVC_GUID_UVC_SELECTOR \ 2762306a36Sopenharmony_ci {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 2862306a36Sopenharmony_ci 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02} 2962306a36Sopenharmony_ci#define UVC_GUID_EXT_GPIO_CONTROLLER \ 3062306a36Sopenharmony_ci {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ 3162306a36Sopenharmony_ci 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03} 3262306a36Sopenharmony_ci 3362306a36Sopenharmony_ci#define UVC_GUID_FORMAT_MJPEG \ 3462306a36Sopenharmony_ci { 'M', 'J', 'P', 'G', 0x00, 0x00, 0x10, 0x00, \ 3562306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 3662306a36Sopenharmony_ci#define UVC_GUID_FORMAT_YUY2 \ 3762306a36Sopenharmony_ci { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ 3862306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 3962306a36Sopenharmony_ci#define UVC_GUID_FORMAT_YUY2_ISIGHT \ 4062306a36Sopenharmony_ci { 'Y', 'U', 'Y', '2', 0x00, 0x00, 0x10, 0x00, \ 4162306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9b, 0x71} 4262306a36Sopenharmony_ci#define UVC_GUID_FORMAT_NV12 \ 4362306a36Sopenharmony_ci { 'N', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ 4462306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 4562306a36Sopenharmony_ci#define UVC_GUID_FORMAT_YV12 \ 4662306a36Sopenharmony_ci { 'Y', 'V', '1', '2', 0x00, 0x00, 0x10, 0x00, \ 4762306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 4862306a36Sopenharmony_ci#define UVC_GUID_FORMAT_I420 \ 4962306a36Sopenharmony_ci { 'I', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \ 5062306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 5162306a36Sopenharmony_ci#define UVC_GUID_FORMAT_UYVY \ 5262306a36Sopenharmony_ci { 'U', 'Y', 'V', 'Y', 0x00, 0x00, 0x10, 0x00, \ 5362306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 5462306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y800 \ 5562306a36Sopenharmony_ci { 'Y', '8', '0', '0', 0x00, 0x00, 0x10, 0x00, \ 5662306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 5762306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y8 \ 5862306a36Sopenharmony_ci { 'Y', '8', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ 5962306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 6062306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y10 \ 6162306a36Sopenharmony_ci { 'Y', '1', '0', ' ', 0x00, 0x00, 0x10, 0x00, \ 6262306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 6362306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y12 \ 6462306a36Sopenharmony_ci { 'Y', '1', '2', ' ', 0x00, 0x00, 0x10, 0x00, \ 6562306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 6662306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y16 \ 6762306a36Sopenharmony_ci { 'Y', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \ 6862306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 6962306a36Sopenharmony_ci#define UVC_GUID_FORMAT_BY8 \ 7062306a36Sopenharmony_ci { 'B', 'Y', '8', ' ', 0x00, 0x00, 0x10, 0x00, \ 7162306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 7262306a36Sopenharmony_ci#define UVC_GUID_FORMAT_BA81 \ 7362306a36Sopenharmony_ci { 'B', 'A', '8', '1', 0x00, 0x00, 0x10, 0x00, \ 7462306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 7562306a36Sopenharmony_ci#define UVC_GUID_FORMAT_GBRG \ 7662306a36Sopenharmony_ci { 'G', 'B', 'R', 'G', 0x00, 0x00, 0x10, 0x00, \ 7762306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 7862306a36Sopenharmony_ci#define UVC_GUID_FORMAT_GRBG \ 7962306a36Sopenharmony_ci { 'G', 'R', 'B', 'G', 0x00, 0x00, 0x10, 0x00, \ 8062306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 8162306a36Sopenharmony_ci#define UVC_GUID_FORMAT_RGGB \ 8262306a36Sopenharmony_ci { 'R', 'G', 'G', 'B', 0x00, 0x00, 0x10, 0x00, \ 8362306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 8462306a36Sopenharmony_ci#define UVC_GUID_FORMAT_BG16 \ 8562306a36Sopenharmony_ci { 'B', 'G', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 8662306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 8762306a36Sopenharmony_ci#define UVC_GUID_FORMAT_GB16 \ 8862306a36Sopenharmony_ci { 'G', 'B', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 8962306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 9062306a36Sopenharmony_ci#define UVC_GUID_FORMAT_RG16 \ 9162306a36Sopenharmony_ci { 'R', 'G', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 9262306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 9362306a36Sopenharmony_ci#define UVC_GUID_FORMAT_GR16 \ 9462306a36Sopenharmony_ci { 'G', 'R', '1', '6', 0x00, 0x00, 0x10, 0x00, \ 9562306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 9662306a36Sopenharmony_ci#define UVC_GUID_FORMAT_RGBP \ 9762306a36Sopenharmony_ci { 'R', 'G', 'B', 'P', 0x00, 0x00, 0x10, 0x00, \ 9862306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 9962306a36Sopenharmony_ci#define UVC_GUID_FORMAT_BGR3 \ 10062306a36Sopenharmony_ci { 0x7d, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \ 10162306a36Sopenharmony_ci 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} 10262306a36Sopenharmony_ci#define UVC_GUID_FORMAT_BGR4 \ 10362306a36Sopenharmony_ci { 0x7e, 0xeb, 0x36, 0xe4, 0x4f, 0x52, 0xce, 0x11, \ 10462306a36Sopenharmony_ci 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70} 10562306a36Sopenharmony_ci#define UVC_GUID_FORMAT_M420 \ 10662306a36Sopenharmony_ci { 'M', '4', '2', '0', 0x00, 0x00, 0x10, 0x00, \ 10762306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 10862306a36Sopenharmony_ci 10962306a36Sopenharmony_ci#define UVC_GUID_FORMAT_H264 \ 11062306a36Sopenharmony_ci { 'H', '2', '6', '4', 0x00, 0x00, 0x10, 0x00, \ 11162306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 11262306a36Sopenharmony_ci#define UVC_GUID_FORMAT_H265 \ 11362306a36Sopenharmony_ci { 'H', '2', '6', '5', 0x00, 0x00, 0x10, 0x00, \ 11462306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 11562306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y8I \ 11662306a36Sopenharmony_ci { 'Y', '8', 'I', ' ', 0x00, 0x00, 0x10, 0x00, \ 11762306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 11862306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Y12I \ 11962306a36Sopenharmony_ci { 'Y', '1', '2', 'I', 0x00, 0x00, 0x10, 0x00, \ 12062306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 12162306a36Sopenharmony_ci#define UVC_GUID_FORMAT_Z16 \ 12262306a36Sopenharmony_ci { 'Z', '1', '6', ' ', 0x00, 0x00, 0x10, 0x00, \ 12362306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 12462306a36Sopenharmony_ci#define UVC_GUID_FORMAT_RW10 \ 12562306a36Sopenharmony_ci { 'R', 'W', '1', '0', 0x00, 0x00, 0x10, 0x00, \ 12662306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 12762306a36Sopenharmony_ci#define UVC_GUID_FORMAT_INVZ \ 12862306a36Sopenharmony_ci { 'I', 'N', 'V', 'Z', 0x90, 0x2d, 0x58, 0x4a, \ 12962306a36Sopenharmony_ci 0x92, 0x0b, 0x77, 0x3f, 0x1f, 0x2c, 0x55, 0x6b} 13062306a36Sopenharmony_ci#define UVC_GUID_FORMAT_INZI \ 13162306a36Sopenharmony_ci { 'I', 'N', 'Z', 'I', 0x66, 0x1a, 0x42, 0xa2, \ 13262306a36Sopenharmony_ci 0x90, 0x65, 0xd0, 0x18, 0x14, 0xa8, 0xef, 0x8a} 13362306a36Sopenharmony_ci#define UVC_GUID_FORMAT_INVI \ 13462306a36Sopenharmony_ci { 'I', 'N', 'V', 'I', 0xdb, 0x57, 0x49, 0x5e, \ 13562306a36Sopenharmony_ci 0x8e, 0x3f, 0xf4, 0x79, 0x53, 0x2b, 0x94, 0x6f} 13662306a36Sopenharmony_ci#define UVC_GUID_FORMAT_CNF4 \ 13762306a36Sopenharmony_ci { 'C', ' ', ' ', ' ', 0x00, 0x00, 0x10, 0x00, \ 13862306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 13962306a36Sopenharmony_ci 14062306a36Sopenharmony_ci#define UVC_GUID_FORMAT_D3DFMT_L8 \ 14162306a36Sopenharmony_ci {0x32, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, \ 14262306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 14362306a36Sopenharmony_ci#define UVC_GUID_FORMAT_KSMEDIA_L8_IR \ 14462306a36Sopenharmony_ci {0x32, 0x00, 0x00, 0x00, 0x02, 0x00, 0x10, 0x00, \ 14562306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 14662306a36Sopenharmony_ci 14762306a36Sopenharmony_ci#define UVC_GUID_FORMAT_HEVC \ 14862306a36Sopenharmony_ci { 'H', 'E', 'V', 'C', 0x00, 0x00, 0x10, 0x00, \ 14962306a36Sopenharmony_ci 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} 15062306a36Sopenharmony_ci 15162306a36Sopenharmony_cistruct uvc_format_desc { 15262306a36Sopenharmony_ci u8 guid[16]; 15362306a36Sopenharmony_ci u32 fcc; 15462306a36Sopenharmony_ci}; 15562306a36Sopenharmony_ci 15662306a36Sopenharmony_ciconst struct uvc_format_desc *uvc_format_by_guid(const u8 guid[16]); 15762306a36Sopenharmony_ci 15862306a36Sopenharmony_ci#endif /* __LINUX_V4L2_UVC_H */ 159