aboutsummaryrefslogtreecommitdiff
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2013-05-04 14:49:36 +0200
committerJean Delvare <khali@endymion.delvare>2013-05-04 14:49:36 +0200
commit8a5c5cc61748642a1276ef94611e21a60f0796ab (patch)
tree7f94d4ed22b4e43489a4a1f4183cce724e081be9 /drivers/hwmon
parent1db772216f48978d5146b858586f6178433aad38 (diff)
hwmon: (lm75) Per-chip configuration register initialization
There is no standard for the configuration register bits of LM75-like chips. We shouldn't blindly clear bits setting the resolution as they are either unused or used for something else on some of the supported chips. So, switch to per-chip configuration initialization. This will allow for better tuning later, for example using more resolution bits when available. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/lm75.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c
index 291edfff55b..4670fbef6a9 100644
--- a/drivers/hwmon/lm75.c
+++ b/drivers/hwmon/lm75.c
@@ -167,8 +167,28 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id)
* Then tweak to be more precise when appropriate.
*/
set_mask = 0;
- clr_mask = (1 << 0) /* continuous conversions */
- | (1 << 6) | (1 << 5); /* 9-bit mode */
+ clr_mask = LM75_SHUTDOWN; /* continuous conversions */
+
+ switch (id->driver_data) {
+ case adt75:
+ clr_mask |= 1 << 5; /* not one-shot mode */
+ break;
+ case ds1775:
+ case ds75:
+ case stds75:
+ clr_mask |= 3 << 5; /* 9-bit mode */
+ break;
+ case mcp980x:
+ case tmp100:
+ case tmp101:
+ case tmp105:
+ case tmp175:
+ case tmp275:
+ case tmp75:
+ clr_mask |= 3 << 5; /* 9-bit mode */
+ clr_mask |= 1 << 7; /* not one-shot mode */
+ break;
+ }
/* configure as specified */
status = lm75_read_value(client, LM75_REG_CONF);