Skip to content

Commit d59209f

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 <[email protected]>
1 parent a07d1df commit d59209f

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
@@ -732,10 +732,15 @@ static int adv7180_enum_mbus_code(struct v4l2_subdev *sd,
732732
struct v4l2_subdev_state *sd_state,
733733
struct v4l2_subdev_mbus_code_enum *code)
734734
{
735+
struct adv7180_state *state = to_state(sd);
736+
735737
if (code->index != 0)
736738
return -EINVAL;
737739

738-
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
740+
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
741+
code->code = MEDIA_BUS_FMT_UYVY8_1X16;
742+
else
743+
code->code = MEDIA_BUS_FMT_UYVY8_2X8;
739744

740745
return 0;
741746
}
@@ -745,7 +750,10 @@ static int adv7180_mbus_fmt(struct v4l2_subdev *sd,
745750
{
746751
struct adv7180_state *state = to_state(sd);
747752

748-
fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
753+
if (state->chip_info->flags & ADV7180_FLAG_MIPI_CSI2)
754+
fmt->code = MEDIA_BUS_FMT_UYVY8_1X16;
755+
else
756+
fmt->code = MEDIA_BUS_FMT_UYVY8_2X8;
749757
fmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
750758
fmt->width = 720;
751759
fmt->height = state->curr_norm & V4L2_STD_525_60 ? 480 : 576;

0 commit comments

Comments
 (0)