From bbd01760afd1a08e0910e00cf0078edb39528481 Mon Sep 17 00:00:00 2001 From: Sean McNeil Date: Wed, 19 Nov 2008 17:11:01 +0000 Subject: fix-bt-cycle-power-around-regulator-voltage-change.patch 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 --- arch/arm/plat-s3c24xx/neo1973_pm_bt.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'arch') diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c index de0faf20d3b..3d4021cd794 100644 --- a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c +++ b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c @@ -111,15 +111,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 */ -- cgit v1.2.3