[POWERPC] windfarm: Add PowerMac 12,1 support
This implements a new driver named windfarm_pm121, which drives the fans on PowerMac 12,1 machines : iMac G5 iSight (rev C) 17" and 20". It's based on the windfarm_pm81 driver from Benjamin Herrenschmidt. This includes fixes from David Woodhouse correcting the names of some of the sensors. Signed-off-by: Étienne Bersac <bersace@gmail.com> Signed-off-by: David Woodhouse <dwmw2@infradead.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Paul Mackerras <paulus@samba.org>
This commit is contained in:

committed by
Paul Mackerras

parent
21e38dfee5
commit
80ff974dba
@@ -77,18 +77,28 @@ static struct wf_sensor_ops wf_max6690_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr)
|
||||
static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr,
|
||||
const char *loc)
|
||||
{
|
||||
struct wf_6690_sensor *max;
|
||||
char *name = "backside-temp";
|
||||
char *name;
|
||||
|
||||
max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
|
||||
if (max == NULL) {
|
||||
printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: "
|
||||
"no memory\n", name);
|
||||
"no memory\n", loc);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!strcmp(loc, "BACKSIDE"))
|
||||
name = "backside-temp";
|
||||
else if (!strcmp(loc, "NB Ambient"))
|
||||
name = "north-bridge-temp";
|
||||
else if (!strcmp(loc, "GPU Ambient"))
|
||||
name = "gpu-temp";
|
||||
else
|
||||
goto fail;
|
||||
|
||||
max->sens.ops = &wf_max6690_ops;
|
||||
max->sens.name = name;
|
||||
max->i2c.addr = addr >> 1;
|
||||
@@ -138,9 +148,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
|
||||
if (loc == NULL || addr == 0)
|
||||
continue;
|
||||
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
|
||||
if (strcmp(loc, "BACKSIDE"))
|
||||
continue;
|
||||
wf_max6690_create(adapter, addr);
|
||||
wf_max6690_create(adapter, addr, loc);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user