From: Ulf Hansson <ulf.hansson@linaro.org>
To: linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org,
linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
devicetree@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Linus Walleij <linus.walleij@linaro.org>,
Mark Brown <broonie@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
Alexandre Courbot <gnurou@gmail.com>,
Arend van Spriel <arend@broadcom.com>,
Sascha Hauer <s.hauer@pengutronix.de>,
Chris Ball <chris@printf.net>, Chen-Yu Tsai <wens@csie.org>,
Olof Johansson <olof@lixom.net>,
Russell King <linux@arm.linux.org.uk>,
Tomasz Figa <tomasz.figa@gmail.com>,
Hans de Goede <hdegoede@redhat.com>,
Rob Herring <robh+dt@kernel.org>, Pawel Moll <pawel.moll@arm.com>,
Mark Rutland <mark.rutland@arm.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: [RFC 0/2] pwrseq: Add subsystem for power sequences
Date: Thu, 19 Jun 2014 15:04:49 +0200 [thread overview]
Message-ID: <1403183091-27876-1-git-send-email-ulf.hansson@linaro.org> (raw)
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
next reply other threads:[~2014-06-19 13:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 13:04 Ulf Hansson [this message]
2014-06-19 13:04 ` [RFC 1/2] pwrseq: Add subsystem to handle complex power sequences 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
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=1403183091-27876-1-git-send-email-ulf.hansson@linaro.org \
--to=ulf.hansson@linaro.org \
--cc=arend@broadcom.com \
--cc=arnd@arndb.de \
--cc=broonie@kernel.org \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=gnurou@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=hdegoede@redhat.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux@arm.linux.org.uk \
--cc=mark.rutland@arm.com \
--cc=olof@lixom.net \
--cc=pawel.moll@arm.com \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=tomasz.figa@gmail.com \
--cc=wens@csie.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;
as well as URLs for NNTP newsgroup(s).