mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
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 <[email protected]> Acked-by: Guenter Roeck <[email protected]>
This commit is contained in:
parent
1db772216f
commit
8a5c5cc617
1 changed files with 22 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue