]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/hwmon/emc1403.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wirel...
[mv-sheeva.git] / drivers / hwmon / emc1403.c
index 5b58b20dead1fa92b79af5c05036d45de8bf88ca..5dea9faa1656804e1be018d396e005b78ad77a02 100644 (file)
@@ -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;
 }
 
@@ -308,7 +315,6 @@ static int emc1403_probe(struct i2c_client *client,
        res = sysfs_create_group(&client->dev.kobj, &m_thermal_gr);
        if (res) {
                dev_warn(&client->dev, "create group failed\n");
-               hwmon_device_unregister(data->hwmon_dev);
                goto thermal_error1;
        }
        data->hwmon_dev = hwmon_device_register(&client->dev);
@@ -343,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);