mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Shravan.Chippa@microchip.com
Cc: mchehab@kernel.org, kieran.bingham@ideasonboard.com,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Conor.Dooley@microchip.com,
	Valentina.FernandezAlanis@microchip.com,
	Praveen.Kumar@microchip.com
Subject: Re: [PATCH V5 1/2] media: i2c: imx334: Optimized 4k and 2k mode register arrays
Date: Thu, 27 Feb 2025 09:21:12 +0000	[thread overview]
Message-ID: <Z8AuiGKcGUeKxf_H@kekkonen.localdomain> (raw)
In-Reply-To: <PH0PR11MB56115C346E4BE3CD3598DB5C81CD2@PH0PR11MB5611.namprd11.prod.outlook.com>

Hi Shravan,

On Thu, Feb 27, 2025 at 05:04:11AM +0000, Shravan.Chippa@microchip.com wrote:
> Hi Sakari,
> 
> > -----Original Message-----
> > From: Sakari Ailus <sakari.ailus@linux.intel.com>
> > Sent: Wednesday, February 26, 2025 7:59 PM
> > To: shravan Chippa - I35088 <Shravan.Chippa@microchip.com>
> > Cc: mchehab@kernel.org; kieran.bingham@ideasonboard.com; linux-
> > media@vger.kernel.org; linux-kernel@vger.kernel.org; Conor Dooley -
> > M52691 <Conor.Dooley@microchip.com>; Valentina Fernandez Alanis -
> > M63239 <Valentina.FernandezAlanis@microchip.com>; Praveen Kumar -
> > I30718 <Praveen.Kumar@microchip.com>
> > Subject: Re: [PATCH V5 1/2] media: i2c: imx334: Optimized 4k and 2k mode
> > register arrays
> > 
> > EXTERNAL EMAIL: Do not click links or open attachments unless you know the
> > content is safe
> > 
> > Hi Shravan,
> > 
> > On Tue, Feb 25, 2025 at 11:56:34AM +0530, shravan kumar wrote:
> > > From: Shravan Chippa <shravan.chippa@microchip.com>
> > >
> > > Optimized the resolution arrays by integrating a common register array.
> > >
> > > Adjusted the register array values for 1920x1080@30 and 3840x2160@30
> > > resolutions to align with the common register array values.
> > >
> > > Signed-off-by: Shravan Chippa <shravan.chippa@microchip.com>
> > > ---
> > >  drivers/media/i2c/imx334.c | 148
> > > +++++++++++--------------------------
> > >  1 file changed, 43 insertions(+), 105 deletions(-)
> > >
> > > diff --git a/drivers/media/i2c/imx334.c b/drivers/media/i2c/imx334.c
> > > index a544fc3df39c..b2ad19abaca8 100644
> > > --- a/drivers/media/i2c/imx334.c
> > > +++ b/drivers/media/i2c/imx334.c
> > > @@ -167,8 +167,8 @@ static const s64 link_freq[] = {
> > >       IMX334_LINK_FREQ_445M,
> > >  };
> > >
> > > -/* Sensor mode registers for 1920x1080@30fps */ -static const struct
> > > imx334_reg mode_1920x1080_regs[] = {
> > > +/* Sensor common mode registers values */ static const struct
> > > +imx334_reg common_mode_regs[] = {
> > >       {0x3000, 0x01},
> > >       {0x3018, 0x04},
> > >       {0x3030, 0xca},
> > > @@ -176,26 +176,10 @@ static const struct imx334_reg
> > mode_1920x1080_regs[] = {
> > >       {0x3032, 0x00},
> > >       {0x3034, 0x4c},
> > >       {0x3035, 0x04},
> > > -     {0x302c, 0xf0},
> > > -     {0x302d, 0x03},
> > > -     {0x302e, 0x80},
> > > -     {0x302f, 0x07},
> > > -     {0x3074, 0xcc},
> > > -     {0x3075, 0x02},
> > > -     {0x308e, 0xcd},
> > > -     {0x308f, 0x02},
> > > -     {0x3076, 0x38},
> > > -     {0x3077, 0x04},
> > > -     {0x3090, 0x38},
> > > -     {0x3091, 0x04},
> > > -     {0x3308, 0x38},
> > > -     {0x3309, 0x04},
> > > -     {0x30C6, 0x00},
> > > +     {0x30c6, 0x00},
> > >       {0x30c7, 0x00},
> > >       {0x30ce, 0x00},
> > >       {0x30cf, 0x00},
> > > -     {0x30d8, 0x18},
> > > -     {0x30d9, 0x0a},
> > >       {0x304c, 0x00},
> > >       {0x304e, 0x00},
> > >       {0x304f, 0x00},
> > > @@ -210,7 +194,7 @@ static const struct imx334_reg
> > mode_1920x1080_regs[] = {
> > >       {0x300d, 0x29},
> > >       {0x314c, 0x29},
> > >       {0x314d, 0x01},
> > > -     {0x315a, 0x06},
> > > +     {0x315a, 0x0a},
> > >       {0x3168, 0xa0},
> > >       {0x316a, 0x7e},
> > >       {0x319e, 0x02},
> > > @@ -330,116 +314,63 @@ static const struct imx334_reg
> > mode_1920x1080_regs[] = {
> > >       {0x3002, 0x00},
> > >  };
> > >
> > > +/* Sensor mode registers for 1920x1080@30fps */ static const struct
> > > +imx334_reg mode_1920x1080_regs[] = {
> > > +     {0x302c, 0xf0},
> > > +     {0x302d, 0x03},
> > > +     {0x302e, 0x80},
> > > +     {0x302f, 0x07},
> > > +     {0x3074, 0xcc},
> > > +     {0x3075, 0x02},
> > > +     {0x308e, 0xcd},
> > > +     {0x308f, 0x02},
> > > +     {0x3076, 0x38},
> > > +     {0x3077, 0x04},
> > > +     {0x3090, 0x38},
> > > +     {0x3091, 0x04},
> > > +     {0x3308, 0x38},
> > > +     {0x3309, 0x04},
> > > +     {0x30d8, 0x18},
> > > +     {0x30d9, 0x0a},
> > > +};
> > > +
> > >  /* Sensor mode registers for 3840x2160@30fps */  static const struct
> > > imx334_reg mode_3840x2160_regs[] = {
> > > -     {0x3000, 0x01},
> > > -     {0x3002, 0x00},
> > > -     {0x3018, 0x04},
> > > -     {0x37b0, 0x36},
> > > -     {0x304c, 0x00},
> > > -     {0x300c, 0x3b},
> > > -     {0x300d, 0x2a},
> > > -     {0x3034, 0x26},
> > > -     {0x3035, 0x02},
> > > -     {0x314c, 0x29},
> > > -     {0x314d, 0x01},
> > > -     {0x315a, 0x02},
> > > -     {0x3168, 0xa0},
> > > -     {0x316a, 0x7e},
> > > -     {0x3288, 0x21},
> > > -     {0x328a, 0x02},
> > >       {0x302c, 0x3c},
> > >       {0x302d, 0x00},
> > >       {0x302e, 0x00},
> > >       {0x302f, 0x0f},
> > > +     {0x3074, 0xb0},
> > > +     {0x3075, 0x00},
> > > +     {0x308e, 0xb1},
> > 
> > This register wasn't part of the original register list for the mode. It seems to
> > have been written to in the other (binned?) mode only. It looks like a possible
> > bugfix. Should it be in a separate patch? This patch is only meant to reorganise
> > register settings to a base set and modes, not change the registers written in
> > any way.
> 
> Yes, it is correct that these values are not part of the original
> 3840x2160 register list. However, these registers have been modified in
> the other three mode registers array. The 3840x2160 mode operates with
> the reset value. If we switch to the other three modes and then return to
> the 3840x2160 mode, it should function correctly. Therefore, I am
> restoring the reset values.

Please do wrap at 75 characters when replying.

Such changes belong to separate patches. Please add further patches in such
cases.

-- 
Regards,

Sakari Ailus

  reply	other threads:[~2025-02-27  9:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-25  6:26 [PATCH V5 0/2] media: i2c: imx334: Add support for 1280x720 & 640x480 resolutions shravan kumar
2025-02-25  6:26 ` [PATCH V5 1/2] media: i2c: imx334: Optimized 4k and 2k mode register arrays shravan kumar
2025-02-26 14:28   ` Sakari Ailus
2025-02-27  5:04     ` Shravan.Chippa
2025-02-27  9:21       ` Sakari Ailus [this message]
2025-02-25  6:26 ` [PATCH V5 2/2] media: i2c: imx334: add modes for 720p and 480p resolutions shravan kumar

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=Z8AuiGKcGUeKxf_H@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=Conor.Dooley@microchip.com \
    --cc=Praveen.Kumar@microchip.com \
    --cc=Shravan.Chippa@microchip.com \
    --cc=Valentina.FernandezAlanis@microchip.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®