On 16 October 2013 16:32, Alexandre Belloni <alexandre.belloni@xxxxxxxxxxxxxxxxxx> wrote: > 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"); Use "mmc_regulator_get_supply" instead. This will also try to setup the "ocr_avail" mask, which is likely what you need as well. Kind regards Ulf Hansson > + 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-mmc" in > the body of a message to majordomo@xxxxxxxxxxxxxxx > More majordomo info at http://vger.kernel.org/majordomo-info.html -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html