diff mbox series

media: i2c: ov5645: Fix media bus format

Message ID 20220328163220.250203-1-jacopo@jmondi.org (mailing list archive)
State New, archived
Headers show
Series media: i2c: ov5645: Fix media bus format | expand

Commit Message

Jacopo Mondi March 28, 2022, 4:32 p.m. UTC
The ov5645 driver reports as its unique supported format
MEDIA_BUS_FMT_UYVY8_2X8, which is not correct as the sensor
uses the MIPI CSI-2 serial bus.

Fix that by using MEDIA_BUS_FMT_UYVY8_1X16 instead.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
 drivers/media/i2c/ov5645.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
2.35.1

Comments

Laurent Pinchart March 28, 2022, 9:37 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Mon, Mar 28, 2022 at 06:32:20PM +0200, Jacopo Mondi wrote:
> The ov5645 driver reports as its unique supported format
> MEDIA_BUS_FMT_UYVY8_2X8, which is not correct as the sensor
> uses the MIPI CSI-2 serial bus.
> 
> Fix that by using MEDIA_BUS_FMT_UYVY8_1X16 instead.
> 
> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/i2c/ov5645.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
> index 368fa21e675e..5720e74e843b 100644
> --- a/drivers/media/i2c/ov5645.c
> +++ b/drivers/media/i2c/ov5645.c
> @@ -843,7 +843,7 @@ static int ov5645_enum_mbus_code(struct v4l2_subdev *sd,
>  	if (code->index > 0)
>  		return -EINVAL;
> 
> -	code->code = MEDIA_BUS_FMT_UYVY8_2X8;
> +	code->code = MEDIA_BUS_FMT_UYVY8_1X16;
> 
>  	return 0;
>  }
> @@ -852,7 +852,7 @@ static int ov5645_enum_frame_size(struct v4l2_subdev *subdev,
>  				  struct v4l2_subdev_state *sd_state,
>  				  struct v4l2_subdev_frame_size_enum *fse)
>  {
> -	if (fse->code != MEDIA_BUS_FMT_UYVY8_2X8)
> +	if (fse->code != MEDIA_BUS_FMT_UYVY8_1X16)
>  		return -EINVAL;
> 
>  	if (fse->index >= ARRAY_SIZE(ov5645_mode_info_data))
> @@ -948,7 +948,7 @@ static int ov5645_set_format(struct v4l2_subdev *sd,
>  					   format->which);
>  	__format->width = __crop->width;
>  	__format->height = __crop->height;
> -	__format->code = MEDIA_BUS_FMT_UYVY8_2X8;
> +	__format->code = MEDIA_BUS_FMT_UYVY8_1X16;
>  	__format->field = V4L2_FIELD_NONE;
>  	__format->colorspace = V4L2_COLORSPACE_SRGB;
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index 368fa21e675e..5720e74e843b 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -843,7 +843,7 @@  static int ov5645_enum_mbus_code(struct v4l2_subdev *sd,
 	if (code->index > 0)
 		return -EINVAL;

-	code->code = MEDIA_BUS_FMT_UYVY8_2X8;
+	code->code = MEDIA_BUS_FMT_UYVY8_1X16;

 	return 0;
 }
@@ -852,7 +852,7 @@  static int ov5645_enum_frame_size(struct v4l2_subdev *subdev,
 				  struct v4l2_subdev_state *sd_state,
 				  struct v4l2_subdev_frame_size_enum *fse)
 {
-	if (fse->code != MEDIA_BUS_FMT_UYVY8_2X8)
+	if (fse->code != MEDIA_BUS_FMT_UYVY8_1X16)
 		return -EINVAL;

 	if (fse->index >= ARRAY_SIZE(ov5645_mode_info_data))
@@ -948,7 +948,7 @@  static int ov5645_set_format(struct v4l2_subdev *sd,
 					   format->which);
 	__format->width = __crop->width;
 	__format->height = __crop->height;
-	__format->code = MEDIA_BUS_FMT_UYVY8_2X8;
+	__format->code = MEDIA_BUS_FMT_UYVY8_1X16;
 	__format->field = V4L2_FIELD_NONE;
 	__format->colorspace = V4L2_COLORSPACE_SRGB;