61a817ab6bf73cb2ff9f801d0b313c429b8c6bae
[openwrt/staging/dangole.git] /
1 From 253dd469e6403b6c2afd25d4f8338a0c1588583f Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Thu, 3 Oct 2019 13:45:51 +0100
4 Subject: [PATCH] media: bcm2835-unicam: Add support for luma/greyscale
5 formats
6
7 Add support for V4L2_PIX_FMT_GREY, V4L2_PIX_FMT_Y10P,
8 V4L2_PIX_FMT_Y10, and V4L2_PIX_FMT_Y12 image formats from the
9 appropriate mediabus formats advertised by sensors.
10
11 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
12 ---
13 .../media/platform/bcm2835/bcm2835-unicam.c | 21 ++++++++++++++++++-
14 1 file changed, 20 insertions(+), 1 deletion(-)
15
16 --- a/drivers/media/platform/bcm2835/bcm2835-unicam.c
17 +++ b/drivers/media/platform/bcm2835/bcm2835-unicam.c
18 @@ -307,12 +307,31 @@ static const struct unicam_fmt formats[]
19 .code = MEDIA_BUS_FMT_SRGGB14_1X14,
20 .depth = 14,
21 .csi_dt = 0x2d,
22 - },
23 + }, {
24 /*
25 * 16 bit Bayer formats could be supported, but there is no CSI2
26 * data_type defined for raw 16, and no sensors that produce it at
27 * present.
28 */
29 +
30 + /* Greyscale formats */
31 + .fourcc = V4L2_PIX_FMT_GREY,
32 + .code = MEDIA_BUS_FMT_Y8_1X8,
33 + .depth = 8,
34 + .csi_dt = 0x2a,
35 + }, {
36 + .fourcc = V4L2_PIX_FMT_Y10P,
37 + .repacked_fourcc = V4L2_PIX_FMT_Y10,
38 + .code = MEDIA_BUS_FMT_Y10_1X10,
39 + .depth = 10,
40 + .csi_dt = 0x2b,
41 + }, {
42 + /* NB There is no packed V4L2 fourcc for this format. */
43 + .repacked_fourcc = V4L2_PIX_FMT_Y12,
44 + .code = MEDIA_BUS_FMT_Y12_1X12,
45 + .depth = 12,
46 + .csi_dt = 0x2c,
47 + },
48 };
49
50 struct unicam_dmaqueue {