summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorMichael Biebl <mbiebl@gmail.com>2008-03-16 19:01:59 +0100
committerMichael Biebl <mbiebl@gmail.com>2008-03-16 22:37:31 +0100
commitfe612997f9809777864ce859ad5ad47a02fb6dcb (patch)
tree1d6dcd95ca654f3a760dc5e8820c2a051f28c7cf /pm
parent4fe96950186e616db17767ce78690f7b82231a51 (diff)
Better PMU support.
- If /dev/pmu is existent, assume we can suspend - Don't try to run pm-pmu on machines without a PMU
Diffstat (limited to 'pm')
-rw-r--r--pm/module.d/kernel9
-rw-r--r--pm/module.d/tuxonice9
-rw-r--r--pm/module.d/uswsusp3
3 files changed, 16 insertions, 5 deletions
diff --git a/pm/module.d/kernel b/pm/module.d/kernel
index 5b3b501..21a5046 100644
--- a/pm/module.d/kernel
+++ b/pm/module.d/kernel
@@ -1,11 +1,16 @@
check_suspend()
{
- grep -q mem /sys/power/state
+ [ -e /dev/pmu ] && return 0
+ grep -q mem /sys/power/state && return 0
}
do_suspend()
{
- pm-pmu --suspend || echo -n "mem" > /sys/power/state
+ if [ -e /dev/pmu ]; then
+ pm-pmu --suspend
+ else
+ echo -n "mem" > /sys/power/state
+ fi
}
check_hibernate()
diff --git a/pm/module.d/tuxonice b/pm/module.d/tuxonice
index 79c50ac..d150126 100644
--- a/pm/module.d/tuxonice
+++ b/pm/module.d/tuxonice
@@ -11,12 +11,17 @@ done
check_suspend()
{
- grep -q mem /sys/power/state
+ [ -e /dev/pmu ] && return 0
+ grep -q mem /sys/power/state && return 0
}
do_suspend()
{
- echo "mem" >/sys/power/state
+ if [ -e /dev/pmu ]; then
+ pm-pmu --suspend
+ else
+ echo -n "mem" > /sys/power/state
+ fi
}
check_hibernate()
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
index c7f8e70..c16cf1b 100644
--- a/pm/module.d/uswsusp
+++ b/pm/module.d/uswsusp
@@ -6,7 +6,8 @@ before_hooks()
check_suspend()
{
- grep -q mem /sys/power/state
+ [ -e /dev/pmu ] && return 0
+ grep -q mem /sys/power/state && return 0
}
do_suspend()