Re: [PATCH v2 4/6] media: i2c: imx219: pass format's code to imx219_get_format_bpp()

From: Jai Luthra
Date: Fri Feb 21 2025 - 02:03:31 EST


Hi Cosmin,

Thanks for the patch.

On Feb 21, 2025 at 01:08:12 +0200, Cosmin Tanislav wrote:
> imx219_get_format_bpp() only uses the code of the format, pass it
> instead of the whole format to allow usage when the whole format is not
> available.
>
> Signed-off-by: Cosmin Tanislav <demonsingur@xxxxxxxxx>

Reviewed-by: Jai Luthra <jai.luthra@xxxxxxxxxxxxxxxx>

> ---
> drivers/media/i2c/imx219.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/i2c/imx219.c b/drivers/media/i2c/imx219.c
> index fcd98ee54768e..ad1965a91ae3c 100644
> --- a/drivers/media/i2c/imx219.c
> +++ b/drivers/media/i2c/imx219.c
> @@ -387,9 +387,9 @@ static u32 imx219_get_format_code(struct imx219 *imx219, u32 code)
> return imx219_mbus_formats[i];
> }
>
> -static u32 imx219_get_format_bpp(const struct v4l2_mbus_framefmt *format)
> +static u32 imx219_get_format_bpp(u32 code)
> {
> - switch (format->code) {
> + switch (code) {
> case MEDIA_BUS_FMT_SRGGB8_1X8:
> case MEDIA_BUS_FMT_SGRBG8_1X8:
> case MEDIA_BUS_FMT_SGBRG8_1X8:
> @@ -680,7 +680,7 @@ static int imx219_set_framefmt(struct imx219 *imx219,
>
> format = v4l2_subdev_state_get_format(state, 0);
> crop = v4l2_subdev_state_get_crop(state, 0);
> - bpp = imx219_get_format_bpp(format);
> + bpp = imx219_get_format_bpp(format->code);
>
> cci_write(imx219->regmap, IMX219_REG_X_ADD_STA_A,
> crop->left - IMX219_PIXEL_ARRAY_LEFT, &ret);
> --
> 2.48.1
>

--
Thanks,
Jai

Attachment: signature.asc
Description: PGP signature