[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdY1oa859bkVrgwA4iai7982GL_EMxns5+wAhQr+ggf9Kw@mail.gmail.com>
Date: Fri, 21 Feb 2020 14:49:21 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Matti Vaittinen <matti.vaittinen@...rohmeurope.com>
Cc: Matti Vaittinen <mazziesaccount@...il.com>,
mikko.mutanen@...rohmeurope.com, markus.laine@...rohmeurope.com,
Mark Brown <broonie@...nel.org>,
Sebastian Reichel <sre@...nel.org>,
Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
Linux PM list <linux-pm@...r.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [RFC PATCH v2 3/5] power: Add linear_range helper
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>
Yours,
Linus Walleij
Powered by blists - more mailing lists