[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-pm-utils
Subject:    Re: [Pm-utils] [PATCH] PMU and kernel >= 2.6.25
From:       "Michael Biebl" <mbiebl () gmail ! com>
Date:       2008-04-12 14:17:18
Message-ID: aa76cdac0804120717u5f76e14ek91472e6d4edc46c4 () mail ! gmail ! com
[Download RAW message or body]

2008/4/12, Michael Biebl <mbiebl@gmail.com>:
>  The attached patch tries to do that.

Argh, this time for real...

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?

["pmu.patch" (text/x-diff)]

diff --git a/pm/module.d/kernel b/pm/module.d/kernel
index cebcd98..a8dd892 100755
--- a/pm/module.d/kernel
+++ b/pm/module.d/kernel
@@ -2,16 +2,16 @@
 
 check_suspend()
 {
-	[ -c /dev/pmu ] && return 0
 	grep -q mem /sys/power/state && return 0
+	[ -c /dev/pmu ] && return 0
 }
 
 do_suspend()
 {
-	if [ -c /dev/pmu ]; then
-		pm-pmu --suspend
-	else
+	if greq -q mem /sys/power/state; then
 		echo -n "mem" > /sys/power/state
+	elif [ -c /dev/pmu ]; then
+		pm-pmu --suspend
 	fi
 }
 
diff --git a/pm/module.d/tuxonice b/pm/module.d/tuxonice
index e0c95aa..0f86765 100755
--- a/pm/module.d/tuxonice
+++ b/pm/module.d/tuxonice
@@ -13,16 +13,16 @@ done
 
 check_suspend()
 {
-	[ -c /dev/pmu ] && return 0
 	grep -q mem /sys/power/state && return 0
+	[ -c /dev/pmu ] && return 0
 }
 
 do_suspend()
 {
-	if [ -c /dev/pmu ]; then
-		pm-pmu --suspend
-	else
+	if greq -q mem /sys/power/state; then
 		echo -n "mem" > /sys/power/state
+	elif [ -c /dev/pmu ]; then
+		pm-pmu --suspend
 	fi
 }
 
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
index 8a5ee3b..274c54a 100755
--- a/pm/module.d/uswsusp
+++ b/pm/module.d/uswsusp
@@ -36,8 +36,8 @@ get_quirks()
 check_suspend()
 {
 	command_exists s2ram || return 1
-	[ -c /dev/pmu ] && return 0
 	grep -q mem /sys/power/state && return 0
+	[ -c /dev/pmu ] && return 0
 }
 
 do_suspend()


_______________________________________________
Pm-utils mailing list
Pm-utils@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pm-utils


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic