From: Maxime Ripard <maxime.ripard@free-electrons.com>
To: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Chris Ball <chris@printf.net>,
linux-mmc@vger.kernel.org, Mark Rutland <mark.rutland@arm.com>,
devicetree@vger.kernel.org, Ulf Hansson <ulf.hansson@linaro.org>,
Pawel Moll <pawel.moll@arm.com>,
Ian Campbell <ijc+devicetree@hellion.org.uk>,
Randy Dunlap <rdunlap@infradead.org>,
linux-doc@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
Kumar Gala <galak@codeaurora.org>,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 34/38] mmc: add support for power-on sequencing through DT
Date: Thu, 24 Apr 2014 11:05:51 +0200 [thread overview]
Message-ID: <20140424090551.GW24905@lukather> (raw)
In-Reply-To: <E1Wd2XY-0003wa-3n@rmk-PC.arm.linux.org.uk>
[-- Attachment #1: Type: text/plain, Size: 3946 bytes --]
Hi Russell,
On Wed, Apr 23, 2014 at 08:09:04PM +0100, Russell King wrote:
> From: Olof Johansson <olof@lixom.net>
>
> This patch enables support for power-on sequencing of SDIO peripherals through DT.
>
> In general, it's quite common that wifi modules and other similar
> peripherals have several signals in addition to the SDIO interface that
> needs wiggling before the module will power on. It's common to have a
> reference clock, one or several power rails and one or several lines
> for reset/enable type functions.
>
> The binding as written today introduces a number of reset gpios,
> a regulator and a clock specifier. The code will handle up to 2 gpio
> reset lines, but it's trivial to increase to more than that if needed
> at some point.
>
> Implementation-wise, the MMC core has been changed to handle this during
> host power up, before the host interface is powered on. I have not yet
> implemented the power-down side, I wanted people to have a chance for
> reporting back w.r.t. issues (or comments on the bindings) first.
>
> I have not tested the regulator portion, since the system and module
> I'm working on doesn't need one (Samsung Chromebook with Marvell
> 8797-based wifi). Testing of those portions (and reporting back) would
> be appreciated.
>
> Signed-off-by: Olof Johansson <olof@lixom.net>
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
> ---
> Documentation/devicetree/bindings/mmc/mmc.txt | 11 +++++++
> drivers/mmc/core/core.c | 42 +++++++++++++++++++++++++++
> drivers/mmc/core/host.c | 30 ++++++++++++++++++-
> include/linux/mmc/host.h | 5 ++++
> 4 files changed, 87 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/mmc/mmc.txt b/Documentation/devicetree/bindings/mmc/mmc.txt
> index 9dce540771fb..b9b534ebc0c5 100644
> --- a/Documentation/devicetree/bindings/mmc/mmc.txt
> +++ b/Documentation/devicetree/bindings/mmc/mmc.txt
> @@ -5,6 +5,8 @@ these definitions.
> Interpreted by the OF core:
> - reg: Registers location and length.
> - interrupts: Interrupts used by the MMC controller.
> +- clocks: Clocks needed for the host controller, if any.
> +- clock-names: Goes with clocks above.
>
> Card detection:
> If no property below is supplied, host native card detect is used.
> @@ -39,6 +41,15 @@ If no property below is supplied, host native card detect is used.
> - mmc-hs200-1_8v: eMMC HS200 mode(1.8V I/O) is supported
> - mmc-hs200-1_2v: eMMC HS200 mode(1.2V I/O) is supported
>
> +Card power and reset control:
> +The following properties can be specified for cases where the MMC
> +peripheral needs additional reset, regulator and clock lines. It is for
> +example common for WiFi/BT adapters to have these separate from the main
> +MMC bus:
> + - card-reset-gpios: Specify GPIOs for card reset (reset active low)
That probably can use the reset frameworks bindings and the reset-gpio
driver Philipp Zabel has been working on.
> + - card-external-vcc-supply: Regulator to drive (independent) card VCC
> + - clock with name "card_ext_clock": External clock provided to the card
I'm not sure this is the right path.
This looks pretty harmless for now, but I'm pretty concerned that it's
just going to be an ever-increasing list of properties to deal with
the various corner-cases everyone has, like for example how to enforce
a given frequency for that card_ext_clock, or the fact that it has
several SDIO cards connected to them, each with different
clocks/reset/regulator lines.
While all of this would easily be solved by representing all this as a
bus, like it should, with subdevices grabbing their own clocks and
having whatever property they need.
Maxime
--
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-04-24 9:05 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-23 18:55 [PATCH 00/38] MMC updates, plus CuBox-i WiFi support Russell King - ARM Linux
2014-04-23 19:09 ` [PATCH 34/38] mmc: add support for power-on sequencing through DT Russell King
2014-04-24 9:05 ` Maxime Ripard [this message]
2014-04-23 19:09 ` [PATCH 38/38] ARM: cubox-i: add support for Wifi/BT Russell King
[not found] ` <20140423185534.GA26756-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2014-04-23 19:09 ` [PATCH 37/38] ARM: cubox-i: add support for SD UHS-1 cards Russell King
2014-04-24 8:25 ` [PATCH 00/38] MMC updates, plus CuBox-i WiFi support Ulf Hansson
2014-04-24 10:17 ` Russell King - ARM Linux
2014-04-24 10:52 ` Ulf Hansson
2014-04-24 10:57 ` Russell King - ARM Linux
[not found] ` <20140424105745.GM26756-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2014-04-24 11:13 ` Ulf Hansson
2014-04-25 9:03 ` Russell King - ARM Linux
2014-04-25 11:18 ` Ulf Hansson
[not found] ` <CAPDyKFpAiegwfh=kA8NyB+DdwKT=wSGJsB=gbEgLbyv0RJ2EOQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-25 11:20 ` Russell King - ARM Linux
2014-04-25 11:40 ` Ulf Hansson
2014-04-28 16:42 ` Stephen Warren
2014-04-28 16:52 ` Chris Ball
2014-05-07 20:49 ` Tim Kryger
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=20140424090551.GW24905@lukather \
--to=maxime.ripard@free-electrons.com \
--cc=chris@printf.net \
--cc=devicetree@vger.kernel.org \
--cc=galak@codeaurora.org \
--cc=ijc+devicetree@hellion.org.uk \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pawel.moll@arm.com \
--cc=rdunlap@infradead.org \
--cc=rmk+kernel@arm.linux.org.uk \
--cc=robh+dt@kernel.org \
--cc=ulf.hansson@linaro.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).