Skip to content

Commit 80ff974

Browse files
bersacepaulusmack
authored andcommitted
[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>
1 parent 21e38df commit 80ff974

7 files changed

Lines changed: 1078 additions & 6 deletions

File tree

‎arch/powerpc/configs/g5_defconfig‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -696,6 +696,7 @@ CONFIG_WINDFARM=y
696696
CONFIG_WINDFARM_PM81=y
697697
CONFIG_WINDFARM_PM91=y
698698
CONFIG_WINDFARM_PM112=y
699+
CONFIG_WINDFARM_PM121=y
699700
# CONFIG_PMAC_RACKMETER is not set
700701
CONFIG_NETDEVICES=y
701702
# CONFIG_NETDEVICES_MULTIQUEUE is not set

‎drivers/macintosh/Kconfig‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,14 @@ config WINDFARM_PM112
234234
which are the recent dual and quad G5 machines using the
235235
970MP dual-core processor.
236236

237+
config WINDFARM_PM121
238+
tristate "Support for thermal management on PowerMac12,1"
239+
depends on WINDFARM && I2C && PMAC_SMU
240+
select I2C_POWERMAC
241+
help
242+
This driver provides thermal control for the PowerMac12,1
243+
which is the iMac G5 (iSight).
244+
237245
config ANSLCD
238246
tristate "Support for ANS LCD display"
239247
depends on ADB_CUDA && PPC_PMAC

‎drivers/macintosh/Makefile‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ obj-$(CONFIG_WINDFARM_PM112) += windfarm_pm112.o windfarm_smu_sat.o \
4242
windfarm_smu_sensors.o \
4343
windfarm_max6690_sensor.o \
4444
windfarm_lm75_sensor.o windfarm_pid.o
45+
obj-$(CONFIG_WINDFARM_PM121) += windfarm_pm121.o windfarm_smu_sat.o \
46+
windfarm_smu_controls.o \
47+
windfarm_smu_sensors.o \
48+
windfarm_max6690_sensor.o \
49+
windfarm_lm75_sensor.o windfarm_pid.o
4550
obj-$(CONFIG_PMAC_RACKMETER) += rack-meter.o

‎drivers/macintosh/windfarm_lm75_sensor.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
127127
*/
128128
if (!strcmp(loc, "Hard drive") || !strcmp(loc, "DRIVE BAY"))
129129
lm->sens.name = "hd-temp";
130+
else if (!strcmp(loc, "Incoming Air Temp"))
131+
lm->sens.name = "incoming-air-temp";
132+
else if (!strcmp(loc, "ODD Temp"))
133+
lm->sens.name = "optical-drive-temp";
134+
else if (!strcmp(loc, "HD Temp"))
135+
lm->sens.name = "hard-drive-temp";
130136
else
131137
goto fail;
132138

‎drivers/macintosh/windfarm_max6690_sensor.c‎

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,18 +77,28 @@ static struct wf_sensor_ops wf_max6690_ops = {
7777
.owner = THIS_MODULE,
7878
};
7979

80-
static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr)
80+
static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr,
81+
const char *loc)
8182
{
8283
struct wf_6690_sensor *max;
83-
char *name = "backside-temp";
84+
char *name;
8485

8586
max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
8687
if (max == NULL) {
8788
printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: "
88-
"no memory\n", name);
89+
"no memory\n", loc);
8990
return;
9091
}
9192

93+
if (!strcmp(loc, "BACKSIDE"))
94+
name = "backside-temp";
95+
else if (!strcmp(loc, "NB Ambient"))
96+
name = "north-bridge-temp";
97+
else if (!strcmp(loc, "GPU Ambient"))
98+
name = "gpu-temp";
99+
else
100+
goto fail;
101+
92102
max->sens.ops = &wf_max6690_ops;
93103
max->sens.name = name;
94104
max->i2c.addr = addr >> 1;
@@ -138,9 +148,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
138148
if (loc == NULL || addr == 0)
139149
continue;
140150
printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
141-
if (strcmp(loc, "BACKSIDE"))
142-
continue;
143-
wf_max6690_create(adapter, addr);
151+
wf_max6690_create(adapter, addr, loc);
144152
}
145153

146154
return 0;

0 commit comments

Comments
 (0)