[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9b01b4d2bd85b7abc3fd5e8c95f8086ee6d7a313.camel@fi.rohmeurope.com>
Date: Sat, 22 Feb 2020 08:33:29 +0000
From: "Vaittinen, Matti" <Matti.Vaittinen@...rohmeurope.com>
To: "linus.walleij@...aro.org" <linus.walleij@...aro.org>
CC: "mazziesaccount@...il.com" <mazziesaccount@...il.com>,
"mark.rutland@....com" <mark.rutland@....com>,
"Mutanen, Mikko" <Mikko.Mutanen@...rohmeurope.com>,
"broonie@...nel.org" <broonie@...nel.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"sre@...nel.org" <sre@...nel.org>,
"Laine, Markus" <Markus.Laine@...rohmeurope.com>,
"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
"robh+dt@...nel.org" <robh+dt@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 3/5] power: Add linear_range helper
Morning Linus,
On Fri, 2020-02-21 at 14:49 +0100, Linus Walleij wrote:
> On Fri, Feb 14, 2020 at 8:37 AM Matti Vaittinen
> <matti.vaittinen@...rohmeurope.com> wrote:
>
> > Many devices have control registers which control some measurable
> > property. Often a register contains control field so that change in
> > this field causes linear change in the controlled property. It is
> > not
> > a rare case that user wants to give 'meaningfull' control values
> > and
> > driver needs to convert them to register field values. Even more
> > often user wants to 'see' the currently set value - again in
> > meaningfull units - and driver needs to convert the values it reads
> > from register to these meaningfull units.
>
> Rename meaningfull -> meaningful
>
> > This ideas is stol... borrowed from regulator framework's
> > regulator_linear_ranges handling.
>
> Hehe maybe one day we can move the whole thing to lib/
> but let's take one step at a time.
>
> > Provide a linear_range helper which can do conversion from user
> > value
> > to register value 'selector'.
> >
> > Signed-off-by: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
> > ---
> >
> > Where should we put these?
>
> This works.
>
> Reviewed-by: Linus Walleij <linus.walleij@...aro.org>
Uh.. Sorry but I did already send v3 where I changed the approach to
what was suggested by Mark. Eg, I tried pulling the range code out of
regulator framework and used that in power/supply too.
Basic idea is still the same - but instead of using min_sel + amount of
values in range, the version 3 uses min_sel and max_sel as regulators
did. That minimized changes to numerous regulator drivers defining
ranges.
Sorry for making you to do unnecessary reviewing.
Best Regards
Matti Vaittinen
Powered by blists - more mailing lists