From: Grazvydas Ignotas Date: Sat, 27 Feb 2016 01:18:01 +0000 (+0200) Subject: pandora-scripts: BT suspend fix from urjaman X-Git-Tag: sz_174~6 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ae33c1defc1c0cefca873e2c3d50b4edcd32f39d;p=openpandora.oe.git pandora-scripts: BT suspend fix from urjaman --- diff --git a/recipes/pandora-system/pandora-scripts.bb b/recipes/pandora-system/pandora-scripts.bb index 5a4ca0a..d710285 100644 --- a/recipes/pandora-system/pandora-scripts.bb +++ b/recipes/pandora-system/pandora-scripts.bb @@ -5,7 +5,7 @@ COMPATIBLE_MACHINE = "omap3-pandora" RDEPENDS = "bash sed gawk grep zenity" -PR = "r165" +PR = "r166" SRC_URI = " \ file://op_bright.sh \ diff --git a/recipes/pandora-system/pandora-scripts/op_power.sh b/recipes/pandora-system/pandora-scripts/op_power.sh index 9b0e1b2..0401d07 100644 --- a/recipes/pandora-system/pandora-scripts/op_power.sh +++ b/recipes/pandora-system/pandora-scripts/op_power.sh @@ -25,13 +25,15 @@ fi debug && echo "powerstate=$powerstate" suspend_net() { - hcistate=$(hciconfig hci0 | grep DOWN) - if [ $hcistate ]; then - echo "down" > /tmp/hcistate + # This is kernel 3.x only, + # but ignored since 2.6 only has lowpower anyways (no suspend) + if (ps -A | grep -q hciattac[h]); then + touch /tmp/bt-state-up + /usr/pandora/scripts/op_bluetooth_work.sh 0 else - echo "up" > /tmp/hcistate - hciconfig hci0 down + rm -f /tmp/bt-state-up fi + wlstate=$(lsmod | grep -m1 wl1251) if [ -z "$wlstate" ]; then echo "down" > /tmp/wlstate @@ -44,8 +46,8 @@ suspend_net() { } resume_net() { - hcistate=$(cat /tmp/hcistate) - if [ "$hcistate" = "up" ]; then + if [ -f /tmp/bt-state-up ]; then + /usr/pandora/scripts/op_bluetooth_work.sh 1 hciconfig hci0 up pscan fi wlstate=$(cat /tmp/wlstate)