Skip to content

Commit

Permalink
hwmon: (emc1403) Add EMC1423 support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jekyll Lai authored and Jean Delvare committed Jan 12, 2011
1 parent 3ea1bd5 commit 7a1b76f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
4 changes: 2 additions & 2 deletions drivers/hwmon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -809,10 +809,10 @@ config SENSORS_DME1737
will be called dme1737.

config SENSORS_EMC1403
tristate "SMSC EMC1403 thermal sensor"
tristate "SMSC EMC1403/23 thermal sensor"
depends on I2C
help
If you say yes here you get support for the SMSC EMC1403
If you say yes here you get support for the SMSC EMC1403/23
temperature monitoring chip.

Threshold values can be configured using sysfs.
Expand Down
16 changes: 12 additions & 4 deletions drivers/hwmon/emc1403.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 7a1b76f

Please sign in to comment.