blob: cc8696cb001cf3a3ecaf3f3902fdce86f0b52dc2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
diff -ruN hal-0.5.7-old/hald/linux2/osspec.c hal-0.5.7/hald/linux2/osspec.c
--- hal-0.5.7-old/hald/linux2/osspec.c 2006-02-13 17:42:32.000000000 +0100
+++ hal-0.5.7/hald/linux2/osspec.c 2006-03-01 11:56:20.000000000 +0100
@@ -447,6 +447,7 @@
unsigned int len;
char *poweroptions;
FILE *fp;
+ const char* pmtype = NULL;
can_suspend = FALSE;
can_hibernate = FALSE;
@@ -471,6 +472,16 @@
can_hibernate = TRUE;
free (poweroptions);
+ pmtype = hal_device_property_get_string(d,"power_management.type");
+ if (pmtype && !strcmp(pmtype, "pmu")) {
+ /* Although /sys/power/state exists on pmu based machines, using it just
+ * crashes mine. Suspending works via the pmu though. So overriding what we
+ * just saw...
+ * Should be removed as soon as /sys/power works on PMU */
+ can_hibernate = FALSE;
+ can_suspend = TRUE;
+ }
+
/* check for the presence of suspend2 */
if (access ("/proc/software_suspend", F_OK) == 0)
can_hibernate = TRUE;
|