aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c24xx
diff options
context:
space:
mode:
authorAndy Green <andy@openmoko.com>2008-12-01 01:26:30 +0000
committerAndy Green <agreen@pads.home.warmcat.com>2008-12-01 01:26:30 +0000
commit3f5adf94526e33a9da8193d26a7d511820eb7f4d (patch)
treed8361752ab24587b4ded5afefc80f54709a1e2c5 /arch/arm/plat-s3c24xx
parent3feb1831a35d8e869f653b0a9eccd71ef9b1deb1 (diff)
fix-regulators-pm-bt-get-regulator-mutx-on-resume.patch
Signed-off-by: Andy Green <andy@openmoko.com>
Diffstat (limited to 'arch/arm/plat-s3c24xx')
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_bt.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
index df901a6c437..894651afc12 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_bt.c
@@ -76,9 +76,7 @@ static int bt_rfkill_toggle_radio(void *data, enum rfkill_state state)
{
struct device *dev = data;
unsigned long on = (state == RFKILL_STATE_ON);
- unsigned int vol;
struct gta01_pm_bt_data *bt_data;
- struct regulator *regulator;
if (machine_is_neo1973_gta01()) {
/* if we are powering up, assert reset, then power,
@@ -98,21 +96,17 @@ static int bt_rfkill_toggle_radio(void *data, enum rfkill_state state)
bt_data = dev_get_drvdata(dev);
BUG_ON(!bt_data || !bt_data->regulator);
- regulator = bt_data->regulator;
neo1973_gpb_setpin(GTA02_GPIO_BT_EN, !on);
if (on) {
- if (!regulator_is_enabled(regulator))
- regulator_enable(regulator);
+ if (!regulator_is_enabled(bt_data->regulator))
+ regulator_enable(bt_data->regulator);
} else {
- if (regulator_is_enabled(regulator))
- regulator_disable(regulator);
+ if (regulator_is_enabled(bt_data->regulator))
+ regulator_disable(bt_data->regulator);
}
- vol = regulator_get_voltage(regulator);
-
- dev_info(dev, "GTA02 Set PCF50633 LDO4 = %d\n", vol);
neo1973_gpb_setpin(GTA02_GPIO_BT_EN, on);
}
@@ -241,9 +235,16 @@ static int __init gta01_bt_probe(struct platform_device *pdev)
bt_data->regulator = regulator;
dev_set_drvdata(&pdev->dev, bt_data);
- /* we make sure that the voltage is off */
- if (regulator_is_enabled(regulator))
+ /* this tests the true physical state of the regulator... */
+ if (regulator_is_enabled(regulator)) {
+ /*
+ * but these only operate on the logical state of the
+ * regulator... so we need to logicaly "adopt" it on
+ * to turn it off
+ */
+ regulator_enable(regulator);
regulator_disable(regulator);
+ }
/* we pull reset to low to make sure that the chip doesn't
* drain power through the reset line */