]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Mac swsusp driver fixes
authorGuido Guenther <agx@sigxcpu.org>
Mon, 18 Oct 2004 16:04:03 +0000 (09:04 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 18 Oct 2004 16:04:03 +0000 (09:04 -0700)
Allow swsusp work with macintosh's own thermal sensor drivers enabled.

Contributions from Nathan Hand <nathanh@manu.com.au>

Signed-Of-By: Guido Guenther <agx@sigcpu.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/macintosh/therm_adt746x.c
drivers/macintosh/therm_pm72.c

index 8feba38461a257c72a666f6c66eb4a81b9ba5317..fce84d29b799b27d7c874d9e31f33810cb8dff82 100644 (file)
@@ -22,6 +22,7 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/wait.h>
+#include <linux/suspend.h>
 #include <asm/prom.h>
 #include <asm/machdep.h>
 #include <asm/io.h>
@@ -236,8 +237,10 @@ static int monitor_task(void *arg)
 #ifdef DEBUG
        int mfan_speed;
 #endif
-       while(!kthread_should_stop())
-       {
+       while(!kthread_should_stop()) {
+               if (current->flags & PF_FREEZE)
+                       refrigerator(PF_FREEZE);
+
                msleep_interruptible(2000);
 
                /* Check status */
index 32333f27d824d27f91144115268ef9e0a65cf9e7..d25e45312c4ee1119b6cb76c850c0d7c06cc3679 100644 (file)
@@ -88,6 +88,7 @@
 #include <linux/spinlock.h>
 #include <linux/smp_lock.h>
 #include <linux/wait.h>
+#include <linux/suspend.h>
 #include <linux/reboot.h>
 #include <linux/kmod.h>
 #include <linux/i2c.h>
@@ -1044,6 +1045,11 @@ static int main_control_loop(void *x)
        while (state == state_attached) {
                unsigned long elapsed, start;
 
+               if (current->flags & PF_FREEZE) {
+                       printk(KERN_INFO "therm_pm72: freezing thermostat\n");
+                       refrigerator(PF_FREEZE);
+               }
+
                start = jiffies;
 
                down(&driver_lock);