media: i2c: adv7180: Use MEDIA_BUS_FMT_UYVY8_1X16 for CSI2 output

CSI2 devices are meant to use the 1Xnn formats rather than 2Xnn
such as MEDIA_BUS_FMT_UYVY8_2X8.

For devices with ADV7180_FLAG_MIPI_CSI2 set, use
MEDIA_BUS_FMT_UYVY8_1X16.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
This commit is contained in:
Dave Stevenson
2023-12-21 18:01:59 +00:00
committed by Dom Cobley
parent 8478ba083c
commit aa54975752

View File

@@ -707,10 +707,15 @@ static int adv7180_enum_mbus_code(struct v4l2_subdev *sd,
struct v4l2_subdev_state *sd_state,
struct v4l2_subdev_mbus_code_enum *code)
{
struct adv7180_state *state = to_state(sd);
if (code->index != 0)
return -EINVAL;
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
code->code = MEDIA_BUS_FMT_UYVY8_1X16;
else
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
return 0;
}
@@ -720,7 +725,10 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
{
struct adv7180_state *state = to_state(sd);
fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
fmt->code = MEDIA_BUS_FMT_UYVY8_1X16;
else
fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
fmt->width = 720;
fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;