media: bcm2835-unicam: Add support for RAW16 formats
authorDave Stevenson <dave.stevenson@raspberrypi.com>
Fri, 20 Jan 2023 11:56:54 +0000 (11:56 +0000)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:27 +0000 (11:33 +0000)
With the RAW16 formats now having a defined CSI2 data type ID,
they can be added to the driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
drivers/media/platform/bcm2835/bcm2835-unicam.c

index a374845..73d2f0c 100644 (file)
@@ -405,11 +405,30 @@ static const struct unicam_fmt formats[] = {
                .csi_dt         = MIPI_CSI2_DT_RAW14,
                .valid_colorspaces = MASK_CS_RAW,
        }, {
-       /*
-        * 16 bit Bayer formats could be supported, but there is no CSI2
-        * data_type defined for raw 16, and no sensors that produce it at
-        * present.
-        */
+               .fourcc         = V4L2_PIX_FMT_SBGGR16,
+               .code           = MEDIA_BUS_FMT_SBGGR16_1X16,
+               .depth          = 16,
+               .csi_dt         = MIPI_CSI2_DT_RAW16,
+               .valid_colorspaces = MASK_CS_RAW,
+       }, {
+               .fourcc         = V4L2_PIX_FMT_SGBRG16,
+               .code           = MEDIA_BUS_FMT_SGBRG16_1X16,
+               .depth          = 16,
+               .csi_dt         = MIPI_CSI2_DT_RAW16,
+               .valid_colorspaces = MASK_CS_RAW,
+       }, {
+               .fourcc         = V4L2_PIX_FMT_SGRBG16,
+               .code           = MEDIA_BUS_FMT_SGRBG16_1X16,
+               .depth          = 16,
+               .csi_dt         = MIPI_CSI2_DT_RAW16,
+               .valid_colorspaces = MASK_CS_RAW,
+       }, {
+               .fourcc         = V4L2_PIX_FMT_SRGGB16,
+               .code           = MEDIA_BUS_FMT_SRGGB16_1X16,
+               .depth          = 16,
+               .csi_dt         = MIPI_CSI2_DT_RAW16,
+               .valid_colorspaces = MASK_CS_RAW,
+       }, {
 
        /* Greyscale formats */
                .fourcc         = V4L2_PIX_FMT_GREY,
@@ -438,6 +457,12 @@ static const struct unicam_fmt formats[] = {
                .depth          = 14,
                .csi_dt         = MIPI_CSI2_DT_RAW14,
                .valid_colorspaces = MASK_CS_RAW,
+       }, {
+               .fourcc         = V4L2_PIX_FMT_Y16,
+               .code           = MEDIA_BUS_FMT_Y16_1X16,
+               .depth          = 16,
+               .csi_dt         = MIPI_CSI2_DT_RAW16,
+               .valid_colorspaces = MASK_CS_RAW,
        },
        /* Embedded data format */
        {