Home Home > GIT Browse > openSUSE-15.1
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2004-08-02 20:42:46 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2004-08-02 20:42:46 -0700
commitd8b2c519d45151edc6653e9d255996a51903a50a (patch)
tree6a2adec40154b7442dfb6c5ae8a00dea27d39355
parent7588ab9742b3ae0ecebcb32fca1374deda97e73f (diff)
[PATCH] ppc64: Start the FCU in therm_pm72.c
Some G5 recent powermacs start with the fan control unit (FCU) disabled, by the firmware, causing the thermal control driver to break. We have to enable it before starting the feedback loops that set the fan speeds. This patch adds the code to start the FCU. Signed-off-by: Paul Mackerras <paulus@samba.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r--drivers/macintosh/therm_pm72.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/macintosh/therm_pm72.c b/drivers/macintosh/therm_pm72.c
index fb2e0707bea3..32333f27d824 100644
--- a/drivers/macintosh/therm_pm72.c
+++ b/drivers/macintosh/therm_pm72.c
@@ -317,6 +317,20 @@ static int fan_write_reg(int reg, const unsigned char *ptr, int nb)
return nw;
}
+static int start_fcu(void)
+{
+ unsigned char buf = 0xff;
+ int rc;
+
+ rc = fan_write_reg(0xe, &buf, 1);
+ if (rc < 0)
+ return -EIO;
+ rc = fan_write_reg(0x2e, &buf, 1);
+ if (rc < 0)
+ return -EIO;
+ return 0;
+}
+
static int set_rpm_fan(int fan, int rpm)
{
unsigned char buf[2];
@@ -1011,6 +1025,12 @@ static int main_control_loop(void *x)
down(&driver_lock);
+ if (start_fcu() < 0) {
+ printk(KERN_ERR "kfand: failed to start FCU\n");
+ up(&driver_lock);
+ goto out;
+ }
+
/* Set the PCI fan once for now */
set_pwm_fan(SLOTS_FAN_PWM_ID, SLOTS_FAN_DEFAULT_PWM);
@@ -1057,6 +1077,7 @@ static int main_control_loop(void *x)
schedule_timeout(HZ - elapsed);
}
+ out:
DBG("main_control_loop ended\n");
ctrl_task = 0;