devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC 0/2] pwrseq: Add subsystem for power sequences
@ 2014-06-19 13:04 Ulf Hansson
  2014-06-19 13:04 ` [RFC 1/2] pwrseq: Add subsystem to handle complex " Ulf Hansson
  2014-06-19 13:04 ` [RFC 2/2] mmc: core: Add support for " Ulf Hansson
  0 siblings, 2 replies; 15+ messages in thread
From: Ulf Hansson @ 2014-06-19 13:04 UTC (permalink / raw)
  To: linux-kernel, linux-mmc, linux-pm, linux-arm-kernel, devicetree
  Cc: Greg Kroah-Hartman, Linus Walleij, Mark Brown, Arnd Bergmann,
	Alexandre Courbot, Arend van Spriel, Sascha Hauer, Chris Ball,
	Chen-Yu Tsai, Olof Johansson, Russell King, Tomasz Figa,
	Hans de Goede, Rob Herring, Pawel Moll, Mark Rutland, Ulf Hansson

Some background:

Subsystems using discoverable buses, sometimes requires to handle a complex
power sequence, to be able to initialize their devices.

Historically, there have been several attempts and posted patches to address
this problem. Here are a some links to a subset of discussions:

http://www.spinics.net/lists/linux-mmc/msg24411.html
http://www.spinics.net/lists/linux-mmc/msg26564.html
http://lwn.net/Articles/525422/
http://linux-kernel.2935.n7.nabble.com/PATCHv9-0-3-Runtime-Interpreted-Power-Sequences-td555721.html


What does the pwrseq subsystem do?

The pwrseq subsystem handles complex power sequences, typically useful
for subsystems that makes use of discoverable buses, like for example
MMC and I2C.

The pwrseq subsystem is dependant on CONFIG_OF to be able to parse a DT
childnode to find out what power sequence method to bind for a device.

>From the DT childnode, the pwrseq DT parser tries to locate a
"power-method" property, which string is matched towards the list of
supported pwrseq methods.

Each pwrseq method implements it's own power sequence and interfaces
the pwrseq core through a few callback functions.

To instantiate a pwrseq method, clients shall use the devm_pwrseq_get()
API. If needed, clients can explicity drop the references to a pwrseq
method using devm_pwrseq_put() API.

Besides instantiation, the pwrseq API provides clients opportunity to
select a certain power state. In this intial version, PWRSEQ_POWER_ON
and PWRSEQ_POWER_OFF are supported. Those are also mandatory for each
pwrseq method to support.


Ulf Hansson (2):
  pwrseq: Add subsystem to handle complex power sequences
  mmc: core: Add support for power sequences

 .../devicetree/bindings/pwrseq/pwrseq.txt          |   48 ++++++
 drivers/Makefile                                   |    2 +-
 drivers/mmc/core/core.c                            |    7 +
 drivers/mmc/core/host.c                            |    5 +
 drivers/pwrseq/Makefile                            |    2 +
 drivers/pwrseq/core.c                              |  175 ++++++++++++++++++++
 drivers/pwrseq/core.h                              |   37 +++++
 drivers/pwrseq/method.c                            |   38 +++++
 include/linux/mmc/host.h                           |    3 +
 include/linux/pwrseq.h                             |   50 ++++++
 10 files changed, 366 insertions(+), 1 deletion(-)
 create mode 100644 Documentation/devicetree/bindings/pwrseq/pwrseq.txt
 create mode 100644 drivers/pwrseq/Makefile
 create mode 100644 drivers/pwrseq/core.c
 create mode 100644 drivers/pwrseq/core.h
 create mode 100644 drivers/pwrseq/method.c
 create mode 100644 include/linux/pwrseq.h

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-07-01 16:56 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-19 13:04 [RFC 0/2] pwrseq: Add subsystem for power sequences Ulf Hansson
2014-06-19 13:04 ` [RFC 1/2] pwrseq: Add subsystem to handle complex " Ulf Hansson
2014-06-19 14:03   ` Hans de Goede
2014-06-19 14:23     ` Hans de Goede
2014-07-01 16:33       ` Ulf Hansson
2014-06-19 17:18   ` Olof Johansson
2014-06-20  7:27     ` Hans de Goede
2014-06-20  8:02       ` Olof Johansson
2014-06-20  8:14         ` Hans de Goede
     [not found]           ` <53A3ED65.80605-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2014-07-01 16:42             ` Ulf Hansson
2014-07-01 16:51               ` Arnd Bergmann
2014-07-01 16:56               ` Arend van Spriel
2014-06-20 15:42   ` Arnd Bergmann
2014-07-01 16:56     ` Ulf Hansson
2014-06-19 13:04 ` [RFC 2/2] mmc: core: Add support for " Ulf Hansson

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).