Skip to contentSkip to conversation

mmc: mxs-mmc: enable regulator for mmc slot

PATCH New Shawn Guo 2 participants 3 messages Jun 26, 2012 – Jul 3, 2012

Subsystems (2)
lore
Share & tools
lore

Shawn Guo

author
#0 lore raw

PATCH 1/1 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.

---
 drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/mmc/host/mxs-mmc.c +11 -0
index 34a9026..1a29668 100644
@@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	struct pinctrl *pinctrl;
 	int ret = 0, irq_err, irq_dma;
 	dma_cap_mask_t mask;
+	struct regulator *reg_vmmc;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 	host->sdio_irq_en = 0;
 
+	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);
+			goto out_mmc_free;
+		}
+	}
+
 	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);
Signature · 1 line
1.7.5.4
author
#1 lore raw

PATCH 1/1 mmc: mxs-mmc: enable regulator for mmc slot

Hi Chris,

Ping.

Regards,
Shawn

Quoted 41 lines · Shawn Guo

If bootloader or platform initialization code does not enable the power supply to mmc slot, we need to do it in mmc driver.

---
 drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/mmc/host/mxs-mmc.c +11 -0
index 34a9026..1a29668 100644
@@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	struct pinctrl *pinctrl;
 	int ret = 0, irq_err, irq_dma;
 	dma_cap_mask_t mask;
+	struct regulator *reg_vmmc;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 	host->sdio_irq_en = 0;
 
+	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);
+			goto out_mmc_free;
+		}
+	}
+
 	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);
Signature · 1 line
1.7.5.4
#2 lore raw

PATCH 1/1 mmc: mxs-mmc: enable regulator for mmc slot

In reply to Shawn Guo

Hi,

Quoted 27 lines · Shawn Guo

If bootloader or platform initialization code does not enable the power supply to mmc slot, we need to do it in mmc driver.

---
 drivers/mmc/host/mxs-mmc.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
drivers/mmc/host/mxs-mmc.c +4 -0
index 34a9026..1a29668 100644
@@ -707,6 +707,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	struct pinctrl *pinctrl;
 	int ret = 0, irq_err, irq_dma;
 	dma_cap_mask_t mask;
+	struct regulator *reg_vmmc;
 
 	iores = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	dmares = platform_get_resource(pdev, IORESOURCE_DMA, 0);
@@ -747,6 +748,16 @@ static int mxs_mmc_probe(struct platform_device *pdev)
 	host->mmc = mmc;
 	host->sdio_irq_en = 0;
 
+	reg_vmmc = devm_regulator_get(&pdev->dev, "vmmc");
+	if (!IS_ERR(reg_vmmc)) {
+		ret = regulator_enable(reg_vmmc);

drivers/mmc/host/mxs-mmc.c static int mxs_mmc_probe(struct platform_device *pdev) · line 763

Quoted 10 lines
drivers/mmc/host/mxs-mmc.c +7 -0
+		if (ret) {
+			dev_err(&pdev->dev,
+				"Failed to enable vmmc regulator: %d\n", ret);
+			goto out_mmc_free;
+		}
+	}
+
 	pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
 	if (IS_ERR(pinctrl)) {
 		ret = PTR_ERR(pinctrl);

Thanks, pushed to mmc-next for 3.6.

- Chris.

Signature · 2 lines
Chris Ball   <[email protected]>   <http://printf.net/>
One Laptop Per Child