msm8916-openwrt/target/linux/bcm27xx/patches-6.6/950-0815-media-rp1-cfe-Use-the-MIPI_CSI2_DT_xxx-defines-for-c.patch
Álvaro Fernández Rojas 8c405cdccc bcm27xx: add 6.6 kernel patches
The patches were generated from the RPi repo with the following command:
git format-patch v6.6.34..rpi-6.1.y

Some patches needed rebasing and, as usual, the applied and reverted, wireless
drivers, Github workflows, READMEs and defconfigs patches were removed.

Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
2024-06-18 18:52:49 +02:00

267 lines
7.0 KiB
Diff

From 019c78a29bba078fdfe4c3feed570af46c18d79b Mon Sep 17 00:00:00 2001
From: Dave Stevenson <dave.stevenson@raspberrypi.com>
Date: Fri, 22 Dec 2023 11:50:38 +0000
Subject: [PATCH 0815/1085] media: rp1: cfe: Use the MIPI_CSI2_DT_xxx defines
for csi_dt
Seeing as we now have the CSI2 data types defined, make use of
them instead of hardcoding the values.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
---
.../platform/raspberrypi/rp1_cfe/cfe_fmts.h | 63 ++++++++++---------
1 file changed, 32 insertions(+), 31 deletions(-)
--- a/drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
+++ b/drivers/media/platform/raspberrypi/rp1_cfe/cfe_fmts.h
@@ -9,6 +9,7 @@
#define _CFE_FMTS_H_
#include "cfe.h"
+#include <media/mipi-csi2.h>
static const struct cfe_fmt formats[] = {
/* YUV Formats */
@@ -16,61 +17,61 @@ static const struct cfe_fmt formats[] =
.fourcc = V4L2_PIX_FMT_YUYV,
.code = MEDIA_BUS_FMT_YUYV8_1X16,
.depth = 16,
- .csi_dt = 0x1e,
+ .csi_dt = MIPI_CSI2_DT_YUV422_8B,
},
{
.fourcc = V4L2_PIX_FMT_UYVY,
.code = MEDIA_BUS_FMT_UYVY8_1X16,
.depth = 16,
- .csi_dt = 0x1e,
+ .csi_dt = MIPI_CSI2_DT_YUV422_8B,
},
{
.fourcc = V4L2_PIX_FMT_YVYU,
.code = MEDIA_BUS_FMT_YVYU8_1X16,
.depth = 16,
- .csi_dt = 0x1e,
+ .csi_dt = MIPI_CSI2_DT_YUV422_8B,
},
{
.fourcc = V4L2_PIX_FMT_VYUY,
.code = MEDIA_BUS_FMT_VYUY8_1X16,
.depth = 16,
- .csi_dt = 0x1e,
+ .csi_dt = MIPI_CSI2_DT_YUV422_8B,
},
{
/* RGB Formats */
.fourcc = V4L2_PIX_FMT_RGB565, /* gggbbbbb rrrrrggg */
.code = MEDIA_BUS_FMT_RGB565_2X8_LE,
.depth = 16,
- .csi_dt = 0x22,
+ .csi_dt = MIPI_CSI2_DT_RGB565,
},
{ .fourcc = V4L2_PIX_FMT_RGB565X, /* rrrrrggg gggbbbbb */
.code = MEDIA_BUS_FMT_RGB565_2X8_BE,
.depth = 16,
- .csi_dt = 0x22
+ .csi_dt = MIPI_CSI2_DT_RGB565,
},
{
.fourcc = V4L2_PIX_FMT_RGB555, /* gggbbbbb arrrrrgg */
.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_LE,
.depth = 16,
- .csi_dt = 0x21,
+ .csi_dt = MIPI_CSI2_DT_RGB555,
},
{
.fourcc = V4L2_PIX_FMT_RGB555X, /* arrrrrgg gggbbbbb */
.code = MEDIA_BUS_FMT_RGB555_2X8_PADHI_BE,
.depth = 16,
- .csi_dt = 0x21,
+ .csi_dt = MIPI_CSI2_DT_RGB555,
},
{
.fourcc = V4L2_PIX_FMT_RGB24, /* rgb */
.code = MEDIA_BUS_FMT_RGB888_1X24,
.depth = 24,
- .csi_dt = 0x24,
+ .csi_dt = MIPI_CSI2_DT_RGB888,
},
{
.fourcc = V4L2_PIX_FMT_BGR24, /* bgr */
.code = MEDIA_BUS_FMT_BGR888_1X24,
.depth = 24,
- .csi_dt = 0x24,
+ .csi_dt = MIPI_CSI2_DT_RGB888,
},
{
.fourcc = V4L2_PIX_FMT_RGB32, /* argb */
@@ -84,112 +85,112 @@ static const struct cfe_fmt formats[] =
.fourcc = V4L2_PIX_FMT_SBGGR8,
.code = MEDIA_BUS_FMT_SBGGR8_1X8,
.depth = 8,
- .csi_dt = 0x2a,
+ .csi_dt = MIPI_CSI2_DT_RAW8,
.remap = { V4L2_PIX_FMT_SBGGR16, V4L2_PIX_FMT_PISP_COMP1_BGGR },
},
{
.fourcc = V4L2_PIX_FMT_SGBRG8,
.code = MEDIA_BUS_FMT_SGBRG8_1X8,
.depth = 8,
- .csi_dt = 0x2a,
+ .csi_dt = MIPI_CSI2_DT_RAW8,
.remap = { V4L2_PIX_FMT_SGBRG16, V4L2_PIX_FMT_PISP_COMP1_GBRG },
},
{
.fourcc = V4L2_PIX_FMT_SGRBG8,
.code = MEDIA_BUS_FMT_SGRBG8_1X8,
.depth = 8,
- .csi_dt = 0x2a,
+ .csi_dt = MIPI_CSI2_DT_RAW8,
.remap = { V4L2_PIX_FMT_SGRBG16, V4L2_PIX_FMT_PISP_COMP1_GRBG },
},
{
.fourcc = V4L2_PIX_FMT_SRGGB8,
.code = MEDIA_BUS_FMT_SRGGB8_1X8,
.depth = 8,
- .csi_dt = 0x2a,
+ .csi_dt = MIPI_CSI2_DT_RAW8,
.remap = { V4L2_PIX_FMT_SRGGB16, V4L2_PIX_FMT_PISP_COMP1_RGGB },
},
{
.fourcc = V4L2_PIX_FMT_SBGGR10P,
.code = MEDIA_BUS_FMT_SBGGR10_1X10,
.depth = 10,
- .csi_dt = 0x2b,
+ .csi_dt = MIPI_CSI2_DT_RAW10,
.remap = { V4L2_PIX_FMT_SBGGR16, V4L2_PIX_FMT_PISP_COMP1_BGGR },
},
{
.fourcc = V4L2_PIX_FMT_SGBRG10P,
.code = MEDIA_BUS_FMT_SGBRG10_1X10,
.depth = 10,
- .csi_dt = 0x2b,
+ .csi_dt = MIPI_CSI2_DT_RAW10,
.remap = { V4L2_PIX_FMT_SGBRG16, V4L2_PIX_FMT_PISP_COMP1_GBRG },
},
{
.fourcc = V4L2_PIX_FMT_SGRBG10P,
.code = MEDIA_BUS_FMT_SGRBG10_1X10,
.depth = 10,
- .csi_dt = 0x2b,
+ .csi_dt = MIPI_CSI2_DT_RAW10,
.remap = { V4L2_PIX_FMT_SGRBG16, V4L2_PIX_FMT_PISP_COMP1_GRBG },
},
{
.fourcc = V4L2_PIX_FMT_SRGGB10P,
.code = MEDIA_BUS_FMT_SRGGB10_1X10,
.depth = 10,
- .csi_dt = 0x2b,
+ .csi_dt = MIPI_CSI2_DT_RAW10,
.remap = { V4L2_PIX_FMT_SRGGB16, V4L2_PIX_FMT_PISP_COMP1_RGGB },
},
{
.fourcc = V4L2_PIX_FMT_SBGGR12P,
.code = MEDIA_BUS_FMT_SBGGR12_1X12,
.depth = 12,
- .csi_dt = 0x2c,
+ .csi_dt = MIPI_CSI2_DT_RAW12,
.remap = { V4L2_PIX_FMT_SBGGR16, V4L2_PIX_FMT_PISP_COMP1_BGGR },
},
{
.fourcc = V4L2_PIX_FMT_SGBRG12P,
.code = MEDIA_BUS_FMT_SGBRG12_1X12,
.depth = 12,
- .csi_dt = 0x2c,
+ .csi_dt = MIPI_CSI2_DT_RAW12,
.remap = { V4L2_PIX_FMT_SGBRG16, V4L2_PIX_FMT_PISP_COMP1_GBRG },
},
{
.fourcc = V4L2_PIX_FMT_SGRBG12P,
.code = MEDIA_BUS_FMT_SGRBG12_1X12,
.depth = 12,
- .csi_dt = 0x2c,
+ .csi_dt = MIPI_CSI2_DT_RAW12,
.remap = { V4L2_PIX_FMT_SGRBG16, V4L2_PIX_FMT_PISP_COMP1_GRBG },
},
{
.fourcc = V4L2_PIX_FMT_SRGGB12P,
.code = MEDIA_BUS_FMT_SRGGB12_1X12,
.depth = 12,
- .csi_dt = 0x2c,
+ .csi_dt = MIPI_CSI2_DT_RAW12,
.remap = { V4L2_PIX_FMT_SRGGB16, V4L2_PIX_FMT_PISP_COMP1_RGGB },
},
{
.fourcc = V4L2_PIX_FMT_SBGGR14P,
.code = MEDIA_BUS_FMT_SBGGR14_1X14,
.depth = 14,
- .csi_dt = 0x2d,
+ .csi_dt = MIPI_CSI2_DT_RAW14,
.remap = { V4L2_PIX_FMT_SBGGR16, V4L2_PIX_FMT_PISP_COMP1_BGGR },
},
{
.fourcc = V4L2_PIX_FMT_SGBRG14P,
.code = MEDIA_BUS_FMT_SGBRG14_1X14,
.depth = 14,
- .csi_dt = 0x2d,
+ .csi_dt = MIPI_CSI2_DT_RAW14,
.remap = { V4L2_PIX_FMT_SGBRG16, V4L2_PIX_FMT_PISP_COMP1_GBRG },
},
{
.fourcc = V4L2_PIX_FMT_SGRBG14P,
.code = MEDIA_BUS_FMT_SGRBG14_1X14,
.depth = 14,
- .csi_dt = 0x2d,
+ .csi_dt = MIPI_CSI2_DT_RAW14,
.remap = { V4L2_PIX_FMT_SGRBG16, V4L2_PIX_FMT_PISP_COMP1_GRBG },
},
{
.fourcc = V4L2_PIX_FMT_SRGGB14P,
.code = MEDIA_BUS_FMT_SRGGB14_1X14,
.depth = 14,
- .csi_dt = 0x2d,
+ .csi_dt = MIPI_CSI2_DT_RAW14,
.remap = { V4L2_PIX_FMT_SRGGB16, V4L2_PIX_FMT_PISP_COMP1_RGGB },
},
{
@@ -250,27 +251,27 @@ static const struct cfe_fmt formats[] =
.fourcc = V4L2_PIX_FMT_GREY,
.code = MEDIA_BUS_FMT_Y8_1X8,
.depth = 8,
- .csi_dt = 0x2a,
+ .csi_dt = MIPI_CSI2_DT_RAW8,
},
{
.fourcc = V4L2_PIX_FMT_Y10P,
.code = MEDIA_BUS_FMT_Y10_1X10,
.depth = 10,
- .csi_dt = 0x2b,
+ .csi_dt = MIPI_CSI2_DT_RAW10,
.remap = { V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_PISP_COMP1_MONO },
},
{
.fourcc = V4L2_PIX_FMT_Y12P,
.code = MEDIA_BUS_FMT_Y12_1X12,
.depth = 12,
- .csi_dt = 0x2c,
+ .csi_dt = MIPI_CSI2_DT_RAW12,
.remap = { V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_PISP_COMP1_MONO },
},
{
.fourcc = V4L2_PIX_FMT_Y14P,
.code = MEDIA_BUS_FMT_Y14_1X14,
.depth = 14,
- .csi_dt = 0x2d,
+ .csi_dt = MIPI_CSI2_DT_RAW14,
.remap = { V4L2_PIX_FMT_Y16, V4L2_PIX_FMT_PISP_COMP1_MONO },
},
{
@@ -290,7 +291,7 @@ static const struct cfe_fmt formats[] =
.fourcc = V4L2_META_FMT_SENSOR_DATA,
.code = MEDIA_BUS_FMT_SENSOR_DATA,
.depth = 8,
- .csi_dt = 0x12,
+ .csi_dt = MIPI_CSI2_DT_EMBEDDED_8B,
.flags = CFE_FORMAT_FLAG_META_CAP,
},