mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Ludovic Desroches <ludovic.desroches@atmel.com>
Cc: Chris Ball <cjb@laptop.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Alexandre Belloni <alexandre.belloni@free-electrons.com>
Subject: [PATCHv2] mmc: atmel-mci: add vmmc-supply support
Date: Thu, 17 Oct 2013 00:19:59 +0200	[thread overview]
Message-ID: <1381961999-8187-1-git-send-email-alexandre.belloni@free-electrons.com> (raw)

Other MMC hosts handle a regulator named vmmc-supply that allows to power the
MMC card or SDIO device before communicating on the bus.

Signed-off-by: Alexandre Belloni <alexandre.belloni@free-electrons.com>
---

Changes in v2:
 - use mmc_regulator_get_supply instead of devm_regulator_get

 drivers/mmc/host/atmel-mci.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 69e438e..4ea5333 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -23,6 +23,7 @@
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/platform_device.h>
+#include <linux/regulator/consumer.h>
 #include <linux/scatterlist.h>
 #include <linux/seq_file.h>
 #include <linux/slab.h>
@@ -2198,6 +2199,14 @@ static int __init atmci_init_slot(struct atmel_mci *host,
 	host->slot[id] = slot;
 	mmc_add_host(mmc);
 
+	mmc_regulator_get_supply(mmc);
+	if (!IS_ERR(mmc->supply.vmmc)) {
+		int ret = regulator_enable(mmc->supply.vmmc);
+		if (ret)
+			dev_err(&mmc->class_dev,
+				"failed to enable regulator: %d\n", ret);
+	}
+
 	if (gpio_is_valid(slot->detect_pin)) {
 		int ret;
 
-- 
1.8.1.2


             reply	other threads:[~2013-10-16 22:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16 22:19 Alexandre Belloni [this message]
2013-10-17  8:34 ` Ulf Hansson
2013-10-17  8:59   ` Alexandre Belloni

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=1381961999-8187-1-git-send-email-alexandre.belloni@free-electrons.com \
    --to=alexandre.belloni@free-electrons.com \
    --cc=cjb@laptop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    /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

all inboxes | Powered by JetHome®