From b70f4e19be985fe8ab969771a9b15742fe5b9c88 Mon Sep 17 00:00:00 2001 From: Guido Guenther Date: Mon, 18 Oct 2004 09:04:03 -0700 Subject: [PATCH] [PATCH] Mac swsusp driver fixes Allow swsusp work with macintosh's own thermal sensor drivers enabled. Contributions from Nathan Hand Signed-Of-By: Guido Guenther Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/macintosh/therm_adt746x.c | 7 +++++-- drivers/macintosh/therm_pm72.c | 6 ++++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/macintosh/therm_adt746x.c b/drivers/macintosh/therm_adt746x.c index 8feba38461a25..fce84d29b799b 100644 --- a/drivers/macintosh/therm_adt746x.c +++ b/drivers/macintosh/therm_adt746x.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -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 */ diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c index 32333f27d824d..d25e45312c4ee 100644 --- a/drivers/macintosh/therm_pm72.c +++ b/drivers/macintosh/therm_pm72.c @@ -88,6 +88,7 @@ #include #include #include +#include #include #include #include @@ -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); -- 2.53.0