brcm2708: update to latest patches from RPi foundation
[openwrt/staging/dedeckeh.git] / target / linux / brcm2708 / patches-4.19 / 950-0729-media-bcm2835-unicam-Add-support-for-luma-greyscale-.patch
diff --git a/target/linux/brcm2708/patches-4.19/950-0729-media-bcm2835-unicam-Add-support-for-luma-greyscale-.patch b/target/linux/brcm2708/patches-4.19/950-0729-media-bcm2835-unicam-Add-support-for-luma-greyscale-.patch
new file mode 100644 (file)
index 0000000..61a817a
--- /dev/null
@@ -0,0 +1,50 @@
+From 253dd469e6403b6c2afd25d4f8338a0c1588583f Mon Sep 17 00:00:00 2001
+From: Dave Stevenson <dave.stevenson@raspberrypi.org>
+Date: Thu, 3 Oct 2019 13:45:51 +0100
+Subject: [PATCH] media: bcm2835-unicam: Add support for luma/greyscale
+ formats
+
+Add support for V4L2_PIX_FMT_GREY, V4L2_PIX_FMT_Y10P,
+V4L2_PIX_FMT_Y10, and V4L2_PIX_FMT_Y12 image formats from the
+appropriate mediabus formats advertised by sensors.
+
+Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
+---
+ .../media/platform/bcm2835/bcm2835-unicam.c   | 21 ++++++++++++++++++-
+ 1 file changed, 20 insertions(+), 1 deletion(-)
+
+--- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
++++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
+@@ -307,12 +307,31 @@ static const struct unicam_fmt formats[]
+               .code           = MEDIA_BUS_FMT_SRGGB14_1X14,
+               .depth          = 14,
+               .csi_dt         = 0x2d,
+-      },
++      }, {
+       /*
+        * 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.
+        */
++
++      /* Greyscale formats */
++              .fourcc         = V4L2_PIX_FMT_GREY,
++              .code           = MEDIA_BUS_FMT_Y8_1X8,
++              .depth          = 8,
++              .csi_dt         = 0x2a,
++      }, {
++              .fourcc         = V4L2_PIX_FMT_Y10P,
++              .repacked_fourcc = V4L2_PIX_FMT_Y10,
++              .code           = MEDIA_BUS_FMT_Y10_1X10,
++              .depth          = 10,
++              .csi_dt         = 0x2b,
++      }, {
++              /* NB There is no packed V4L2 fourcc for this format. */
++              .repacked_fourcc = V4L2_PIX_FMT_Y12,
++              .code           = MEDIA_BUS_FMT_Y12_1X12,
++              .depth          = 12,
++              .csi_dt         = 0x2c,
++      },
+ };
+ struct unicam_dmaqueue {