diff options
author | Jean Delvare <khali@linux-fr.org> | 2013-05-04 08:49:36 -0400 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2013-05-04 08:49:36 -0400 |
commit | 8a5c5cc61748642a1276ef94611e21a60f0796ab (patch) | |
tree | 7f94d4ed22b4e43489a4a1f4183cce724e081be9 /drivers/hwmon/lm75.c | |
parent | 1db772216f48978d5146b858586f6178433aad38 (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/lm75.c')
-rw-r--r-- | drivers/hwmon/lm75.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index 291edfff55bf..4670fbef6a9c 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) | |||
167 | * Then tweak to be more precise when appropriate. | 167 | * Then tweak to be more precise when appropriate. |
168 | */ | 168 | */ |
169 | set_mask = 0; | 169 | set_mask = 0; |
170 | clr_mask = (1 << 0) /* continuous conversions */ | 170 | clr_mask = LM75_SHUTDOWN; /* continuous conversions */ |
171 | | (1 << 6) | (1 << 5); /* 9-bit mode */ | 171 | |
172 | switch (id->driver_data) { | ||
173 | case adt75: | ||
174 | clr_mask |= 1 << 5; /* not one-shot mode */ | ||
175 | break; | ||
176 | case ds1775: | ||
177 | case ds75: | ||
178 | case stds75: | ||
179 | clr_mask |= 3 << 5; /* 9-bit mode */ | ||
180 | break; | ||
181 | case mcp980x: | ||
182 | case tmp100: | ||
183 | case tmp101: | ||
184 | case tmp105: | ||
185 | case tmp175: | ||
186 | case tmp275: | ||
187 | case tmp75: | ||
188 | clr_mask |= 3 << 5; /* 9-bit mode */ | ||
189 | clr_mask |= 1 << 7; /* not one-shot mode */ | ||
190 | break; | ||
191 | } | ||
172 | 192 | ||
173 | /* configure as specified */ | 193 | /* configure as specified */ |
174 | status = lm75_read_value(client, LM75_REG_CONF); | 194 | status = lm75_read_value(client, LM75_REG_CONF); |