public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Alex Courbot <acourbot@nvidia.com>
To: NeilBrown <neilb@suse.de>, Mark Brown <broonie@kernel.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thierry Reding <thierry.reding@avionic-design.de>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>
Subject: Re: Any news on Runtime Interpreted Power Sequences
Date: Thu, 31 Oct 2013 14:23:05 +0900	[thread overview]
Message-ID: <5271E939.2070309@nvidia.com> (raw)
In-Reply-To: <20131031155946.1890db5a@notabene.brown>

On 10/31/2013 01:59 PM, NeilBrown wrote:
> * PGP Signed by an unknown key
>
> On Tue, 29 Oct 2013 09:18:16 -0700 Mark Brown <broonie@kernel.org> wrote:
>
>> On Tue, Oct 29, 2013 at 11:10:37AM +1100, NeilBrown wrote:
>>
>>> Yes, the device is soldered down and has a reset line that needs to be pulsed
>>> low at about the same time that the MMC port enables the regulator.
>>
>>> How do you propose that I describe this?  Which driver should know about the
>>> reset GPIO, how to I tell it about the GPIO, and which function should do the
>>> pulsing?
>>
>> I'd expect the driver for the device to know about this, obviously
>> depending on what this actually does it might want to use this at
>> runtime (for example, putting the device into reset to minimise power
>> while it's idle).  We really need a generic way for devices such as this
>> on enumerable buses to run before the current probe() in order to allow
>> them to manage their power up sequences in embedded systems, this is
>> *far* from a unique situation.
>
> I agree.
> To me, this sounds a lot like saying "We need a way for enumerable buses to
> be given a power-on-sequence to power on the attached device".  That is what
> I hopped RIPS would provide.

There are a few ad-hoc solutions that provide such a mechanism using 
platform data. Take for instance 
include/linux/platform_data/brcmfmac-sdio.h. It allows you to register a 
platform device which sole purpose is to control the power sequence of a 
SDIO network device. When the platform device is registered, it powers 
the network device which can then be probed by the bus. The network 
driver also calls the platform power on/off functions when appropriate.

This works quite well in the case of board files where you can write 
power sequencing code freely, but the question is how to translate it to 
device tree. You need to translate several, board-specific (and not 
device-specific) functions. Here I have to admit this seems like a good 
fit for in-DT power sequences.

> Maybe various devices could allow other devices to register for call-backs
> when the first device activates or deactivates a port  (whether an MMC port or
> USB or Serial or whatever).
> Then a driver that needs to control the power-on sequence would register as a
> platform-device which registers a call-back with the appropriate parent and
> performs the required power-on/off.
>
> Does that sound like the right sort of thing?

I think it does, but you are still left with the problem of how and 
where to define that board-specific power sequence. If things were 
always as simple as turning a regulator on, this would be easy, but 
apparently we also face more complex cases.

Alex.


      reply	other threads:[~2013-10-31  5:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25  0:22 Any news on Runtime Interpreted Power Sequences NeilBrown
2013-10-25  6:23 ` Alex Courbot
2013-10-25  7:33   ` NeilBrown
2013-10-28 10:01     ` Alex Courbot
2013-10-28 11:10       ` NeilBrown
2013-10-28 23:53         ` Mark Brown
2013-10-29  0:10           ` NeilBrown
2013-10-29 16:18             ` Mark Brown
2013-10-31  4:59               ` NeilBrown
2013-10-31  5:23                 ` Alex Courbot [this message]

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=5271E939.2070309@nvidia.com \
    --to=acourbot@nvidia.com \
    --cc=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=thierry.reding@avionic-design.de \
    /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