[PATCH] mmc: atmel-mci: add vmmc-supply support

From: Alexandre Belloni
Date: Wed Oct 16 2013 - 10:32:14 EST


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@xxxxxxxxxxxxxxxxxx>
---
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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/