diff options
author | Shawn Guo <shawn.guo@linaro.org> | 2012-06-26 04:38:57 -0400 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-07-22 15:25:35 -0400 |
commit | 4dc5a79f1350718ac31e4ab87eebce112b117a34 (patch) | |
tree | 85f02a2db2ed28aadba76357e9127bd49ab13952 /drivers/mmc/host/mxs-mmc.c | |
parent | b63b5e819d5b21ae493c17c356018ffa98d3ee1c (diff) |
mmc: mxs-mmc: enable regulator for mmc slot
If bootloader or platform initialization code does not enable the
power supply to mmc slot, we need to do it in mmc driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'drivers/mmc/host/mxs-mmc.c')
-rw-r--r-- | drivers/mmc/host/mxs-mmc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c index 277161d279b8..2247c50f9869 100644 --- a/drivers/mmc/host/mxs-mmc.c +++ b/drivers/mmc/host/mxs-mmc.c | |||
@@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev) | |||
707 | struct pinctrl *pinctrl; | 707 | struct pinctrl *pinctrl; |
708 | int ret = 0, irq_err, irq_dma; | 708 | int ret = 0, irq_err, irq_dma; |
709 | dma_cap_mask_t mask; | 709 | dma_cap_mask_t mask; |
710 | struct regulator *reg_vmmc; | ||
710 | 711 | ||
711 | iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 712 | iores = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
712 | dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); | 713 | dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0); |
@@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev) | |||
747 | host->mmc = mmc; | 748 | host->mmc = mmc; |
748 | host->sdio_irq_en = 0; | 749 | host->sdio_irq_en = 0; |
749 | 750 | ||
751 | reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc"); | ||
752 | if (!IS_ERR(reg_vmmc)) { | ||
753 | ret = regulator_enable(reg_vmmc); | ||
754 | if (ret) { | ||
755 | dev_err(&pdev->dev, | ||
756 | "Failed to enable vmmc regulator: %d\n", ret); | ||
757 | goto out_mmc_free; | ||
758 | } | ||
759 | } | ||
760 | |||
750 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); | 761 | pinctrl = devm_pinctrl_get_select_default(&pdev->dev); |
751 | if (IS_ERR(pinctrl)) { | 762 | if (IS_ERR(pinctrl)) { |
752 | ret = PTR_ERR(pinctrl); | 763 | ret = PTR_ERR(pinctrl); |