powerpc/windfarm: Updates to lm75 and max6690 sensors

This allows those modules to load on PowerMac7,2 PowerMac7,3
and RackMac3,1 and add the sensor name conversion for those
machines.

This will be used by the corresponding new windfarm modules
for those machines.

Note that since therm_pm72 is linked first, it will still
take priority on those i2c devices if built-in. If using modules
it will depend which is loaded first, but you should avoid building
therm_pm72 if you are using the new windfarm drivers
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 08fe5bc7
...@@ -116,6 +116,12 @@ static int wf_lm75_probe(struct i2c_client *client, ...@@ -116,6 +116,12 @@ static int wf_lm75_probe(struct i2c_client *client,
name = "optical-drive-temp"; name = "optical-drive-temp";
else if (!strcmp(loc, "HD Temp")) else if (!strcmp(loc, "HD Temp"))
name = "hard-drive-temp"; name = "hard-drive-temp";
else if (!strcmp(loc, "PCI SLOTS"))
name = "slots-temp";
else if (!strcmp(loc, "CPU A INLET"))
name = "cpu-inlet-temp-0";
else if (!strcmp(loc, "CPU B INLET"))
name = "cpu-inlet-temp-1";
else else
return -ENXIO; return -ENXIO;
...@@ -170,11 +176,6 @@ static struct i2c_driver wf_lm75_driver = { ...@@ -170,11 +176,6 @@ static struct i2c_driver wf_lm75_driver = {
static int __init wf_lm75_sensor_init(void) static int __init wf_lm75_sensor_init(void)
{ {
/* Don't register on old machines that use therm_pm72 for now */
if (of_machine_is_compatible("PowerMac7,2") ||
of_machine_is_compatible("PowerMac7,3") ||
of_machine_is_compatible("RackMac3,1"))
return -ENODEV;
return i2c_add_driver(&wf_lm75_driver); return i2c_add_driver(&wf_lm75_driver);
} }
......
...@@ -74,7 +74,11 @@ static int wf_max6690_probe(struct i2c_client *client, ...@@ -74,7 +74,11 @@ static int wf_max6690_probe(struct i2c_client *client,
return -ENXIO; return -ENXIO;
} }
if (!strcmp(loc, "BACKSIDE")) /*
* We only expose the external temperature register for
* now as this is all we need for our control loops
*/
if (!strcmp(loc, "BACKSIDE") || !strcmp(loc, "SYS CTRLR AMBIENT"))
name = "backside-temp"; name = "backside-temp";
else if (!strcmp(loc, "NB Ambient")) else if (!strcmp(loc, "NB Ambient"))
name = "north-bridge-temp"; name = "north-bridge-temp";
...@@ -128,11 +132,6 @@ static struct i2c_driver wf_max6690_driver = { ...@@ -128,11 +132,6 @@ static struct i2c_driver wf_max6690_driver = {
static int __init wf_max6690_sensor_init(void) static int __init wf_max6690_sensor_init(void)
{ {
/* Don't register on old machines that use therm_pm72 for now */
if (of_machine_is_compatible("PowerMac7,2") ||
of_machine_is_compatible("PowerMac7,3") ||
of_machine_is_compatible("RackMac3,1"))
return -ENODEV;
return i2c_add_driver(&wf_max6690_driver); return i2c_add_driver(&wf_max6690_driver);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment