diff mbox series

[2/2] uvc: Add Genicam 12-bit bayer packed formats

Message ID 20190628084049.21418-1-info@edgarthier.net (mailing list archive)
State New, archived
Headers show
Series [1/2] v4l: Add Genicam 12-bit bayer packed formats | expand

Commit Message

Edgar Thier June 28, 2019, 8:40 a.m. UTC
These formats are compressed 12-bit raw bayer formats with four different
pixel orders. They are similar to 10-bit bayer formats 'IPU3'.
The naming and pixel structure follow
the Genicam Pixel Format Naming Convention (PFNC).

The added GUIDs are used by USB-3.0 cameras produced by `The Imaging Source`.

Signed-off-by: Edgar Thier <info@edgarthier.net>
---
 drivers/media/usb/uvc/uvc_driver.c | 20 ++++++++++++++++++++
 drivers/media/usb/uvc/uvcvideo.h   | 12 ++++++++++++
 2 files changed, 32 insertions(+)
diff mbox series

Patch

diff --git a/drivers/media/usb/uvc/uvc_driver.c b/drivers/media/usb/uvc/uvc_driver.c
index 10cfe8e51626..e7959fd8946a 100644
--- a/drivers/media/usb/uvc/uvc_driver.c
+++ b/drivers/media/usb/uvc/uvc_driver.c
@@ -179,6 +179,26 @@  static struct uvc_format_desc uvc_fmts[] = {
 		.guid		= UVC_GUID_FORMAT_RW10,
 		.fcc		= V4L2_PIX_FMT_SRGGB10P,
 	},
+	{
+		.name		= "Bayer 12-bit PFNC packed (BayerBG12P)",
+		.guid		= UVC_GUID_FORMAT_TIS_BAYERBG12P,
+		.fcc		= V4L2_PIX_FMT_PFNC_BAYERBG12P,
+	},
+	{
+		.name		= "Bayer 12-bit PFNC packed (BayerGB12P)",
+		.guid		= UVC_GUID_FORMAT_TIS_BAYERGB12P,
+		.fcc		= V4L2_PIX_FMT_PFNC_BAYERGB12P,
+	},
+	{
+		.name		= "Bayer 12-bit PFNC packed (BayerRG12P)",
+		.guid		= UVC_GUID_FORMAT_TIS_BAYERRG12P,
+		.fcc		= V4L2_PIX_FMT_PFNC_BAYERRG12P,
+	},
+	{
+		.name		= "Bayer 12-bit PFNC packed (BayerGR12P)",
+		.guid		= UVC_GUID_FORMAT_TIS_BAYERGR12P,
+		.fcc		= V4L2_PIX_FMT_PFNC_BAYERGR12P,
+	},
 	{
 		.name		= "Bayer 16-bit (SBGGR16)",
 		.guid		= UVC_GUID_FORMAT_BG16,
diff --git a/drivers/media/usb/uvc/uvcvideo.h b/drivers/media/usb/uvc/uvcvideo.h
index c7c1baa90dea..67115c375f8b 100644
--- a/drivers/media/usb/uvc/uvcvideo.h
+++ b/drivers/media/usb/uvc/uvcvideo.h
@@ -108,6 +108,18 @@ 
 #define UVC_GUID_FORMAT_RGGB \
 	{ 'R',  'G',  'G',  'B', 0x00, 0x00, 0x10, 0x00, \
 	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_TIS_BAYERBG12P \
+	{ 'B',  'G',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_TIS_BAYERGB12P \
+	{ 'G',  'B',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_TIS_BAYERRG12P \
+	{ 'R',  'G',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
+#define UVC_GUID_FORMAT_TIS_BAYERGR12P \
+	{ 'G',  'R',  'C',  'p', 0x00, 0x00, 0x10, 0x00, \
+	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}
 #define UVC_GUID_FORMAT_BG16 \
 	{ 'B',  'G',  '1',  '6', 0x00, 0x00, 0x10, 0x00, \
 	 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71}