aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/macintosh/windfarm_core.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-29 11:42:27 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-04-30 01:37:25 -0400
commit6cd3209967469f6e89d329deda6bb0b4700e7b62 (patch)
tree35f099b364bf811b44fa11c7d71eaa7b22d264a1 /drivers/macintosh/windfarm_core.c
parenta78a4a03a75466ff859d989a1a00110ebd0165b0 (diff)
powerpc/powermac: New windfarm driver for PowerMac G5 (AGP) and Xserve G5
This replaces the old therm_pm72 using the same windfarm infrastructure that was used for other PowerMac G5 models. The fan speeds and sensors should now be visible in the same location in sysfs. The driver is split into separate core modules for PowerMac7,2 (and 7,3) and RackMac3,1, with a lot of the shared code now in the separate sensor and control modules. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/macintosh/windfarm_core.c')
-rw-r--r--drivers/macintosh/windfarm_core.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index ebafc2543d5..3ee198b6584 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -169,8 +169,11 @@ static ssize_t wf_show_control(struct device *dev,
169 int err; 169 int err;
170 170
171 err = ctrl->ops->get_value(ctrl, &val); 171 err = ctrl->ops->get_value(ctrl, &val);
172 if (err < 0) 172 if (err < 0) {
173 if (err == -EFAULT)
174 return sprintf(buf, "<HW FAULT>\n");
173 return err; 175 return err;
176 }
174 switch(ctrl->type) { 177 switch(ctrl->type) {
175 case WF_CONTROL_RPM_FAN: 178 case WF_CONTROL_RPM_FAN:
176 typestr = " RPM"; 179 typestr = " RPM";
@@ -481,11 +484,6 @@ static int __init windfarm_core_init(void)
481{ 484{
482 DBG("wf: core loaded\n"); 485 DBG("wf: core loaded\n");
483 486
484 /* Don't register on old machines that use therm_pm72 for now */
485 if (of_machine_is_compatible("PowerMac7,2") ||
486 of_machine_is_compatible("PowerMac7,3") ||
487 of_machine_is_compatible("RackMac3,1"))
488 return -ENODEV;
489 platform_device_register(&wf_platform_device); 487 platform_device_register(&wf_platform_device);
490 return 0; 488 return 0;
491} 489}