op_power.sh: Changed the script so it uses op_cpuspeed.sh for setting
authorMichael Mrozek <EvilDragon@openpandora.de>
Wed, 9 Feb 2011 00:15:46 +0000 (01:15 +0100)
committerMichael Mrozek <EvilDragon@openpandora.de>
Wed, 9 Feb 2011 00:15:46 +0000 (01:15 +0100)
the CPU speed (system conform)

testdata/scripts/op_power.sh

index b5ce213..aabc8bd 100755 (executable)
@@ -11,11 +11,7 @@ if [ "$1" -le "2" ]; then # button was pressed 1-2sec, "suspend"
   if [ $powerstate -eq "1" ]; then
     #in lowpower mode
     oldspeed=$(cat /tmp/oldspeed)
-    if [ $oldspeed -gt 14 ] && [ $oldspeed -le 900 ]; then 
-     echo $oldspeed > /proc/pandora/cpu_mhz_max 
-    else
-      echo 500 > /proc/pandora/cpu_mhz_max
-    fi
+    /usr/pandora/scripts/op_cpuspeed.sh $oldspeed
     echo 0 > /tmp/powerstate
     oldbright=$(cat /tmp/oldbright)
     maxbright=$(cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/max_brightness)
@@ -69,7 +65,7 @@ if [ "$1" -le "2" ]; then # button was pressed 1-2sec, "suspend"
     echo 0 > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness
     echo 1 > /sys/devices/platform/omapfb/graphics/fb0/blank
     echo 16 > /sys/class/leds/pandora\:\:power/brightness #dim power LED
-    echo 125 > /proc/pandora/cpu_mhz_max
+    /usr/pandora/scripts/op_cpuspeed.sh 125
   fi
 elif [ "$1" -ge "3" ]; then #button was pressed 3 sec or longer, shutdown
   xfceuser=$(ps u -C xfce4-session | tail -n1 | awk '{print $1}')