From: Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org>
To: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: sdhci-tegra and power-gpios
Date: Mon, 01 Oct 2012 11:15:29 -0400 [thread overview]
Message-ID: <87vceunrzi.fsf@octavius.laptop.org> (raw)
Hi Stephen, tegra folks,
sdhci-tegra uses a power-gpios property in the DT:
sdhci@c8000400 {
status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
power-gpios = <&gpio 70 0>; /* gpio PI6 */
bus-width = <4>;
};
which it turns on at probe-time in the driver:
plat->power_gpio = of_get_named_gpio(np, "power-gpios", 0);
...
if (gpio_is_valid(plat->power_gpio)) {
rc = gpio_request(plat->power_gpio, "sdhci_power");
if (rc) {
dev_err(mmc_dev(host->mmc),
"failed to allocate power gpio\n");
goto err_power_req;
}
gpio_direction_output(plat->power_gpio, 1);
}
and then leaves on forever. Seems like this should instead be a fixed
regulator (vmmc-supply) -- the MMC core would handle powering it up and
down as needed, and it's cleaner to let the regulator subsystem handle
power changes like this. It might save you some power, too.
It's quite easy to set up a regulator and attach it to an MMC node:
vmmc1: fixedregulator@0 {
compatible = "regulator-fixed";
regulator-name = "fixed-supply";
regulator-min-microvolt = <2200000>;
regulator-max-microvolt = <2200000>;
gpio = <&gpio 70 0>; /* gpio PI6 */
startup-delay-us = <70000>;
vin-supply = <&parent_reg>;
};
..
sdhci@c8000400 {
status = "okay";
cd-gpios = <&gpio 69 0>; /* gpio PI5 */
wp-gpios = <&gpio 57 0>; /* gpio PH1 */
vmmc-supply = <&vmmc1>;
bus-width = <4>;
};
Any interest in making this change? I've asked other drivers
(sdhci-pxav3 and sdhci-spear) to do the same thing (although
they hadn't merged their use of power-gpios yet and tegra has).
Thanks,
- Chris.
--
Chris Ball <cjb-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org> <http://printf.net/>
One Laptop Per Child
next reply other threads:[~2012-10-01 15:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-01 15:15 Chris Ball [this message]
[not found] ` <87vceunrzi.fsf-DGHOrqG7t0YzNDMTQreKSUB+6BGkLq7r@public.gmane.org>
2012-10-01 16:05 ` sdhci-tegra and power-gpios Stephen Warren
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=87vceunrzi.fsf@octavius.laptop.org \
--to=cjb-2x9k7bc8m7mdnm+yrofe0a@public.gmane.org \
--cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.