aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/emc1403.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/emc1403.c')
-rw-r--r--drivers/hwmon/emc1403.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/hwmon/emc1403.c b/drivers/hwmon/emc1403.c
index 8dee3f38fdfb..5dea9faa1656 100644
--- a/drivers/hwmon/emc1403.c
+++ b/drivers/hwmon/emc1403.c
@@ -269,23 +269,30 @@ static int emc1403_detect(struct i2c_client *client,
269 struct i2c_board_info *info) 269 struct i2c_board_info *info)
270{ 270{
271 int id; 271 int id;
272 /* Check if thermal chip is SMSC and EMC1403 */ 272 /* Check if thermal chip is SMSC and EMC1403 or EMC1423 */
273 273
274 id = i2c_smbus_read_byte_data(client, THERMAL_SMSC_ID_REG); 274 id = i2c_smbus_read_byte_data(client, THERMAL_SMSC_ID_REG);
275 if (id != 0x5d) 275 if (id != 0x5d)
276 return -ENODEV; 276 return -ENODEV;
277 277
278 id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG);
279 switch (id) {
280 case 0x21:
281 strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
282 break;
283 case 0x23:
284 strlcpy(info->type, "emc1423", I2C_NAME_SIZE);
285 break;
278 /* Note: 0x25 is the 1404 which is very similar and this 286 /* Note: 0x25 is the 1404 which is very similar and this
279 driver could be extended */ 287 driver could be extended */
280 id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG); 288 default:
281 if (id != 0x21)
282 return -ENODEV; 289 return -ENODEV;
290 }
283 291
284 id = i2c_smbus_read_byte_data(client, THERMAL_REVISION_REG); 292 id = i2c_smbus_read_byte_data(client, THERMAL_REVISION_REG);
285 if (id != 0x01) 293 if (id != 0x01)
286 return -ENODEV; 294 return -ENODEV;
287 295
288 strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
289 return 0; 296 return 0;
290} 297}
291 298
@@ -342,6 +349,7 @@ static const unsigned short emc1403_address_list[] = {
342 349
343static const struct i2c_device_id emc1403_idtable[] = { 350static const struct i2c_device_id emc1403_idtable[] = {
344 { "emc1403", 0 }, 351 { "emc1403", 0 },
352 { "emc1423", 0 },
345 { } 353 { }
346}; 354};
347MODULE_DEVICE_TABLE(i2c, emc1403_idtable); 355MODULE_DEVICE_TABLE(i2c, emc1403_idtable);