summaryrefslogtreecommitdiff
path: root/drivers/hwmon/emc1403.c
diff options
context:
space:
mode:
authorJekyll Lai <jekyll_lai@wistron.com>2011-01-12 23:55:12 +0300
committerJean Delvare <khali@endymion.delvare>2011-01-12 23:55:12 +0300
commit7a1b76f2a46016809c7bcacf81e89948cc306703 (patch)
treeb89eb772453831af1c3fcb5aced429fcac7bb8af /drivers/hwmon/emc1403.c
parent3ea1bd58b999ec77c28834aa8be671168dfb7b79 (diff)
downloadlinux-7a1b76f2a46016809c7bcacf81e89948cc306703.tar.xz
hwmon: (emc1403) Add EMC1423 support
EMC1423 uses the similar register and adds a hardware shutdown pin to protect exceed temperature. This function is set by resistor; it's not necessary to do anything in the driver except add the emc1423 pid of 0x23. Signed-off-by: Jekyll Lai <jekyll_lai@wistron.com> [Updated Kconfig/comments and minor further changes asked for by the hwmon maintainers] Signed-off-by: Alan Cox <alan@linux.intel.com> [Fixed checkpatch warning] Signed-of--by: Jean Delvare <khali@linux-fr.org>
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,
struct i2c_board_info *info)
{
int id;
- /* Check if thermal chip is SMSC and EMC1403 */
+ /* Check if thermal chip is SMSC and EMC1403 or EMC1423 */
id = i2c_smbus_read_byte_data(client, THERMAL_SMSC_ID_REG);
if (id != 0x5d)
return -ENODEV;
+ id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG);
+ switch (id) {
+ case 0x21:
+ strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
+ break;
+ case 0x23:
+ strlcpy(info->type, "emc1423", I2C_NAME_SIZE);
+ break;
/* Note: 0x25 is the 1404 which is very similar and this
driver could be extended */
- id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG);
- if (id != 0x21)
+ default:
return -ENODEV;
+ }
id = i2c_smbus_read_byte_data(client, THERMAL_REVISION_REG);
if (id != 0x01)
return -ENODEV;
- strlcpy(info->type, "emc1403", I2C_NAME_SIZE);
return 0;
}
@@ -342,6 +349,7 @@ static const unsigned short emc1403_address_list[] = {
static const struct i2c_device_id emc1403_idtable[] = {
{ "emc1403", 0 },
+ { "emc1423", 0 },
{ }
};
MODULE_DEVICE_TABLE(i2c, emc1403_idtable);