public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Petko Manolov <petko.manolov@konsulko.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Kieran Bingham <kieran.bingham@ideasonboard.com>,
	linux-media@vger.kernel.org, sakari.ailus@iki.fi
Subject: Re: [PATCH v1 2/5] media: i2c: imx492: driver's header
Date: Mon, 28 Nov 2022 15:53:52 +0200	[thread overview]
Message-ID: <Y4S9cHwMlEJ74tTs@bender.k.g> (raw)
In-Reply-To: <Y4S3/UVEPZscrbag@pendragon.ideasonboard.com>

On 22-11-28 15:30:37, Laurent Pinchart wrote:
> On Mon, Nov 28, 2022 at 03:14:26PM +0200, Petko Manolov wrote:
> > On 22-11-28 12:47:25, Kieran Bingham wrote:
> > > Quoting Petko Manolov (2022-11-25 15:31:17)
> > > > The header.  For the moment only two modes are supported.
> > > > 
> > > > Signed-off-by: Petko Manolov <petko.manolov@konsulko.com>
> > > > ---
> > > >  drivers/media/i2c/imx492.h | 555 +++++++++++++++++++++++++++++++++++++
> > > >  1 file changed, 555 insertions(+)
> > > >  create mode 100644 drivers/media/i2c/imx492.h
> > > > 
> > > > diff --git a/drivers/media/i2c/imx492.h b/drivers/media/i2c/imx492.h
> > > > new file mode 100644
> > > > index 000000000000..301fd66c77d5
> > > > --- /dev/null
> > > > +++ b/drivers/media/i2c/imx492.h
> > > > @@ -0,0 +1,555 @@
> > > > +#ifndef        __imx492_h__
> > > > +#define        __imx492_h__
> > > > +
> > > > +struct imx492_reg {
> > > > +       u16 address;
> > > > +       u8 val;
> > > > +};
> > > > +
> > > > +static const struct imx492_reg mode_17to9_regs[] = {
> > > 
> > > Why is this table in the header? Should it be available in multiple locations?
> > 
> > Nope, but there are multiple modes that will eventually be in use and scrolling
> > down a couple of seconds until one gets to the code started to get a bit boring.
> 
> Ideally we should get rid of those tables and use logic to compute register
> values :-) That's a dream only at this point though.

I don't see this happening anytime soon with this particular sensor. :)

> I agree with Kieran that everything could be in the same file, and I also
> agree with you that it's not nice to have a large list of registers at the
> beginning of the driver. I'm thus fine with either option.

I use one register/value pair in a row while the driver is in development,
because it is easy to modify some of them and put a comment at the back.  Once
done with it multiple entries per line will reduce the pain.

At that point most registers that are common for all modes could be put in a
separate array and modify only those that are relevant for a particular
mode/format.  Not quite there yet...

> > > I think it is likely better in the driver itself.
> > 
> > Will put register definitions in the .c file for the time being.
> 
> -- 
> Regards,
> 
> Laurent Pinchart


		Petko

  reply	other threads:[~2022-11-28 13:54 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-25 15:31 [PATCH v1 0/5] Adds media driver for Sony IMX492 sensor Petko Manolov
2022-11-25 15:31 ` [PATCH v1 1/5] DT bindings for imx492 Petko Manolov
2022-11-28  4:37   ` Laurent Pinchart
2022-11-28 13:07     ` Petko Manolov
2022-11-28 13:28       ` Laurent Pinchart
2022-11-25 15:31 ` [PATCH v1 2/5] media: i2c: imx492: driver's header Petko Manolov
2022-11-28  4:40   ` Laurent Pinchart
2022-11-28 13:12     ` Petko Manolov
2022-11-28 12:47   ` Kieran Bingham
2022-11-28 13:14     ` Petko Manolov
2022-11-28 13:30       ` Laurent Pinchart
2022-11-28 13:53         ` Petko Manolov [this message]
2022-11-25 15:31 ` [PATCH v1 3/5] media: i2c: imx492: driver's source Petko Manolov
2022-11-28  5:16   ` Laurent Pinchart
2022-11-28 13:42     ` Petko Manolov
2022-11-28 14:08       ` Laurent Pinchart
2022-11-28 14:18       ` Dave Stevenson
2022-11-28 12:58   ` Kieran Bingham
2022-11-28 13:48     ` Petko Manolov
2022-11-25 15:31 ` [PATCH v1 4/5] media: i2c: add imx492 config entry Petko Manolov
2022-11-25 15:31 ` [PATCH v1 5/5] media: i2c: add imx492 entry for make Petko Manolov
2022-11-25 19:48   ` kernel test robot
2022-11-28 12:45 ` [PATCH v1 0/5] Adds media driver for Sony IMX492 sensor Kieran Bingham
2022-11-28 13:11   ` Petko Manolov
2022-11-28 13:38     ` Kieran Bingham
2022-11-28 13:46       ` Laurent Pinchart
2022-11-28 14:07       ` Petko Manolov
2022-11-28 15:04         ` Kieran Bingham

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=Y4S9cHwMlEJ74tTs@bender.k.g \
    --to=petko.manolov@konsulko.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.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