From: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
To: Mark Brown <broonie@kernel.org>
Cc: Kukjin Kim <kgene.kim@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Olof Johansson <olof@lixom.net>, Chris Zhong <zyw@rock-chips.com>,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Abhilash Kesavan <kesavan.abhilash@gmail.com>,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH v5 1/5] regulator: Document binding for initial and suspend modes
Date: Fri, 07 Nov 2014 16:38:04 +0100 [thread overview]
Message-ID: <545CE75C.8000408@collabora.co.uk> (raw)
In-Reply-To: <20141107145806.GQ8509@sirena.org.uk>
Hello Mark,
Thanks a lot for your feedback.
On 11/07/2014 03:58 PM, Mark Brown wrote:
> On Fri, Nov 07, 2014 at 02:00:01PM +0100, Javier Martinez Canillas wrote:
>
>> + The "regulator-mode" property only takes effect if the regulator is
>> + enabled for the given suspend state using "regulator-on-in-suspend".
>
> Why?
>
I saw that the regulator core only call the .set_suspend_mode callback if
the regulator is either enabled or disabled explicitly...
static int suspend_set_state(struct regulator_dev *rdev,
struct regulator_state *rstate)
{
....
/* If we have no suspend mode configration don't set anything;
* only warn if the driver implements set_suspend_voltage or
* set_suspend_mode callback.
*/
if (!rstate->enabled && !rstate->disabled) {
if (rdev->desc->ops->set_suspend_voltage ||
rdev->desc->ops->set_suspend_mode)
rdev_warn(rdev, "No configuration\n");
return 0;
}
...
};
>> + If the regulator has not been explicitly disabled for the given state
>> + with "regulator-off-in-suspend", then setting the operating mode
>> + will also have no effect.
>
> This seems surprising, I'd expect mode setting to be paid attention to
> even if the regulator is off - we may add other ways to control the
> enable state in suspend for example.
>
...and I thought that setting a mode if the regulator was disabled in suspend
was not a possible configuration, that's why I documented that.
I know that there is both a .set_suspend_disable and .set_suspend_mode but
at least in the hardware that I'm interested in (max77802), the same hw
register is used for setting a suspend mode and disable on suspend.
So if this is allowed and a user specifies both a disable on suspend and a
suspend mode, the later will overwrite the configuration of the former.
But now that I think about it, this is only a constraint of the max77802
and probably needs to be specified in the max77802 DT binding and not in
the regulator generic one since otherwise limits what other devices can
do.
>> +- regulator-initial-mode: initial operating mode. The set of possible operating
>> + modes is the same used for the regulator-mode property and the device binding
>> + documentation explains which property each regulator supports.
>> +If no mode is defined, then the OS will not manage the modes and the hardware
>> +default values will be used instead.
>
> Again that seems surprising, it precludes any future changes and isn't
> going to be true for devices where we can't read the current state.
>
I saw that you asked Chanwoo on an early version of his suspend states
series, to point out that in the absence of a initial state, the state is
the hardware default [0] so I thought that it should be the case for the
regulator suspend mode too.
So should I just explain what each property is about without trying to make
assumptions about the limitations that different devices could have and let
each device DT binding to specify those?
Best regards,
Javier
[0]: https://lkml.org/lkml/2014/9/4/652
next prev parent reply other threads:[~2014-11-07 15:38 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-07 13:00 [PATCH v5 0/5] regulator: of: Add initial and suspend modes support Javier Martinez Canillas
2014-11-07 13:00 ` [PATCH v5 1/5] regulator: Document binding for initial and suspend modes Javier Martinez Canillas
[not found] ` <1415365205-27630-2-git-send-email-javier.martinez-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2014-11-07 14:58 ` Mark Brown
2014-11-07 15:38 ` Javier Martinez Canillas [this message]
[not found] ` <545CE75C.8000408-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2014-11-07 16:10 ` Mark Brown
2014-11-07 16:19 ` Javier Martinez Canillas
2014-11-07 13:00 ` [PATCH v5 2/5] regulator: Add function to map modes to struct regulator_desc Javier Martinez Canillas
2014-11-07 15:54 ` Mark Brown
2014-11-07 16:17 ` Javier Martinez Canillas
2014-11-07 13:00 ` [PATCH v5 3/5] regulator: of: Add regulator desc param to of_get_regulator_init_data() Javier Martinez Canillas
2014-11-07 15:07 ` Mark Brown
[not found] ` <20141107150743.GR8509-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-11-07 15:49 ` Javier Martinez Canillas
2014-11-07 15:23 ` Krzysztof Kozlowski
2014-11-07 16:11 ` Javier Martinez Canillas
2014-11-07 13:00 ` [PATCH v5 4/5] regulator: of: Pass the regulator description in the match table Javier Martinez Canillas
2014-11-07 13:00 ` [PATCH v5 5/5] regulator: of: Add support for parsing initial and suspend modes Javier Martinez Canillas
2014-11-07 15:47 ` Mark Brown
[not found] ` <20141107154743.GT8509-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-11-07 16:15 ` Javier Martinez Canillas
[not found] ` <545CF02A.9060500-ZGY8ohtN/8pPYcu2f3hruQ@public.gmane.org>
2014-11-07 16:21 ` Mark Brown
2014-11-07 15:26 ` [PATCH v5 0/5] regulator: of: Add initial and suspend modes support Krzysztof Kozlowski
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=545CE75C.8000408@collabora.co.uk \
--to=javier.martinez@collabora.co.uk \
--cc=broonie@kernel.org \
--cc=cw00.choi@samsung.com \
--cc=devicetree@vger.kernel.org \
--cc=k.kozlowski@samsung.com \
--cc=kesavan.abhilash@gmail.com \
--cc=kgene.kim@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=olof@lixom.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).