pandora-state: minor fixes
[openpandora.oe.git] / recipes / pandora-system / pandora-state / rc.pandora-state
index 637f0b1..149989e 100644 (file)
@@ -33,6 +33,8 @@ d_stop() {
        cat -v /proc/pandora/nub1/scrolly_sensitivity | sed -n '1p' >> /etc/pandora/conf/nubs.state
        cat -v /proc/pandora/nub1/scroll_rate | sed -n '1p' >> /etc/pandora/conf/nubs.state
        cat -v /proc/pandora/nub1/mbutton_threshold | sed -n '1p' >> /etc/pandora/conf/nubs.state
+       cat -v /proc/pandora/nub0/mbutton_delay | sed -n '1p' >> /etc/pandora/conf/nubs.state
+       cat -v /proc/pandora/nub1/mbutton_delay | sed -n '1p' >> /etc/pandora/conf/nubs.state
 }
 
 d_start() {
@@ -43,6 +45,11 @@ d_start() {
        fi
        cat /etc/pandora/conf/dirty_expire_centisecs >  /proc/sys/vm/dirty_expire_centisecs
        cat /etc/pandora/conf/gamma.state > $SYSFS_GAMMA
+       if [ -f /etc/pandora/conf/dssgamma.state ]; then
+               dssgamma=$(cat /etc/pandora/conf/dssgamma.state)
+               dssgamma2=$(echo "scale=2;$dssgamma / 100" | bc)
+               /usr/pandora/scripts/op_gamma.sh $dssgamma2
+       fi
        if [ -f /etc/pandora/conf/filter.state ]; then
                filter=$(cat /etc/pandora/conf/filter.state)
                /usr/pandora/scripts/op_videofir.sh $filter 
@@ -53,10 +60,11 @@ d_start() {
        if [ -f /etc/pandora/shutdown ]; then
              rm /etc/pandora/shutdown
              sync
-             echo $cpuspeed > /proc/pandora/cpu_mhz_max
+             /usr/pandora/scripts/op_cpuspeed.sh -n $cpuspeed
        else
              echo "No clean shutdown - will not set CPU speed"
-             touch /tmp/nocleanwarn
+             echo "Yes" > /tmp/nocleanwarn
+             chmod 777 /tmp/nocleanwarn
        fi
        sed -n '1p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mode
        sed -n '2p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mouse_sensitivity
@@ -70,10 +78,16 @@ d_start() {
        sed -n '10p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/scrolly_sensitivity
        sed -n '11p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/scroll_rate
        sed -n '12p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mbutton_threshold
+       sed -n '13p' /etc/pandora/conf/nubs.state > /proc/pandora/nub0/mbutton_delay
+       sed -n '14p' /etc/pandora/conf/nubs.state > /proc/pandora/nub1/mbutton_delay
        echo "Enabling ZRAM Swap"
-       modprobe zram
        mkswap /dev/zram0
        swapon -p 5 /dev/zram0
+
+       # set audio powerdown delay (ms)
+       if [ -e /sys/devices/platform/soc-audio/PCM1773/pmdown_time ]; then
+               echo 60000 > /sys/devices/platform/soc-audio/PCM1773/pmdown_time
+       fi
 }
 
 case "$1" in