Andy Green wrote:
> Somebody in the thread at some point said:
> | The software stack I am working with assumes:
> |
> | 1) That the powerup of bluetooth is "1" and powerdown is "0".
> | 2) That reading back the value corresponds to the value, not opposite.
> | 3) No reset required.
>
> I can see we will break existing userspace assumptions if I apply this.
>
> I think it's better to do it your way, but how about you add a second
> sysfs node that has your semantics instead of changing behaviour of
> current one?  Leave them both active.

OK, actually I don't really need reset and we can just leave it as-is
and we should certainly leave that alone. If someone does a power_on and
then sets reset=0 there should be no change. Setting power_on, however,
would do a reset now. That would mess up existing behavior possibly, but
I think users just always do both. I have no aversion to either doing an
implicit reset on power_on or having a different name. Attached is a new
patch that doesn't change semantics of reset. If a new name is
necessary, do you have a preference? power_reset? enable?
> | The following patch does this. Plus I was wondering if there is
> | something else on LDO4. Can that regulator be reduced when not powering
> | bt? Is there any power savings doing so? I've knocked it down to 0 when
> | turning off and haven't seen any problems so far.
>
> It won't make trouble.

Great. Does it save any power, though? Seems like the regulator is
disabled when not used so probably not.

Sean

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 */
 

Reply via email to