Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 80ff974d authored by Étienne Bersac's avatar Étienne Bersac Committed by Paul Mackerras
Browse files

[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: default avatarÉtienne Bersac <bersace@gmail.com>
Signed-off-by: default avatarDavid Woodhouse <dwmw2@infradead.org>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
parent 21e38dfe
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -696,6 +696,7 @@ CONFIG_WINDFARM=y
CONFIG_WINDFARM_PM81=y
CONFIG_WINDFARM_PM81=y
CONFIG_WINDFARM_PM91=y
CONFIG_WINDFARM_PM91=y
CONFIG_WINDFARM_PM112=y
CONFIG_WINDFARM_PM112=y
CONFIG_WINDFARM_PM121=y
# CONFIG_PMAC_RACKMETER is not set
# CONFIG_PMAC_RACKMETER is not set
CONFIG_NETDEVICES=y
CONFIG_NETDEVICES=y
# CONFIG_NETDEVICES_MULTIQUEUE is not set
# CONFIG_NETDEVICES_MULTIQUEUE is not set
+8 −0
Original line number Original line Diff line number Diff line
@@ -234,6 +234,14 @@ config WINDFARM_PM112
	  which are the recent dual and quad G5 machines using the
	  which are the recent dual and quad G5 machines using the
	  970MP dual-core processor.
	  970MP dual-core processor.


config WINDFARM_PM121
	tristate "Support for thermal management on PowerMac12,1"
	depends on WINDFARM && I2C && PMAC_SMU
	select I2C_POWERMAC
	help
	  This driver provides thermal control for the PowerMac12,1
	  which is the iMac G5 (iSight).

config ANSLCD
config ANSLCD
	tristate "Support for ANS LCD display"
	tristate "Support for ANS LCD display"
	depends on ADB_CUDA && PPC_PMAC
	depends on ADB_CUDA && PPC_PMAC
+5 −0
Original line number Original line Diff line number Diff line
@@ -42,4 +42,9 @@ obj-$(CONFIG_WINDFARM_PM112) += windfarm_pm112.o windfarm_smu_sat.o \
				   windfarm_smu_sensors.o \
				   windfarm_smu_sensors.o \
				   windfarm_max6690_sensor.o \
				   windfarm_max6690_sensor.o \
				   windfarm_lm75_sensor.o windfarm_pid.o
				   windfarm_lm75_sensor.o windfarm_pid.o
obj-$(CONFIG_WINDFARM_PM121)	+= windfarm_pm121.o windfarm_smu_sat.o \
				   windfarm_smu_controls.o \
				   windfarm_smu_sensors.o \
				   windfarm_max6690_sensor.o \
				   windfarm_lm75_sensor.o windfarm_pid.o
obj-$(CONFIG_PMAC_RACKMETER)	+= rack-meter.o
obj-$(CONFIG_PMAC_RACKMETER)	+= rack-meter.o
+6 −0
Original line number Original line Diff line number Diff line
@@ -127,6 +127,12 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter,
	 */
	 */
	if (!strcmp(loc, "Hard drive") || !strcmp(loc, "DRIVE BAY"))
	if (!strcmp(loc, "Hard drive") || !strcmp(loc, "DRIVE BAY"))
		lm->sens.name = "hd-temp";
		lm->sens.name = "hd-temp";
	else if (!strcmp(loc, "Incoming Air Temp"))
		lm->sens.name = "incoming-air-temp";
	else if (!strcmp(loc, "ODD Temp"))
		lm->sens.name = "optical-drive-temp";
	else if (!strcmp(loc, "HD Temp"))
		lm->sens.name = "hard-drive-temp";
	else
	else
		goto fail;
		goto fail;


+14 −6
Original line number Original line Diff line number Diff line
@@ -77,18 +77,28 @@ static struct wf_sensor_ops wf_max6690_ops = {
	.owner		= THIS_MODULE,
	.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;
	struct wf_6690_sensor *max;
	char *name = "backside-temp";
	char *name;


	max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
	max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL);
	if (max == NULL) {
	if (max == NULL) {
		printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: "
		printk(KERN_ERR "windfarm: Couldn't create MAX6690 sensor %s: "
		       "no memory\n", name);
		       "no memory\n", loc);
		return;
		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.ops = &wf_max6690_ops;
	max->sens.name = name;
	max->sens.name = name;
	max->i2c.addr = addr >> 1;
	max->i2c.addr = addr >> 1;
@@ -138,9 +148,7 @@ static int wf_max6690_attach(struct i2c_adapter *adapter)
		if (loc == NULL || addr == 0)
		if (loc == NULL || addr == 0)
			continue;
			continue;
		printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
		printk("found max6690, loc=%s addr=0x%02x\n", loc, addr);
		if (strcmp(loc, "BACKSIDE"))
		wf_max6690_create(adapter, addr, loc);
			continue;
		wf_max6690_create(adapter, addr);
	}
	}


	return 0;
	return 0;
Loading