All of lore.kernel.org
 help / color / mirror / Atom feed
From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Doug Anderson <dianders@chromium.org>
Cc: "Chris Zhong" <zyw@rock-chips.com>,
	"Heiko Stübner" <heiko@sntech.de>,
	"Mike Turquette" <mturquette@linaro.org>,
	"Ian Campbell" <ijc+devicetree@hellion.org.uk>,
	"Russell King" <linux@arm.linux.org.uk>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Pawel Moll" <pawel.moll@arm.com>,
	"Mark Rutland" <mark.rutland@arm.com>,
	"Linus Walleij" <linus.walleij@linaro.org>,
	"Kevin Hilman" <khilman@kernel.org>,
	"open list:ARM/Rockchip SoC..."
	<linux-rockchip@lists.infradead.org>,
	"Kumar Gala" <galak@codeaurora.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Mark Brown" <broonie@linaro.org>
Subject: Re: [PATCH v6 7/7] ARM: dts: add suspend voltage setting for RK808
Date: Thu, 30 Oct 2014 01:32:47 +0100	[thread overview]
Message-ID: <5451872F.4050306@collabora.co.uk> (raw)
In-Reply-To: <CAD=FV=VtKdLH51tDvHsRfMYah9cUNcNRfbVJ1rfroxwsZZLTsA@mail.gmail.com>

Hello Doug,

On 10/29/2014 05:51 PM, Doug Anderson wrote:
>>
>> In other words, do you want the core to call rk808_set_suspend_voltage() or
>> rk808_set_suspend_enable()? If the later then you can use Chanwoo's bindings:
>>
>> regulator-state-mem {
>>    regulator-on-in-suspend;
>> };
> 
> The rk808 has a separate register for storing the sleep voltage,
> though.  ...so just using "regulator-on-in-suspend" without any
> changes to the rk808 driver won't get us this "for free".  I'd expect
> to need
> 
>  regulator-state-mem {
>     regulator-on-in-suspend;
>     regulator-suspend-microvolts = <3300000>;
>  };
>

I see, then as you said the voltage has to be defined in the DT for the suspend
state.

As I mentioned in my previous email, Chanwoo's original suspend state series had
a "regulator-volt" DT property that was used to fill the struct regulator_state
.uV field so the core could call the .set_suspend_voltage function handler.

AFAIU Mark wanted the property to be renamed to "rebulator-microvolt" [0] to be
consistent with the rest of the binding and also he was not sure if the suspend
voltage needed be in the runtime voltage range specified by the properties
"regulator-{min,max}-microvolt" since Chanwoo's patch had a check for that [1].

Chanwoo decided to drop setting the suspend voltage in a following version, but
given that there is a use case for this feature, I think that those two issues
could be addressed and added that property to the generic regulator DT binding.
 
> IMHO it wouldn't be insane to say that if someone has
> "regulator-on-in-suspend" but no suspend voltage defined that it
> should carry forward the runtime voltage.  I actually argued for that
> earlier and Mark Brown said "no" at
> <http://marc.info/?l=linux-kernel&m=141277262106368&w=2>.  More at
> <http://marc.info/?l=linux-kernel&m=141279245027919&w=2>.  It's
> entirely possible I wasn't making myself clear, though.
> 

What I learned from previous Mark's explanations is that there is always a
reason why the regulator API split different operations. So if there is both
a .set_voltage and .set_suspend_voltage, then that is an indication for me
that if someone wants a particular voltage during suspend then it has to be
explicitly set and should not rely on the runtime voltage previously set.

The fact that the rk808 has different registers to configure the runtime
and suspend voltage seems to confirm that the API split makes sense.

Best regards,
Javier

[0]: https://lkml.org/lkml/2014/9/4/652
[1]: https://lkml.org/lkml/2014/9/4/651

WARNING: multiple messages have this Message-ID (diff)
From: javier.martinez@collabora.co.uk (Javier Martinez Canillas)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v6 7/7] ARM: dts: add suspend voltage setting for RK808
Date: Thu, 30 Oct 2014 01:32:47 +0100	[thread overview]
Message-ID: <5451872F.4050306@collabora.co.uk> (raw)
In-Reply-To: <CAD=FV=VtKdLH51tDvHsRfMYah9cUNcNRfbVJ1rfroxwsZZLTsA@mail.gmail.com>

Hello Doug,

On 10/29/2014 05:51 PM, Doug Anderson wrote:
>>
>> In other words, do you want the core to call rk808_set_suspend_voltage() or
>> rk808_set_suspend_enable()? If the later then you can use Chanwoo's bindings:
>>
>> regulator-state-mem {
>>    regulator-on-in-suspend;
>> };
> 
> The rk808 has a separate register for storing the sleep voltage,
> though.  ...so just using "regulator-on-in-suspend" without any
> changes to the rk808 driver won't get us this "for free".  I'd expect
> to need
> 
>  regulator-state-mem {
>     regulator-on-in-suspend;
>     regulator-suspend-microvolts = <3300000>;
>  };
>

I see, then as you said the voltage has to be defined in the DT for the suspend
state.

As I mentioned in my previous email, Chanwoo's original suspend state series had
a "regulator-volt" DT property that was used to fill the struct regulator_state
.uV field so the core could call the .set_suspend_voltage function handler.

AFAIU Mark wanted the property to be renamed to "rebulator-microvolt" [0] to be
consistent with the rest of the binding and also he was not sure if the suspend
voltage needed be in the runtime voltage range specified by the properties
"regulator-{min,max}-microvolt" since Chanwoo's patch had a check for that [1].

Chanwoo decided to drop setting the suspend voltage in a following version, but
given that there is a use case for this feature, I think that those two issues
could be addressed and added that property to the generic regulator DT binding.
 
> IMHO it wouldn't be insane to say that if someone has
> "regulator-on-in-suspend" but no suspend voltage defined that it
> should carry forward the runtime voltage.  I actually argued for that
> earlier and Mark Brown said "no" at
> <http://marc.info/?l=linux-kernel&m=141277262106368&w=2>.  More at
> <http://marc.info/?l=linux-kernel&m=141279245027919&w=2>.  It's
> entirely possible I wasn't making myself clear, though.
> 

What I learned from previous Mark's explanations is that there is always a
reason why the regulator API split different operations. So if there is both
a .set_voltage and .set_suspend_voltage, then that is an indication for me
that if someone wants a particular voltage during suspend then it has to be
explicitly set and should not rely on the runtime voltage previously set.

The fact that the rk808 has different registers to configure the runtime
and suspend voltage seems to confirm that the API split makes sense.

Best regards,
Javier

[0]: https://lkml.org/lkml/2014/9/4/652
[1]: https://lkml.org/lkml/2014/9/4/651

  reply	other threads:[~2014-10-30  0:32 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 11:51 [PATCH v6 0/7] This is the 1st version of suspend for RK3288 Chris Zhong
2014-10-29 11:51 ` Chris Zhong
2014-10-29 11:51 ` [PATCH v6 1/7] pinctrl: rockchip: add suspend/resume functions Chris Zhong
2014-10-29 11:51   ` Chris Zhong
2014-10-31 20:54   ` Linus Walleij
2014-10-31 20:54     ` Linus Walleij
2014-11-02 20:47   ` Heiko Stübner
2014-11-02 20:47     ` Heiko Stübner
2014-10-29 11:52 ` [PATCH v6 2/7] pinctrl: rockchip: save and restore gpio6_c6 pinmux in suspend/resume Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 3/7] clk: rockchip: RK3288: add suspend and resume Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 4/7] ARM: rockchip: add suspend and resume for RK3288 Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 19:01   ` Kevin Hilman
2014-10-29 19:01     ` Kevin Hilman
2014-10-29 19:26     ` Doug Anderson
2014-10-29 19:26       ` Doug Anderson
2014-10-29 20:00       ` Kevin Hilman
2014-10-29 20:00         ` Kevin Hilman
2014-11-11  7:33     ` Chris Zhong
2014-11-11  7:33       ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 5/7] ARM: rockchip: Add pmu-sram binding Chris Zhong
2014-10-29 11:52 ` [PATCH v6 6/7] ARM: dts: add RK3288 suspend support Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 11:52 ` [PATCH v6 7/7] ARM: dts: add suspend voltage setting for RK808 Chris Zhong
2014-10-29 11:52   ` Chris Zhong
2014-10-29 15:40   ` Doug Anderson
2014-10-29 15:40     ` Doug Anderson
2014-10-29 15:40     ` Doug Anderson
2014-10-29 16:29     ` Javier Martinez Canillas
2014-10-29 16:29       ` Javier Martinez Canillas
2014-10-29 16:51       ` Doug Anderson
2014-10-29 16:51         ` Doug Anderson
2014-10-29 16:51         ` Doug Anderson
2014-10-30  0:32         ` Javier Martinez Canillas [this message]
2014-10-30  0:32           ` Javier Martinez Canillas
2014-10-29 20:06 ` [PATCH v6 0/7] This is the 1st version of suspend for RK3288 Kevin Hilman
2014-10-29 20:06   ` Kevin Hilman
2014-10-29 21:50   ` Heiko Stübner
2014-10-29 21:50     ` Heiko Stübner
2014-10-29 22:26     ` Doug Anderson
2014-10-29 22:26       ` Doug Anderson
2014-10-29 22:26       ` Doug Anderson

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=5451872F.4050306@collabora.co.uk \
    --to=javier.martinez@collabora.co.uk \
    --cc=broonie@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=galak@codeaurora.org \
    --cc=heiko@sntech.de \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=khilman@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=mturquette@linaro.org \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=zyw@rock-chips.com \
    /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.