aboutsummaryrefslogtreecommitdiff
path: root/arch/arm/plat-s3c24xx
diff options
context:
space:
mode:
authorVladimir Koutny <vlado@moko.ksp.sk>2009-01-21 20:02:05 +0000
committerAndy Green <agreen@octopus.localdomain>2009-01-21 20:02:05 +0000
commit19104094f6dcc618fdc930cad1dc4ab0c70dff00 (patch)
tree75add6c90cc86059baa7b5da8c33a502fa7952f3 /arch/arm/plat-s3c24xx
parent6e3120ce2316eed2be656ae43010d52c478741a3 (diff)
fix GPS resume if powered on previously
Fix re-enabling of GPS on resume The call to gps_pwron_set(0) during suspend would clear power_was_on flag so the on/off status was always lost. Additionally when enabling/ disabling the regulator check its actual state, not power_was_on flag (they don't match on resume). Signed-off-by: Vladimir Koutny <vlado@ksp.sk>
Diffstat (limited to 'arch/arm/plat-s3c24xx')
-rw-r--r--arch/arm/plat-s3c24xx/neo1973_pm_gps.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
index 4d3f52d6fdd..4e48eb24def 100644
--- a/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
+++ b/arch/arm/plat-s3c24xx/neo1973_pm_gps.c
@@ -295,14 +295,12 @@ static void gps_pwron_set(int on)
/* don't let RX from unpowered GPS float */
s3c2410_gpio_pullup(S3C2410_GPH5, 1);
}
- if (on && !neo1973_gps.power_was_on)
+ if (on && !regulator_is_enabled(neo1973_gps.regulator))
regulator_enable(neo1973_gps.regulator);
- if (!on && neo1973_gps.power_was_on)
+ if (!on && regulator_is_enabled(neo1973_gps.regulator))
regulator_disable(neo1973_gps.regulator);
}
-
- neo1973_gps.power_was_on = !!on;
}
static int gps_pwron_get(void)
@@ -358,6 +356,7 @@ static ssize_t power_gps_write(struct device *dev,
if (!strcmp(attr->attr.name, "power_on")) {
gps_pwron_set(on);
+ neo1973_gps.power_was_on = !!on;
#ifdef CONFIG_MACH_NEO1973_GTA01
} else if (!strcmp(attr->attr.name, "power_avdd_3v")) {
gps_power_3v_set(on);