Skip to content

Commit 4f9944c

Browse files
6by9popcornmix
authored andcommitted
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>
1 parent f604d81 commit 4f9944c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

drivers/media/i2c/adv7180.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -723,10 +723,15 @@ static int adv7180_enum_mbus_code(struct v4l2_subdev *sd,
723723
struct v4l2_subdev_state *sd_state,
724724
struct v4l2_subdev_mbus_code_enum *code)
725725
{
726+
struct adv7180_state *state = to_state(sd);
727+
726728
if (code->index != 0)
727729
return -EINVAL;
728730

729-
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
731+
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
732+
code->code = MEDIA_BUS_FMT_UYVY8_1X16;
733+
else
734+
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
730735

731736
return 0;
732737
}
@@ -736,7 +741,10 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
736741
{
737742
struct adv7180_state *state = to_state(sd);
738743

739-
fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
744+
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
745+
fmt->code = MEDIA_BUS_FMT_UYVY8_1X16;
746+
else
747+
fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
740748
fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
741749
fmt->width = 720;
742750
fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;

0 commit comments

Comments
 (0)