public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@opensource.wolfsonmicro.com>
To: Harald Welte <laforge@gnumonks.org>
Cc: Liam Girdwood <lg@opensource.wolfsonmicro.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	arm kernel <linux-arm-kernel@lists.arm.linux.org.uk>
Subject: Re: [PATCH 0/13] Updated V4  - Regulator Framework
Date: Thu, 8 May 2008 21:16:43 +0100	[thread overview]
Message-ID: <20080508201641.GA16945@sirena.org.uk> (raw)
In-Reply-To: <20080508063538.GC6105@prithivi.gnumonks.org>

On Thu, May 08, 2008 at 08:35:38AM +0200, Harald Welte wrote:

> The PCF506xx have a concept of global power management states,
> particularly important are the ON and STANDBY states in this context.
> Every regulator has a property whether it is enabled in none, one or
> both of the global power management states.

That's a problem we've encountered - at least the WM8350 and (to a
lesser extent) the WM8400, both of which have had support implemented in
terms of the regulator API, have similar states.

> Do you think it would be worth to export something like this in the
> generic API, too?  It's probably quite hard, since there are devices
> that actually use the PCF506xx STANDBY state during suspend-to-ram, but
> other devices leave the PCF506xx in the ON state and just disable the
> individual regulators using I2C register writes.

Indeed - where a STANDBY-style state is used the likely implementation
is going to be something like setting a GPIO at some point towards the
very end of suspending to activate it (if it's done directly by software
at all).

> I think there's probably no clean way how to integrate this, since the
> question remains: who makes the decision (and manages the contraints) of
> when to transition into the STANDBY state.   Nevertheless a read-only
> sysfs attribute might still be interesting.

At present the regulator API pretty much works on the assumption that
this will be very system specific and probably not amount to much in
software terms since the CPU is likely to be suspended or off while
these modes are active so the transitions can adequately be handled by
machine specific code.

What might be more readily generalisable would be configuration for what
happens in the very low power states.  The WM8350 driver has a
device-specific API which provides access for the soft configuration for
this state since the chip allows the system to set the state of the
regulator when it is suspended.  This gives a second set of settings
that are activated when the system enters a low power state.  This
caters for most cases (where this will be statically configured by the
board setup code) but if it were generalised into the regulator core
then it would allow use in conjunction with the device_*_wakeup() stuff,
letting drivers say which of their supplies they need when suspended.  I
don't know how much demand there would be for that, though, and it'd be
an extension to the API.

This gets rather more interesting when the system has a secondary PMIC -
with multiple PMICs it's much more likely that one of them could be
placed into a low power state while the system is running.  Off the top
of my head that may be adequately handled by having a master regulator
driver in the tree supplying the secondary PMIC which puts it into a low
power state when it is not needed.  It's probably best tackled when we
have some experience with such systems.

  reply	other threads:[~2008-05-08 20:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-02 15:40 [PATCH 0/13] Updated V4 - Regulator Framework Liam Girdwood
2008-05-02 23:52 ` Andrew Morton
2008-05-03 10:31   ` Liam Girdwood
2008-05-08  6:35 ` Harald Welte
2008-05-08 20:16   ` Mark Brown [this message]
2008-05-08 20:51   ` Liam Girdwood
2008-05-09  4:37     ` Harald Welte
2008-05-09 19:44       ` Liam Girdwood
2008-05-11 14:39         ` Liam Girdwood
2008-07-10  9:08 ` Andrew Morton
2008-07-29 20:33   ` Liam Girdwood
2008-07-29 20:40     ` Andrew Morton

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=20080508201641.GA16945@sirena.org.uk \
    --to=broonie@opensource.wolfsonmicro.com \
    --cc=akpm@linux-foundation.org \
    --cc=laforge@gnumonks.org \
    --cc=lg@opensource.wolfsonmicro.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox