All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Tarang Raval <tarang.raval@siliconsignals.io>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] media: mt9p031: Refactor format handling for different sensor models
Date: Sat, 26 Oct 2024 20:36:10 +0300	[thread overview]
Message-ID: <20241026173610.GF6519@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20241025221638.127457-1-tarang.raval@siliconsignals.io>

Hi Tarang,

Thank you for the patch.

On Sat, Oct 26, 2024 at 03:45:40AM +0530, Tarang Raval wrote:
> Add new structure 'mt9p031_model_info' to encapsulate format codes for
> the mt9p031 camera sensor family. This approach enhances code clarity
> and maintainability.
> 
> Signed-off-by: Tarang Raval <tarang.raval@siliconsignals.io>

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

Sakari, this applies on top of "[PATCH 0/2] media: mt9p031: Drop legacy
platform data" (https://lore.kernel.org/r/20241025181708.20648-1-laurent.pinchart@ideasonboard.com).
Tarang, feel free to review that series to accelerate integration of the
patches upstream :-)

> ---
>  drivers/media/i2c/mt9p031.c | 31 ++++++++++++++++++++++++++++---
>  1 file changed, 28 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/i2c/mt9p031.c b/drivers/media/i2c/mt9p031.c
> index f2f52f484044..3576d3066738 100644
> --- a/drivers/media/i2c/mt9p031.c
> +++ b/drivers/media/i2c/mt9p031.c
> @@ -112,6 +112,24 @@
>  #define MT9P031_TEST_PATTERN_RED			0xa2
>  #define MT9P031_TEST_PATTERN_BLUE			0xa3
>  
> +struct mt9p031_model_info {
> +	u32 code;
> +};
> +
> +enum mt9p031_model {
> +	MT9P031_MODEL_BAYER,
> +	MT9P031_MODEL_MONO,
> +};
> +
> +static const struct mt9p031_model_info mt9p031_models[] = {
> +	[MT9P031_MODEL_BAYER] = {
> +		.code = MEDIA_BUS_FMT_SGRBG12_1X12,
> +	},
> +	[MT9P031_MODEL_MONO] = {
> +		.code = MEDIA_BUS_FMT_Y12_1X12,
> +	},
> +};
> +
>  struct mt9p031 {
>  	struct v4l2_subdev subdev;
>  	struct media_pad pad;
> @@ -1209,9 +1227,16 @@ static void mt9p031_remove(struct i2c_client *client)
>  }
>  
>  static const struct of_device_id mt9p031_of_match[] = {
> -	{ .compatible = "aptina,mt9p006", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
> -	{ .compatible = "aptina,mt9p031", .data = (void *)MEDIA_BUS_FMT_SGRBG12_1X12 },
> -	{ .compatible = "aptina,mt9p031m", .data = (void *)MEDIA_BUS_FMT_Y12_1X12 },
> +	{
> +		.compatible = "aptina,mt9p006",
> +		.data = &mt9p031_models[MT9P031_MODEL_BAYER]
> +	}, {
> +		.compatible = "aptina,mt9p031",
> +		.data = &mt9p031_models[MT9P031_MODEL_BAYER]
> +	}, {
> +		.compatible = "aptina,mt9p031m",
> +		.data = &mt9p031_models[MT9P031_MODEL_MONO]
> +	},
>  	{ /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, mt9p031_of_match);

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2024-10-26 17:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25 22:15 [PATCH v2] media: mt9p031: Refactor format handling for different sensor models Tarang Raval
2024-10-26 17:36 ` Laurent Pinchart [this message]
2024-10-28  9:44 ` Sakari Ailus
2024-10-28 12:02   ` Tarang Raval
2024-10-28 13:29   ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241026173610.GF6519@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tarang.raval@siliconsignals.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.