From c8a29c8fb45c47363ee48ee2dfd009b6b60b8e69 Mon Sep 17 00:00:00 2001 From: Michael Mrozek Date: Wed, 23 Feb 2011 00:31:58 +0100 Subject: [PATCH] op_power.sh: Fixed a bug which crashed the script when going to low-power mode while connected to WLAN network --- recipes/pandora-system/pandora-scripts/op_power.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/recipes/pandora-system/pandora-scripts/op_power.sh b/recipes/pandora-system/pandora-scripts/op_power.sh index aabc8bd..bc87602 100644 --- a/recipes/pandora-system/pandora-scripts/op_power.sh +++ b/recipes/pandora-system/pandora-scripts/op_power.sh @@ -9,7 +9,7 @@ if [ "$1" -le "2" ]; then # button was pressed 1-2sec, "suspend" powerstate=0 fi if [ $powerstate -eq "1" ]; then - #in lowpower mode + #switch from lowpower to normal mode oldspeed=$(cat /tmp/oldspeed) /usr/pandora/scripts/op_cpuspeed.sh $oldspeed echo 0 > /tmp/powerstate @@ -25,7 +25,7 @@ if [ "$1" -le "2" ]; then # button was pressed 1-2sec, "suspend" fi hcistate=$(cat /tmp/hcistate) if [ ! $hcistate ]; then - hciconfig hci0 up + hciconfig hci0 up pscan fi wlstate=$(cat /tmp/wlstate) if [ ! $wlstate ]; then @@ -39,7 +39,7 @@ if [ "$1" -le "2" ]; then # button was pressed 1-2sec, "suspend" echo 255 > /sys/class/leds/pandora\:\:power/brightness #power LED bright rm /tmp/powerstate else - #in normal mode + #switch from normal to lowpower mode echo 1 > /tmp/powerstate cat /proc/pandora/cpu_mhz_max > /tmp/oldspeed cat /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness > /tmp/oldbright @@ -60,7 +60,8 @@ if [ "$1" -le "2" ]; then # button was pressed 1-2sec, "suspend" if [ ! $wlstate ]; then echo "down" > /tmp/wlstate else - /etc/init.d/wl1251-init stop + ifconfig wlan0 down + rmmod board_omap3pandora_wifi wl1251_sdio wl1251 fi echo 0 > /sys/devices/platform/twl4030-pwm0-bl/backlight/twl4030-pwm0-bl/brightness echo 1 > /sys/devices/platform/omapfb/graphics/fb0/blank -- 2.39.2