GTA02: gps power management bugfix
authorPaul Fertser <fercerpav@gmail.com>
Fri, 5 Jun 2009 07:11:04 +0000 (11:11 +0400)
committerNelson Castillo <arhuaco@freaks-unidos.net>
Tue, 9 Jun 2009 11:09:02 +0000 (08:09 -0300)
After suspending with GPS powered on power_on sysfs node reports 0 and GPS
is actually unpowered but "echo 1 > power_on" has no effect. This patch
fixes it.

Reported and analised by Timo Juhani Lindfors <timo.lindfors@iki.fi>,
ticket #2293.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
arch/arm/plat-s3c24xx/neo1973_pm_gps.c

index 93b4911..b59d495 100644 (file)
@@ -305,7 +305,8 @@ static void gps_pwron_set(int on)
                        /* remove pulldown now it won't be floating any more */
                        s3c2410_gpio_pullup(S3C2410_GPH5, 0);
 
-                       if (!neo1973_gps.power_was_on)
+                       if (!regulator_is_enabled(neo1973_gps.regulator[
+                                                         GTA02_GPS_REG_RF_3V]))
                                regulator_enable(neo1973_gps.regulator[
                                                          GTA02_GPS_REG_RF_3V]);
                        return;