[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1381933924-32437-1-git-send-email-alexandre.belloni@free-electrons.com>
Date: Wed, 16 Oct 2013 16:32:04 +0200
From: Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To: Ludovic Desroches <ludovic.desroches@...el.com>
Cc: Chris Ball <cjb@...top.org>, linux-mmc@...r.kernel.org,
linux-kernel@...r.kernel.org,
Alexandre Belloni <alexandre.belloni@...e-electrons.com>
Subject: [PATCH] mmc: atmel-mci: add vmmc-supply support
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@...e-electrons.com>
---
drivers/mmc/host/atmel-mci.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 69e438e..deffa1f 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>
@@ -2355,6 +2356,7 @@ static int __init atmci_probe(struct platform_device *pdev)
struct mci_platform_data *pdata;
struct atmel_mci *host;
struct resource *regs;
+ struct regulator *reg_vmmc;
unsigned int nr_slots;
int irq;
int ret;
@@ -2371,6 +2373,16 @@ static int __init atmci_probe(struct platform_device *pdev)
}
}
+ reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
+ if (!IS_ERR(reg_vmmc)) {
+ ret = regulator_enable(reg_vmmc);
+ if (ret) {
+ dev_err(&pdev->dev,
+ "Failed to enable vmmc regulator: %d\n", ret);
+ return ret;
+ }
+ }
+
irq = platform_get_irq(pdev, 0);
if (irq < 0)
return irq;
--
1.8.1.2
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists