mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Laight <David.Laight@ACULAB.COM>
To: 'Chen-Yu Tsai' <wenst@chromium.org>
Cc: Mark Brown <broonie@kernel.org>,
	Liam Girdwood <lgirdwood@gmail.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Cristian Ciocaltea <cristian.ciocaltea@gmail.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>,
	"linux-actions@lists.infradead.org" 
	<linux-actions@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: RE: [PATCH] regulator: Use bitfield values for range selectors
Date: Mon, 12 Jun 2023 10:13:40 +0000	[thread overview]
Message-ID: <f5e6353f324343df8c289d8aed2a8930@AcuMS.aculab.com> (raw)
In-Reply-To: <CAGXv+5Hnrpv8kTU+0B9S4NyqALEz+DQOLfO3U7GwMZp9AoqLEw@mail.gmail.com>

From: Chen-Yu Tsai
> Sent: 12 June 2023 10:27
> To: David Laight <David.Laight@ACULAB.COM>
> Cc: Mark Brown <broonie@kernel.org>; Liam Girdwood <lgirdwood@gmail.com>; Manivannan Sadhasivam
> <mani@kernel.org>; Cristian Ciocaltea <cristian.ciocaltea@gmail.com>; Matti Vaittinen
> <mazziesaccount@gmail.com>; linux-actions@lists.infradead.org; linux-kernel@vger.kernel.org; linux-
> arm-kernel@lists.infradead.org
> Subject: Re: [PATCH] regulator: Use bitfield values for range selectors
> 
> On Mon, Jun 12, 2023 at 3:48 PM David Laight <David.Laight@aculab.com> wrote:
> >
> > From: Chen-Yu Tsai
> > > Sent: 12 June 2023 04:39
> > >
> > > On Sun, Jun 11, 2023 at 1:10 AM David Laight <David.Laight@aculab.com> wrote:
> > > >
> > > > From: Chen-Yu Tsai
> > > > > Sent: 08 June 2023 08:57
> > > > >
> > > > > Right now the regulator helpers expect raw register values for the range
> > > > > selectors. This is different from the voltage selectors, which are
> > > > > normalized as bitfield values. This leads to a bit of confusion. Also,
> > > > > raw values are harder to copy from datasheets or match up with them,
> > > > > as datasheets will typically have bitfield values.
> > > > >
> > > > > Make the helpers expect bitfield values, and convert existing users.
> > > > > Include bitops.h explicitly for ffs(), and reorder the header include
> > > > > statements. While at it, also replace module.h with export.h, since the
> > > > > only use is EXPORT_SYMBOL_GPL.
> > > > >
> > > > ...
> > > > >  static const unsigned int atc260x_ldo_voltage_range_sel[] = {
> > > > > -     0x0, 0x20,
> > > > > +     0x0, 0x1,
> > > > >  };
> > > >
> > > > Is there any way the change can be done so that un-edited
> > > > modules fail to compile?
> > > > Otherwise the whole thing is an accident waiting to happen.
> > >
> > > I think we could change the field name in the regulator description?
> > > But unsuspecting end users / developers might just edit the name and not
> > > see that the scheme has changed.

Looking at it, that would seem to be needed.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

      reply	other threads:[~2023-06-12 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-08  7:56 Chen-Yu Tsai
2023-06-08  8:30 ` Matti Vaittinen
2023-06-09 10:45 ` Matti Vaittinen
2023-06-09 10:53   ` Mark Brown
2023-06-09 11:00     ` Matti Vaittinen
2023-06-10 17:10 ` David Laight
2023-06-12  3:39   ` Chen-Yu Tsai
2023-06-12  7:47     ` David Laight
2023-06-12  9:27       ` Chen-Yu Tsai
2023-06-12 10:13         ` David Laight [this message]

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=f5e6353f324343df8c289d8aed2a8930@AcuMS.aculab.com \
    --to=david.laight@aculab.com \
    --cc=broonie@kernel.org \
    --cc=cristian.ciocaltea@gmail.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-actions@lists.infradead.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mazziesaccount@gmail.com \
    --cc=wenst@chromium.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®