Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jekyll Lai and committed by
Jean Delvare
7a1b76f2 3ea1bd58

+14 -6
+2 -2
drivers/hwmon/Kconfig
··· 809 809 will be called dme1737. 810 810 811 811 config SENSORS_EMC1403 812 - tristate "SMSC EMC1403 thermal sensor" 812 + tristate "SMSC EMC1403/23 thermal sensor" 813 813 depends on I2C 814 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 816 temperature monitoring chip. 817 817 818 818 Threshold values can be configured using sysfs.
+12 -4
drivers/hwmon/emc1403.c
··· 269 269 struct i2c_board_info *info) 270 270 { 271 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 274 id = i2c_smbus_read_byte_data(client, THERMAL_SMSC_ID_REG); 275 275 if (id != 0x5d) 276 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 286 /* Note: 0x25 is the 1404 which is very similar and this 279 287 driver could be extended */ 280 - id = i2c_smbus_read_byte_data(client, THERMAL_PID_REG); 281 - if (id != 0x21) 288 + default: 282 289 return -ENODEV; 290 + } 283 291 284 292 id = i2c_smbus_read_byte_data(client, THERMAL_REVISION_REG); 285 293 if (id != 0x01) 286 294 return -ENODEV; 287 295 288 - strlcpy(info->type, "emc1403", I2C_NAME_SIZE); 289 296 return 0; 290 297 } 291 298 ··· 349 342 350 343 static const struct i2c_device_id emc1403_idtable[] = { 351 344 { "emc1403", 0 }, 345 + { "emc1423", 0 }, 352 346 { } 353 347 }; 354 348 MODULE_DEVICE_TABLE(i2c, emc1403_idtable);