diff options
author | Jean Delvare <khali@linux-fr.org> | 2011-07-24 20:36:15 +0200 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-28 20:16:36 -0700 |
commit | 6d101c588f0fe08ef00f16c1a93762dd5d563df7 (patch) | |
tree | 581cd29ed0235de87d9ca5bd0af17c51fe5e04c2 /drivers/hwmon/lm90.c | |
parent | a095f687f1e19c54147bd51f735717508a49e225 (diff) | |
download | op-kernel-dev-6d101c588f0fe08ef00f16c1a93762dd5d563df7.zip op-kernel-dev-6d101c588f0fe08ef00f16c1a93762dd5d563df7.tar.gz |
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/lm90.c')
-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 7fef2a119..7c6a3df 100644 --- a/drivers/hwmon/lm90.c +++ b/drivers/hwmon/lm90.c @@ -1283,8 +1283,19 @@ static int lm90_detect(struct i2c_client *new_client, } } } else - if (man_id == 0xA1) { /* NXP Semiconductor/Philips */ - if (chip_id == 0x00 && address >= 0x48 && address <= 0x4F) { + if (address >= 0x48 && address <= 0x4F + && man_id == 0xA1) { /* NXP Semiconductor/Philips */ + int reg_config2; + + reg_config2 = i2c_smbus_read_byte_data(new_client, + LM90_REG_R_CONFIG2); + if (reg_config2 < 0) + return -ENODEV; + + if (chip_id == 0x00 + && (reg_config1 & 0x2A) == 0x00 + && (reg_config2 & 0xFE) == 0x00 + && reg_convrate <= 0x09) { name = "sa56004"; } } |