[PATCH] GTA02: gps power management bugfix

Paul Fertser fercerpav at gmail.com
Mon Jun 8 07:52:04 CEST 2009

On Fri, Jun 05, 2009 at 10:17:13AM +0200, Michael Trimarchi wrote:
> Paul Fertser wrote:
>> 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.
>> -			if (!neo1973_gps.power_was_on)
>> +			if (!regulator_is_enabled(neo1973_gps.regulator[GTA02_GPS_REG_RF_3V]))
> Ok this force the power on, but why you don't force the power off? I  
> must take a look
> to the code.

Michael, the reason is simple: during suspend we disable GPS power but we
want to re-enable it after resume. For that we use power_was_on variable.
So a case when power_was_on is 1 and we need to actually turn on the power
is perfectly reasonable while power_was_on can be set to 0 only after
turning of the power, so it's consistent and no need to check if regulator
is enabled.

If it's desired i can resend the patch with this clarification added to
commit message.

Be free, use free (http://www.gnu.org/philosophy/free-sw.html) software!
mailto:fercerpav at gmail.com

More information about the openmoko-kernel mailing list