public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: linux-media@vger.kernel.org, hdegoede@redhat.com
Subject: Re: [PATCH 2/6] media: v4l: cci: Add driver-private bit definitions
Date: Fri, 10 Nov 2023 21:21:12 +0000	[thread overview]
Message-ID: <ZU6eyDHigbeznsGL@kekkonen.localdomain> (raw)
In-Reply-To: <20231110144407.GA21167@pendragon.ideasonboard.com>

Hi Laurent,

On Fri, Nov 10, 2023 at 04:44:07PM +0200, Laurent Pinchart wrote:
> Hi Sakari,
> 
> Thank you for the patch.
> 
> On Fri, Nov 10, 2023 at 11:47:01AM +0200, Sakari Ailus wrote:
> > Provide a few bits for drivers to store private information on register
> > definitions.
> > 
> > Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> > ---
> >  include/media/v4l2-cci.h | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/include/media/v4l2-cci.h b/include/media/v4l2-cci.h
> > index f2c2962e936b..b4ce0a46092c 100644
> > --- a/include/media/v4l2-cci.h
> > +++ b/include/media/v4l2-cci.h
> > @@ -33,6 +33,12 @@ struct cci_reg_sequence {
> >  #define CCI_REG_ADDR_MASK		GENMASK(15, 0)
> >  #define CCI_REG_WIDTH_SHIFT		16
> >  #define CCI_REG_WIDTH_MASK		GENMASK(19, 16)
> > +/*
> > + * Private CCI register flags, for the use of drivers.
> > + */
> > +#define CCI_REG_FLAG_PRIVATE_START	28U
> 
> Could we name this CCI_REG_PRIVATE_SHIFT, like we do for WIDTH ?
> 
> > +#define CCI_REG_FLAG_PRIVATE_END	31U
> > +#define CCI_REG_PRIVATE_MASK		GENMASK(CCI_REG_FLAG_PRIVATE_END, CCI_REG_FLAG_PRIVATE_START)
> 
> CCI_REG_FLAG_PRIVATE_END isn't used in the rest of the series, so I
> would just write
> 
> #define CCI_REG_PRIVATE_MASK		GENMASK(31, 28)
> 
> for consistency.

Thank you for the thorough review. ;-)

I was actually thinking of adding BUILD_BUG_ON() for that. Or add
CCI_REG_FLAG_PRIVATE_BITS --- it's a bit nicer to test against. Although I
can't imagine a reason right now why we'd want to reduce the number of
these bits.

I'm fine with just changing the mask to use numbers though, with an added
comment on checking all users if reducing the number. Huh.

> 
> >  
> >  #define CCI_REG8(x)			((1 << CCI_REG_WIDTH_SHIFT) | (x))
> >  #define CCI_REG16(x)			((2 << CCI_REG_WIDTH_SHIFT) | (x))
> 

-- 
Regards,

Sakari Ailus

  reply	other threads:[~2023-11-10 21:21 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-10  9:46 [PATCH 0/6] Use V4L2 CCI in CCS driver Sakari Ailus
2023-11-10  9:47 ` [PATCH 1/6] media: v4l: cci: Include linux/bits.h Sakari Ailus
2023-11-10 11:11   ` Hans de Goede
2023-11-10 14:44   ` Laurent Pinchart
2023-11-10  9:47 ` [PATCH 2/6] media: v4l: cci: Add driver-private bit definitions Sakari Ailus
2023-11-10 11:11   ` Hans de Goede
2023-11-10 14:44   ` Laurent Pinchart
2023-11-10 21:21     ` Sakari Ailus [this message]
2023-11-10  9:47 ` [PATCH 3/6] media: v4l: cci: Add macros to obtain register width Sakari Ailus
2023-11-10 11:14   ` Hans de Goede
2023-11-10 11:17     ` Sakari Ailus
2023-11-10 14:44       ` Laurent Pinchart
2023-11-10 14:49         ` Laurent Pinchart
2023-11-10 14:52           ` Hans de Goede
2023-11-10 21:21             ` Sakari Ailus
2023-11-10  9:47 ` [PATCH 4/6] media: ccs: Generate V4L2 CCI compliant register definitions Sakari Ailus
2023-11-10  9:47 ` [PATCH 5/6] media: ccs: Better separate CCS static data access Sakari Ailus
2023-11-10 14:46   ` Laurent Pinchart
2023-11-10 21:24     ` Sakari Ailus
2023-11-10  9:47 ` [PATCH 6/6] media: ccs: Use V4L2 CCI for accessing sensor registers Sakari Ailus
2023-11-10 15:21   ` Laurent Pinchart
2023-11-10 21:38     ` Sakari Ailus
2023-11-10 22:53       ` Laurent Pinchart
2023-11-10 23:03         ` Sakari Ailus

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=ZU6eyDHigbeznsGL@kekkonen.localdomain \
    --to=sakari.ailus@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.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