diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-07-24 14:36:15 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-28 23:16:36 -0400 |
commit | 6d101c588f0fe08ef00f16c1a93762dd5d563df7 (patch) | |
tree | 581cd29ed0235de87d9ca5bd0af17c51fe5e04c2 /drivers/hwmon | |
parent | a095f687f1e19c54147bd51f735717508a49e225 (diff) |
hwmon: (lm90) Make SA56004 detection more robust
With a device ID register value of 0, the SA56004 detection is rather
weak. Check several other register too to confirm the detection, as we
do for other supported devices.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Stijn Devriendt <sdevrien@cisco.com>
Cc: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Stijn Devriendt <sdevrien@cisco.com>
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/lm90.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/hwmon/lm90.c b/drivers/hwmon/lm90.c index 7fef2a1194d9..7c6a3df36d86 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c | |||
@@ -1283,8 +1283,19 @@ static int lm90_detect(struct i2c_client *new_client, | |||
1283 | } | 1283 | } |
1284 | } | 1284 | } |
1285 | } else | 1285 | } else |
1286 | if (man_id == 0xA1) { /* NXP Semiconductor/Philips */ | 1286 | if (address >= 0x48 && address <= 0x4F |
1287 | if (chip_id == 0x00 && address >= 0x48 && address <= 0x4F) { | 1287 | && man_id == 0xA1) { /* NXP Semiconductor/Philips */ |
1288 | int reg_config2; | ||
1289 | |||
1290 | reg_config2 = i2c_smbus_read_byte_data(new_client, | ||
1291 | LM90_REG_R_CONFIG2); | ||
1292 | if (reg_config2 < 0) | ||
1293 | return -ENODEV; | ||
1294 | |||
1295 | if (chip_id == 0x00 | ||
1296 | && (reg_config1 & 0x2A) == 0x00 | ||
1297 | && (reg_config2 & 0xFE) == 0x00 | ||
1298 | && reg_convrate <= 0x09) { | ||
1288 | name = "sa56004"; | 1299 | name = "sa56004"; |
1289 | } | 1300 | } |
1290 | } | 1301 | } |