Skip to contentSkip to conversation

OMAP: mmc_twl4030 nicely disable vmmc_aux

PATCH In review Adrian Hunter 3 participants 3 messages Mar 24, 2009 – Mar 25, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 OMAP: mmc_twl4030 nicely disable vmmc_aux

Quoted 1 line

From 1a3f939d95122d8e58a3750cf5bce09247357203 Mon Sep 17 00:00:00 2001

From: Adrian Hunter <[email protected]>

The MMC driver turns the power off before it turns it on. To avoid regulator warnings, vmmc_aux must only be disabled if it has previously been enabled.

---
arch/arm/mach-omap2/mmc-twl4030.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +0 -0
index 2ff50f0..cb56fe2 100644
@@ -305,7 +305,7 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v
				ret = mmc_regulator_set_ocr(c->vcc, 0);
		}
	} else {
-		if (c->vcc_aux)
+		if (c->vcc_aux && (ret = regulator_is_enabled(c->vcc_aux)) > 0)
			ret = regulator_disable(c->vcc_aux);
		if (ret == 0)
			ret = mmc_regulator_set_ocr(c->vcc, 0);
Signature · 1 line
1.5.6.3
Acked-by on v1 1/1
#1 lore raw
Quoted 8 lines · Adrian Hunter
Quoted 1 line

From 1a3f939d95122d8e58a3750cf5bce09247357203 Mon Sep 17 00:00:00 2001

From: Adrian Hunter <[email protected]>

The MMC driver turns the power off before it turns it on. To avoid regulator warnings, vmmc_aux must only be disabled if it has previously been enabled.

good catch.

Quoted 21 lines
---
 arch/arm/mach-omap2/mmc-twl4030.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/mmc-twl4030.c +1 -1
index 2ff50f0..cb56fe2 100644
@@ -305,7 +305,7 @@ static int twl_mmc23_set_power(struct device *dev, int slot, int power_on, int v
 				ret = mmc_regulator_set_ocr(c->vcc, 0);
 		}
 	} else {
-		if (c->vcc_aux)
+		if (c->vcc_aux && (ret = regulator_is_enabled(c->vcc_aux)) > 0)
 			ret = regulator_disable(c->vcc_aux);
 		if (ret == 0)
 			ret = mmc_regulator_set_ocr(c->vcc, 0);
Signature · 1 line
1.5.6.3