difos/target/linux/bcm27xx/patches-6.12/950-0306-media-bcm2835-unicam-Add-support-for-RAW16-formats.patch
Álvaro Fernández Rojas 8f9e91ad03 bcm27xx: add 6.12 patches from RPi repo
These patches were generated from:
https://github.com/raspberrypi/linux/commits/rpi-6.12.y
With the following command:
git format-patch -N v6.12.27..HEAD
(HEAD -> 8d3206ee456a5ecdf9ddbfd8e5e231e4f0cd716e)

Exceptions:
- (def)configs patches
- github workflows patches
- applied & reverted patches
- readme patches
- wireless patches

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2025-05-21 11:32:18 +02:00

64 lines
2 KiB
Diff

From 4d715f39f5f509e68ead10614c73612d5e712012 Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 20 Jan 2023 11:56:54 +0000
Subject: [PATCH] media: bcm2835-unicam: Add support for RAW16 formats
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>
---
.../media/platform/bcm2835/bcm2835-unicam.c | 35 ++++++++++++++++---
1 file changed, 30 insertions(+), 5 deletions(-)
--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
+++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
@@ -401,11 +401,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,
@@ -427,6 +446,12 @@ static const struct unicam_fmt formats[]
.depth = 12,
.csi_dt = MIPI_CSI2_DT_RAW12,
.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 */
{