From: Matthias Kaehlcke <mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
To: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Liam Girdwood <lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Douglas Anderson
<dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Brian Norris
<briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Guenter Roeck <groeck-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Dmitry Torokhov <dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
Subject: Re: [PATCH v2 1/2] regulator: core: add regulator_has_continuous_voltage_range()
Date: Thu, 23 Mar 2017 14:40:16 -0700 [thread overview]
Message-ID: <20170323214016.GA84219@google.com> (raw)
In-Reply-To: <20170320120615.mh3fmcr2cv4dvegf-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
El Mon, Mar 20, 2017 at 12:06:15PM +0000 Mark Brown ha dit:
> On Fri, Mar 17, 2017 at 05:03:30PM -0700, Matthias Kaehlcke wrote:
>
> > In principle I totally agree with you that consumers should be able
> > to enumerate the supported voltages with the existing functions. And
> > they can, as long as they already know (or assume) that the regulator
> > they are using actually has discrete steps, otherwise they might get
> > unexpected results.
>
> Given the limits of number representation continuous regulators also
> have discrete steps, they just have a lot of them (but so do some
> regulators we currently say aren't continuous so...).
>
> > You are right that my case is very specialist, however I think it is
> > a general problem that a consumer can't know whether the results of
> > _list_voltage(), etc correspond to the regulator itself or to its
> > supplies. E.g. a consumer might have a continuous reg which is
> > supplied by a discrete reg, in this case _list_voltage() would return
> > the steps of the supply reg, which is probably not what most consumers
> > expect.
>
> No, this is doesn't make much sense! Why should we be reporting
> properties of the parent regulator when the child regulator is
> regulating away all visibility of those properties?
I am confused whether you are confirming that the current behavior
makes no sense or if you think that what I'm saying is nonsense.
> > > > Please see my explication above on why the vctrl driver needs to know
> > > > this.
>
> > > I'm seeing nothing in the above that addresses my question, you don't
> > > even seem to have mentioned supplies.
>
> > Sorry, I really didn't try to evade your question. Does it make more
> > sense with the example above?
>
> No, not at all.
I take this as an indication that you don't think my description above
is correct.
Let's use a real world example then, tested with actual software and
hardware.
Our regulator is 'ppvar_bigcpu':
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/release-R58-9334.B-chromeos-4.4/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi#177
For our test we change the supply to 'pp1200_lpddr' to make sure the
supply has at least one voltage and this voltage is within the
constraints of 'ppvar_bigcpu'.
'ppvar_bigcpu' is continuous, however _count_voltages(ppvar_bigcpu)
returns 1 and _list_voltage(ppvar_bigcpu, 0) returns 1200000, which is
precisely the configuration of 'pp1200_lpddr'. I verified this with a
4.10ish kernel (no major changes, zero changes in regulators).
> > > What we should be doing for continuous regulators is allowing people to
> > > list the supported voltages as they would for other regulators.
>
> > In the overall regulator context this may make sense, at this point I
> > don't really have enough background on the subsystem to have an
> > informed opinion.
>
> > From the vctrl perspective I wouldn't be overly happy, since it
> > wouldn't allow to distinguish between continuous and discrete
> > supplies, and I still think that handling discrete supplies
> > differently is simpler/more efficient. This doesn't mean I argue
> > against your proposal if it is deemed the right thing from a subsystem
> > perspective.
>
> If it helps think of a continuous regulator as a discrete regulator with
> a base voltage of 0 and steps of 1uV.
Thanks, I understood that. What I didn't realize initially is that we
can avoid iterating through all the voltages if the regulator has
linear steps, which we can determine with regulator_get_linear_step().
With that in mind I don't see concerns from the vctrl perspective.
Matthias
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
WARNING: multiple messages have this Message-ID (diff)
From: Matthias Kaehlcke <mka@chromium.org>
To: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Douglas Anderson <dianders@chromium.org>,
Brian Norris <briannorris@chromium.org>,
Guenter Roeck <groeck@chromium.org>,
Dmitry Torokhov <dtor@chromium.org>
Subject: Re: [PATCH v2 1/2] regulator: core: add regulator_has_continuous_voltage_range()
Date: Thu, 23 Mar 2017 14:40:16 -0700 [thread overview]
Message-ID: <20170323214016.GA84219@google.com> (raw)
In-Reply-To: <20170320120615.mh3fmcr2cv4dvegf@sirena.org.uk>
El Mon, Mar 20, 2017 at 12:06:15PM +0000 Mark Brown ha dit:
> On Fri, Mar 17, 2017 at 05:03:30PM -0700, Matthias Kaehlcke wrote:
>
> > In principle I totally agree with you that consumers should be able
> > to enumerate the supported voltages with the existing functions. And
> > they can, as long as they already know (or assume) that the regulator
> > they are using actually has discrete steps, otherwise they might get
> > unexpected results.
>
> Given the limits of number representation continuous regulators also
> have discrete steps, they just have a lot of them (but so do some
> regulators we currently say aren't continuous so...).
>
> > You are right that my case is very specialist, however I think it is
> > a general problem that a consumer can't know whether the results of
> > _list_voltage(), etc correspond to the regulator itself or to its
> > supplies. E.g. a consumer might have a continuous reg which is
> > supplied by a discrete reg, in this case _list_voltage() would return
> > the steps of the supply reg, which is probably not what most consumers
> > expect.
>
> No, this is doesn't make much sense! Why should we be reporting
> properties of the parent regulator when the child regulator is
> regulating away all visibility of those properties?
I am confused whether you are confirming that the current behavior
makes no sense or if you think that what I'm saying is nonsense.
> > > > Please see my explication above on why the vctrl driver needs to know
> > > > this.
>
> > > I'm seeing nothing in the above that addresses my question, you don't
> > > even seem to have mentioned supplies.
>
> > Sorry, I really didn't try to evade your question. Does it make more
> > sense with the example above?
>
> No, not at all.
I take this as an indication that you don't think my description above
is correct.
Let's use a real world example then, tested with actual software and
hardware.
Our regulator is 'ppvar_bigcpu':
https://chromium.googlesource.com/chromiumos/third_party/kernel/+/release-R58-9334.B-chromeos-4.4/arch/arm64/boot/dts/rockchip/rk3399-gru.dtsi#177
For our test we change the supply to 'pp1200_lpddr' to make sure the
supply has at least one voltage and this voltage is within the
constraints of 'ppvar_bigcpu'.
'ppvar_bigcpu' is continuous, however _count_voltages(ppvar_bigcpu)
returns 1 and _list_voltage(ppvar_bigcpu, 0) returns 1200000, which is
precisely the configuration of 'pp1200_lpddr'. I verified this with a
4.10ish kernel (no major changes, zero changes in regulators).
> > > What we should be doing for continuous regulators is allowing people to
> > > list the supported voltages as they would for other regulators.
>
> > In the overall regulator context this may make sense, at this point I
> > don't really have enough background on the subsystem to have an
> > informed opinion.
>
> > From the vctrl perspective I wouldn't be overly happy, since it
> > wouldn't allow to distinguish between continuous and discrete
> > supplies, and I still think that handling discrete supplies
> > differently is simpler/more efficient. This doesn't mean I argue
> > against your proposal if it is deemed the right thing from a subsystem
> > perspective.
>
> If it helps think of a continuous regulator as a discrete regulator with
> a base voltage of 0 and steps of 1uV.
Thanks, I understood that. What I didn't realize initially is that we
can avoid iterating through all the voltages if the regulator has
linear steps, which we can determine with regulator_get_linear_step().
With that in mind I don't see concerns from the vctrl perspective.
Matthias
next prev parent reply other threads:[~2017-03-23 21:40 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-08 20:02 [PATCH v2 1/2] regulator: core: add regulator_has_continuous_voltage_range() Matthias Kaehlcke
2017-03-08 20:02 ` Matthias Kaehlcke
2017-03-08 20:02 ` [PATCH v2 2/2] regulator: Add driver for voltage controlled regulators Matthias Kaehlcke
[not found] ` <20170308200246.126331-1-mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>
2017-03-09 10:28 ` [PATCH v2 1/2] regulator: core: add regulator_has_continuous_voltage_range() Mark Brown
2017-03-09 10:28 ` Mark Brown
2017-03-09 19:40 ` Matthias Kaehlcke
2017-03-17 21:15 ` Mark Brown
[not found] ` <20170317211547.22jrqud5np4ve2jk-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-03-18 0:03 ` Matthias Kaehlcke
2017-03-18 0:03 ` Matthias Kaehlcke
2017-03-20 12:06 ` Mark Brown
[not found] ` <20170320120615.mh3fmcr2cv4dvegf-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2017-03-23 21:40 ` Matthias Kaehlcke [this message]
2017-03-23 21:40 ` Matthias Kaehlcke
[not found] ` <20170323214016.GA84219-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2017-03-24 18:43 ` Mark Brown
2017-03-24 18:43 ` Mark Brown
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=20170323214016.GA84219@google.com \
--to=mka-f7+t8e8rja9g9huczpvpmw@public.gmane.org \
--cc=briannorris-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=dtor-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=groeck-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=lgirdwood-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
--cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.