]> git.ipfire.org Git - thirdparty/openwrt.git/blob
10c014b3bf945eaef54f424d7f29a449750aee4e
[thirdparty/openwrt.git] /
1 From 4f9944c95eb69ef9ebbc8fe6eceaf1de43ab122d Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 Date: Thu, 21 Dec 2023 18:01:59 +0000
4 Subject: [PATCH 0813/1085] media: i2c: adv7180: Use MEDIA_BUS_FMT_UYVY8_1X16
5 for CSI2 output
6
7 CSI2 devices are meant to use the 1Xnn formats rather than 2Xnn
8 such as MEDIA_BUS_FMT_UYVY8_2X8.
9
10 For devices with ADV7180_FLAG_MIPI_CSI2 set, use
11 MEDIA_BUS_FMT_UYVY8_1X16.
12
13 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
14 ---
15 drivers/media/i2c/adv7180.c | 12 ++++++++++--
16 1 file changed, 10 insertions(+), 2 deletions(-)
17
18 --- a/drivers/media/i2c/adv7180.c
19 +++ b/drivers/media/i2c/adv7180.c
20 @@ -723,10 +723,15 @@ static int adv7180_enum_mbus_code(struct
21 struct v4l2_subdev_state *sd_state,
22 struct v4l2_subdev_mbus_code_enum *code)
23 {
24 + struct adv7180_state *state = to_state(sd);
25 +
26 if (code->index != 0)
27 return -EINVAL;
28
29 - code->code = MEDIA_BUS_FMT_UYVY8_2X8;
30 + if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
31 + code->code = MEDIA_BUS_FMT_UYVY8_1X16;
32 + else
33 + code->code = MEDIA_BUS_FMT_UYVY8_2X8;
34
35 return 0;
36 }
37 @@ -736,7 +741,10 @@ static int adv7180_mbus_fmt(struct v4l2_
38 {
39 struct adv7180_state *state = to_state(sd);
40
41 - fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
42 + if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
43 + fmt->code = MEDIA_BUS_FMT_UYVY8_1X16;
44 + else
45 + fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
46 fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
47 fmt->width = 720;
48 fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;