diff options
author | Jekyll Lai <jekyll_lai@wistron.com> | 2011-01-12 15:55:12 -0500 |
---|---|---|
committer | Jean Delvare <khali@endymion.delvare> | 2011-01-12 15:55:12 -0500 |
commit | 7a1b76f2a46016809c7bcacf81e89948cc306703 (patch) | |
tree | b89eb772453831af1c3fcb5aced429fcac7bb8af /drivers/hwmon | |
parent | 3ea1bd58b999ec77c28834aa8be671168dfb7b79 (diff) |
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')
-rw-r--r-- | drivers/hwmon/Kconfig | 4 | ||||
-rw-r--r-- | drivers/hwmon/emc1403.c | 16 |
2 files changed, 14 insertions, 6 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index bdc13d28b1ea..35f00dae3676 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -809,10 +809,10 @@ config SENSORS_DME1737 | |||
809 | will be called dme1737. | 809 | will be called dme1737. |
810 | 810 | ||
811 | config SENSORS_EMC1403 | 811 | config SENSORS_EMC1403 |
812 | tristate "SMSC EMC1403 thermal sensor" | 812 | tristate "SMSC EMC1403/23 thermal sensor" |
813 | depends on I2C | 813 | depends on I2C |
814 | help | 814 | help |
815 | If you say yes here you get support for the SMSC EMC1403 | 815 | If you say yes here you get support for the SMSC EMC1403/23 |
816 | temperature monitoring chip. | 816 | temperature monitoring chip. |
817 | 817 | ||
818 | Threshold values can be configured using sysfs. | 818 | Threshold values can be configured using sysfs. |
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 | ||
343 | static const struct i2c_device_id emc1403_idtable[] = { | 350 | static const struct i2c_device_id emc1403_idtable[] = { |
344 | { "emc1403", 0 }, | 351 | { "emc1403", 0 }, |
352 | { "emc1423", 0 }, | ||
345 | { } | 353 | { } |
346 | }; | 354 | }; |
347 | MODULE_DEVICE_TABLE(i2c, emc1403_idtable); | 355 | MODULE_DEVICE_TABLE(i2c, emc1403_idtable); |