summaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/it87.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2010-04-14 16:14:09 +0200
committerJean Delvare <khali@linux-fr.org>2010-04-14 16:14:09 +0200
commita00afb97e23fd904b12a3f4de3237d8ab2f68738 (patch)
tree2b043b5996ea383d0b182278c18bf34b16982163 /drivers/hwmon/it87.c
parentc7a78d2c2e2537fd24903e966f34aae50319d587 (diff)
downloadop-kernel-dev-a00afb97e23fd904b12a3f4de3237d8ab2f68738.zip
op-kernel-dev-a00afb97e23fd904b12a3f4de3237d8ab2f68738.tar.gz
hwmon: (it87) Don't arbitrarily enable temperature channels
Temperature channels can be used in 2 different modes (thermistor and thermal diode) and we don't know which one, if any, is correct for every given board. So don't arbitrarily choose one. Instead, leave the temperature channels untouched. They can be configured from user-space if needed anyway. Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/it87.c')
-rw-r--r--drivers/hwmon/it87.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c
index 1002bef..5e39e2d 100644
--- a/drivers/hwmon/it87.c
+++ b/drivers/hwmon/it87.c
@@ -545,6 +545,7 @@ static ssize_t set_sensor(struct device *dev, struct device_attribute *attr,
mutex_lock(&data->update_lock);
+ data->sensor = it87_read_value(data, IT87_REG_TEMP_ENABLE);
data->sensor &= ~(1 << nr);
data->sensor &= ~(8 << nr);
if (val == 2) { /* backwards compatibility */
@@ -1841,14 +1842,10 @@ static void __devinit it87_init_device(struct platform_device *pdev)
it87_write_value(data, IT87_REG_TEMP_HIGH(i), 127);
}
- /* Check if temperature channels are reset manually or by some reason */
- tmp = it87_read_value(data, IT87_REG_TEMP_ENABLE);
- if ((tmp & 0x3f) == 0) {
- /* Temp1,Temp3=thermistor; Temp2=thermal diode */
- tmp = (tmp & 0xc0) | 0x2a;
- it87_write_value(data, IT87_REG_TEMP_ENABLE, tmp);
- }
- data->sensor = tmp;
+ /* Temperature channels are not forcibly enabled, as they can be
+ * set to two different sensor types and we can't guess which one
+ * is correct for a given system. These channels can be enabled at
+ * run-time through the temp{1-3}_type sysfs accessors if needed. */
/* Check if voltage monitors are reset manually or by some reason */
tmp = it87_read_value(data, IT87_REG_VIN_ENABLE);
OpenPOWER on IntegriCloud