[PATCH 6/7] fix-bt-cycle-power-around-regulator-voltage-change.patch

Andy Green andy at openmoko.com
Tue Sep 23 01:17:45 CEST 2008


From: Sean McNeil <sean at mcneil.com>

Don't change bt regulator at all if already at requested state, and
turn it to opposite on | off state before changing regulator voltage
and setting final state.

Signed-off-by: Sean McNeil <sean at mcneil.com>
---

 arch/arm/plat-s3c24xx/neo1973_pm_bt.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
index dfc9ae8..e115d12 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
@@ -109,15 +109,17 @@ static ssize_t bt_write(struct device *dev, struct device_attribute *attr,
 
 #ifdef CONFIG_MACH_NEO1973_GTA02
 		case MACH_TYPE_NEO1973_GTA02:
-			neo1973_gpb_setpin(GTA02_GPIO_BT_EN, on ? 0 : 1);
-			if (on)
-				pcf50633_voltage_set(pcf50633_global,
-					PCF50633_REGULATOR_LDO4, 3200);
+			if (s3c2410_gpio_getpin(GTA02_GPIO_BT_EN) == on)
+				break;
+			neo1973_gpb_setpin(GTA02_GPIO_BT_EN, !on);
+			pcf50633_voltage_set(pcf50633_global,
+				PCF50633_REGULATOR_LDO4, on ? 3200 : 0);
 			pcf50633_onoff_set(pcf50633_global,
 				PCF50633_REGULATOR_LDO4, on);
 			vol = pcf50633_voltage_get(pcf50633_global,
 				PCF50633_REGULATOR_LDO4);
 			dev_info(dev, "GTA02 Set PCF50633 LDO4 = %d\n", vol);
+			neo1973_gpb_setpin(GTA02_GPIO_BT_EN, on);
 			break;
 #endif /* CONFIG_MACH_NEO1973_GTA02 */
 




More information about the openmoko-kernel mailing list