aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/hwmon/adt7475.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/hwmon/adt7475.c b/drivers/hwmon/adt7475.c
index 20bab51e16f4..520773b16544 100644
--- a/drivers/hwmon/adt7475.c
+++ b/drivers/hwmon/adt7475.c
@@ -47,6 +47,7 @@
47 47
48#define REG_DEVID 0x3D 48#define REG_DEVID 0x3D
49#define REG_VENDID 0x3E 49#define REG_VENDID 0x3E
50#define REG_DEVID2 0x3F
50 51
51#define REG_STATUS1 0x41 52#define REG_STATUS1 0x41
52#define REG_STATUS2 0x42 53#define REG_STATUS2 0x42
@@ -1014,18 +1015,22 @@ static int adt7475_detect(struct i2c_client *client, int kind,
1014 struct i2c_board_info *info) 1015 struct i2c_board_info *info)
1015{ 1016{
1016 struct i2c_adapter *adapter = client->adapter; 1017 struct i2c_adapter *adapter = client->adapter;
1017 int vendid, devid; 1018 int vendid, devid, devid2;
1018 const char *name; 1019 const char *name;
1019 1020
1020 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA)) 1021 if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA))
1021 return -ENODEV; 1022 return -ENODEV;
1022 1023
1023 vendid = adt7475_read(REG_VENDID); 1024 vendid = adt7475_read(REG_VENDID);
1024 devid = adt7475_read(REG_DEVID); 1025 devid2 = adt7475_read(REG_DEVID2);
1026 if (vendid != 0x41 || /* Analog Devices */
1027 (devid2 & 0xf8) != 0x68)
1028 return -ENODEV;
1025 1029
1026 if (vendid == 0x41 && devid == 0x73) 1030 devid = adt7475_read(REG_DEVID);
1031 if (devid == 0x73)
1027 name = "adt7473"; 1032 name = "adt7473";
1028 else if (vendid == 0x41 && devid == 0x75 && client->addr == 0x2e) 1033 else if (devid == 0x75 && client->addr == 0x2e)
1029 name = "adt7475"; 1034 name = "adt7475";
1030 else { 1035 else {
1031 dev_dbg(&adapter->dev, 1036 dev_dbg(&adapter->dev,