public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Dave Stevenson <dave.stevenson@raspberrypi.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	linux-media@vger.kernel.org,
	Manivannan Sadhasivam <mani@kernel.org>,
	Sakari Ailus <sakari.ailus@iki.fi>
Subject: Re: Re: Re: [PATCH 16/19] media: i2c: imx290: Move registers with fixed value to init array
Date: Fri, 22 Jul 2022 07:53:48 +0200	[thread overview]
Message-ID: <3555790.PIDvDuAF1L@steina-w> (raw)
In-Reply-To: <CAPY8ntBRQJFwFX1sV7kjUDwK2iHSqbTyUmEie2RFH-BVvyHcyQ@mail.gmail.com>

Hello Dave,

Am Donnerstag, 21. Juli 2022, 18:19:56 CEST schrieb Dave Stevenson:
> Hi Laurent and Alexander
> 
> On Thu, 21 Jul 2022 at 12:08, Alexander Stein
> 
> <alexander.stein@ew.tq-group.com> wrote:
> > Hello Laurent,
> > 
> > Am Donnerstag, 21. Juli 2022, 12:40:36 CEST schrieb Laurent Pinchart:
> > > Hi Alexander,
> > > 
> > > On Thu, Jul 21, 2022 at 12:08:50PM +0200, Alexander Stein wrote:
> > > > Am Donnerstag, 21. Juli 2022, 10:35:37 CEST schrieb Laurent Pinchart:
> > > > > Registers 0x3012, 0x3013 and 0x3480 are not documented and are set
> > > > > in
> > > > > the per-mode register arrays with values indentical for all modes.
> > > > > Move
> > > > > them to the common array.
> > > > > 
> > > > > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > > ---
> > > > > 
> > > > >  drivers/media/i2c/imx290.c | 8 ++------
> > > > >  1 file changed, 2 insertions(+), 6 deletions(-)
> > > > > 
> > > > > diff --git a/drivers/media/i2c/imx290.c b/drivers/media/i2c/imx290.c
> > > > > index 78772c6327a2..fc6e87fada1c 100644
> > > > > --- a/drivers/media/i2c/imx290.c
> > > > > +++ b/drivers/media/i2c/imx290.c
> > > > > @@ -192,6 +192,7 @@ static const struct imx290_regval
> > > > > imx290_global_init_settings[] = { { IMX290_REG_8BIT(0x300f), 0x00 },
> > > > > 
> > > > >   { IMX290_REG_8BIT(0x3010), 0x21 },
> > > > >   { IMX290_REG_8BIT(0x3012), 0x64 },
> > > > > 
> > > > > + { IMX290_REG_8BIT(0x3013), 0x00 },
> > > > > 
> > > > >   { IMX290_REG_8BIT(0x3016), 0x09 },
> > > > >   { IMX290_REG_8BIT(0x3070), 0x02 },
> > > > >   { IMX290_REG_8BIT(0x3071), 0x11 },
> > > > > 
> > > > > @@ -230,6 +231,7 @@ static const struct imx290_regval
> > > > > imx290_global_init_settings[] = { { IMX290_REG_8BIT(0x33b0), 0x50 },
> > > > > 
> > > > >   { IMX290_REG_8BIT(0x33b2), 0x1a },
> > > > >   { IMX290_REG_8BIT(0x33b3), 0x04 },
> > > > > 
> > > > > + { IMX290_REG_8BIT(0x3480), 0x49 },
> > > > > 
> > > > >  };
> > > > >  
> > > > >  static const struct imx290_regval imx290_1080p_settings[] = {
> > > > > 
> > > > > @@ -239,15 +241,12 @@ static const struct imx290_regval
> > > > > imx290_1080p_settings[] = { { IMX290_OPB_SIZE_V, 10 },
> > > > > 
> > > > >   { IMX290_X_OUT_SIZE, 1920 },
> > > > >   { IMX290_Y_OUT_SIZE, 1080 },
> > > > > 
> > > > > - { IMX290_REG_8BIT(0x3012), 0x64 },
> > > > > - { IMX290_REG_8BIT(0x3013), 0x00 },
> > > > > 
> > > > >   { IMX290_INCKSEL1, 0x18 },
> > > > >   { IMX290_INCKSEL2, 0x03 },
> > > > >   { IMX290_INCKSEL3, 0x20 },
> > > > >   { IMX290_INCKSEL4, 0x01 },
> > > > >   { IMX290_INCKSEL5, 0x1a },
> > > > >   { IMX290_INCKSEL6, 0x1a },
> > > > > 
> > > > > - { IMX290_REG_8BIT(0x3480), 0x49 },
> > > > > 
> > > > >   /* data rate settings */
> > > > >   { IMX290_REPETITION, 0x10 },
> > > > >   { IMX290_TCLKPOST, 87 },
> > > > > 
> > > > > @@ -267,15 +266,12 @@ static const struct imx290_regval
> > > > > imx290_720p_settings[] = { { IMX290_OPB_SIZE_V, 4 },
> > > > > 
> > > > >   { IMX290_X_OUT_SIZE, 1280 },
> > > > >   { IMX290_Y_OUT_SIZE, 720 },
> > > > > 
> > > > > - { IMX290_REG_8BIT(0x3012), 0x64 },
> > > > > - { IMX290_REG_8BIT(0x3013), 0x00 },
> > > > > 
> > > > >   { IMX290_INCKSEL1, 0x20 },
> > > > >   { IMX290_INCKSEL2, 0x00 },
> > > > >   { IMX290_INCKSEL3, 0x20 },
> > > > >   { IMX290_INCKSEL4, 0x01 },
> > > > >   { IMX290_INCKSEL5, 0x1a },
> > > > >   { IMX290_INCKSEL6, 0x1a },
> > > > > 
> > > > > - { IMX290_REG_8BIT(0x3480), 0x49 },
> > > > > 
> > > > >   /* data rate settings */
> > > > >   { IMX290_REPETITION, 0x10 },
> > > > >   { IMX290_TCLKPOST, 79 },
> > > > 
> > > > 0x3480 is INCKSEL7 for imx327, not sure if that should be set yet for
> > > > imx290 (only) driver, without proper imx327 support.
> > > 
> > > Do you mean the register doesn't exist on the IMX290 ? We could make it
> > > conditional on the sensor model, but it's not added by this patch, it
> > > has been there since the first version of the driver, so I'd rather do
> > > that on top.
> > 
> > As far as I know INCKSEL7 is only valid on imx327. On imx290 the whole
> > 0x300-0x34ff range is reserved.
> 
> IMX290_CSI_LANE_MODE to select the number of CSI2 data lanes is
> 0x3443, so clearly the whole range is not reserved.

You are right, I was looking at the wrong table, my bad.

> > I agree this should be conditional on the sensor model. If you want to
> > keep
> > it, because it is not new, I'm fine with that.
> 
> 0x3840 is documented in my IMX290 datasheet as being INCKSEL7. 0x49
> for 37.125MHz clock. 0x92 for 74.25MHz (default).
> Removing it *will* break this driver for existing platforms as the
> rest of the code configures a 37.125MHz clock.

I guess you mean 0x3480, just a small typo. Just to be sure.
Interesting, the datasheet for imx290 I found doesn't contain INCKSEL7 at all. 
But good to know, that this register applies to imx290 as well.
Thanks for that information.

Best regards,
Alexander

> See [1] for adding 74.25MHz clock support.
> 
>   Dave
> 
> [1]
> https://github.com/raspberrypi/linux/commit/125f7e7ef1194d4849c74b25c87d18a
> ea9de2de7





  reply	other threads:[~2022-07-22  5:53 UTC|newest]

Thread overview: 81+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-21  8:35 [PATCH 00/19] media: i2c: imx290: Miscellaneous improvements Laurent Pinchart
2022-07-21  8:35 ` [PATCH 01/19] media: i2c: imx290: Use device lock for the control handler Laurent Pinchart
2022-07-21  9:22   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 02/19] media: i2c: imx290: Print error code when I2C transfer fails Laurent Pinchart
2022-07-21  9:23   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 03/19] media: i2c: imx290: Specify HMAX values in decimal Laurent Pinchart
2022-07-21  9:18   ` Alexander Stein
2022-07-21 11:31     ` Laurent Pinchart
2022-07-21 11:54       ` Alexander Stein
2022-07-21 12:04         ` Laurent Pinchart
2022-07-21  8:35 ` [PATCH 04/19] media: i2c: imx290: Replace macro with explicit ARRAY_SIZE() Laurent Pinchart
2022-07-21  9:23   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 05/19] media: i2c: imx290: Drop imx290_write_buffered_reg() Laurent Pinchart
2022-07-21  9:24   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 06/19] media: i2c: imx290: Drop regmap cache Laurent Pinchart
2022-07-21  9:27   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 07/19] media: i2c: imx290: Support variable-sized registers Laurent Pinchart
2022-07-21  9:43   ` Alexander Stein
2022-07-21 10:54     ` Laurent Pinchart
2022-07-21 11:18       ` Alexander Stein
2022-07-21 11:25         ` Laurent Pinchart
2022-07-21 11:43           ` Alexander Stein
2022-07-22 14:37             ` Sakari Ailus
2022-07-23 23:06               ` Laurent Pinchart
2022-07-25  6:49                 ` Alexander Stein
2022-08-23  1:08                   ` Laurent Pinchart
2022-08-23  2:51                     ` Laurent Pinchart
2022-08-23  7:19                       ` Alexander Stein
2022-10-16  5:36                         ` Laurent Pinchart
2022-07-21  8:35 ` [PATCH 08/19] media: i2c: imx290: Correct register sizes Laurent Pinchart
2022-07-21  8:35 ` [PATCH 09/19] media: i2c: imx290: Simplify error handling when writing registers Laurent Pinchart
2022-07-21  9:50   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 10/19] media: i2c: imx290: Define more register macros Laurent Pinchart
2022-07-21 10:00   ` Alexander Stein
2022-07-21 11:08     ` Laurent Pinchart
2022-07-21 11:28       ` Alexander Stein
2022-10-16  4:27         ` Laurent Pinchart
2022-07-21  8:35 ` [PATCH 11/19] media: i2c: imx290: Add exposure time control Laurent Pinchart
2022-07-21 10:01   ` Alexander Stein
2022-07-21 15:52   ` Dave Stevenson
2022-07-21  8:35 ` [PATCH 12/19] media: i2c: imx290: Fix max gain value Laurent Pinchart
2022-07-21 10:02   ` Alexander Stein
2022-07-21 16:08   ` Dave Stevenson
2022-10-16  4:51     ` Laurent Pinchart
2022-07-21  8:35 ` [PATCH 13/19] media: i2c: imx290: Split control initialization to separate function Laurent Pinchart
2022-07-21 10:03   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 14/19] media: i2c: imx290: Implement HBLANK and VBLANK controls Laurent Pinchart
2022-07-21 10:05   ` Alexander Stein
2022-07-21 11:17     ` Laurent Pinchart
2022-07-21 11:32       ` Alexander Stein
2022-07-21 16:37         ` Dave Stevenson
2022-10-16  6:10           ` Laurent Pinchart
2022-10-17 13:46             ` Dave Stevenson
2022-07-21  8:35 ` [PATCH 15/19] media: i2c: imx290: Create controls for fwnode properties Laurent Pinchart
2022-07-21 10:06   ` Alexander Stein
2022-07-21  8:35 ` [PATCH 16/19] media: i2c: imx290: Move registers with fixed value to init array Laurent Pinchart
2022-07-21 10:08   ` Alexander Stein
2022-07-21 10:40     ` Laurent Pinchart
2022-07-21 11:08       ` Alexander Stein
2022-07-21 16:19         ` Dave Stevenson
2022-07-22  5:53           ` Alexander Stein [this message]
2022-07-22  9:10             ` Dave Stevenson
2022-07-21  8:35 ` [PATCH 17/19] media: i2c: imx290: Factor out format retrieval to separate function Laurent Pinchart
2022-07-21 10:11   ` Alexander Stein
2022-07-21 10:36     ` Laurent Pinchart
2022-07-21 11:12       ` Alexander Stein
2022-07-21  8:35 ` [PATCH 18/19] media: i2c: imx290: Add crop selection targets support Laurent Pinchart
2022-07-21 15:39   ` Dave Stevenson
2022-10-16  5:53     ` Laurent Pinchart
2022-07-21  8:35 ` [PATCH 19/19] media: i2c: imx290: Replace GAIN control with ANALOGUE_GAIN Laurent Pinchart
2022-07-21 10:11   ` Alexander Stein
2022-08-23  1:11 ` [PATCH 00/19] media: i2c: imx290: Miscellaneous improvements Laurent Pinchart
2022-10-10 10:31   ` Dave Stevenson
2022-10-16  5:37     ` Laurent Pinchart
2022-10-16  7:34       ` Dave Stevenson
2022-10-17 18:07         ` Dave Stevenson
2022-10-18 13:43           ` Dave Stevenson
2022-10-19 10:33           ` Sakari Ailus
2022-10-19 11:38             ` Dave Stevenson
2022-10-19 13:27               ` Sakari Ailus
2023-01-14 16:03                 ` 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=3555790.PIDvDuAF1L@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=sakari.ailus@iki.fi \
    /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