op_power: Pandora does not go into suspend when charger is connected, instead it...
authorMichael Mrozek <EvilDragon@openpandora.de>
Fri, 27 Apr 2012 00:00:15 +0000 (02:00 +0200)
committerMichael Mrozek <EvilDragon@openpandora.de>
Fri, 27 Apr 2012 00:00:15 +0000 (02:00 +0200)
recipes/pandora-system/pandora-scripts/op_power.sh

index bb5e715..e5b5e61 100644 (file)
@@ -126,6 +126,13 @@ suspend_real() {
                return 1
        fi
 
+       current_now="$(cat /sys/class/power_supply/bq27500-0/current_now)"
+       if [ $current_now -gt 0 ]; then 
+               return 1 
+               #don't suspend while unit is charging
+       fi
+
        # can't suspend while SGX is in use due to bugs
        # (prevents low power states and potential lockup)
        if lsof -t /dev/pvrsrvkm > /dev/null; then