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

hwmon: (tmp421) Add support for TMP441 and TMP442

TMP441 and TMP442 are compatible to TMP421 and TMP422.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jean Delvare <jdelvare@suse.de>

+33 -12
+15 -7
Documentation/hwmon/tmp421
··· 14 14 Prefix: 'tmp423' 15 15 Addresses scanned: I2C 0x4c and 0x4d 16 16 Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp421.html 17 + * Texas Instruments TMP441 18 + Prefix: 'tmp441' 19 + Addresses scanned: I2C 0x2a, 0x4c, 0x4d, 0x4e and 0x4f 20 + Datasheet: http://www.ti.com/product/tmp441 21 + * Texas Instruments TMP442 22 + Prefix: 'tmp442' 23 + Addresses scanned: I2C 0x4c and 0x4d 24 + Datasheet: http://www.ti.com/product/tmp442 17 25 18 26 Authors: 19 27 Andre Prendel <andre.prendel@gmx.de> ··· 29 21 Description 30 22 ----------- 31 23 32 - This driver implements support for Texas Instruments TMP421, TMP422 33 - and TMP423 temperature sensor chips. These chips implement one local 34 - and up to one (TMP421), up to two (TMP422) or up to three (TMP423) 35 - remote sensors. Temperature is measured in degrees Celsius. The chips 36 - are wired over I2C/SMBus and specified over a temperature range of -40 37 - to +125 degrees Celsius. Resolution for both the local and remote 38 - channels is 0.0625 degree C. 24 + This driver implements support for Texas Instruments TMP421, TMP422, 25 + TMP423, TMP441, and TMP442 temperature sensor chips. These chips 26 + implement one local and up to one (TMP421, TMP441), up to two (TMP422, 27 + TMP442) or up to three (TMP423) remote sensors. Temperature is measured 28 + in degrees Celsius. The chips are wired over I2C/SMBus and specified 29 + over a temperature range of -40 to +125 degrees Celsius. Resolution 30 + for both the local and remote channels is 0.0625 degree C. 39 31 40 32 The chips support only temperature measurement. The driver exports 41 33 the temperature values via the following sysfs files:
+1 -1
drivers/hwmon/Kconfig
··· 1431 1431 depends on I2C 1432 1432 help 1433 1433 If you say yes here you get support for Texas Instruments TMP421, 1434 - TMP422 and TMP423 temperature sensor chips. 1434 + TMP422, TMP423, TMP441, and TMP442 temperature sensor chips. 1435 1435 1436 1436 This driver can also be built as a module. If so, the module 1437 1437 will be called tmp421.
+17 -4
drivers/hwmon/tmp421.c
··· 21 21 22 22 /* 23 23 * Driver for the Texas Instruments TMP421 SMBus temperature sensor IC. 24 - * Supported models: TMP421, TMP422, TMP423 24 + * Supported models: TMP421, TMP422, TMP423, TMP441, TMP442 25 25 */ 26 26 27 27 #include <linux/module.h> ··· 39 39 static const unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, 40 40 I2C_CLIENT_END }; 41 41 42 - enum chips { tmp421, tmp422, tmp423 }; 42 + enum chips { tmp421, tmp422, tmp423, tmp441, tmp442 }; 43 43 44 44 /* The TMP421 registers */ 45 45 #define TMP421_STATUS_REG 0x08 ··· 60 60 #define TMP421_DEVICE_ID 0x21 61 61 #define TMP422_DEVICE_ID 0x22 62 62 #define TMP423_DEVICE_ID 0x23 63 + #define TMP441_DEVICE_ID 0x41 64 + #define TMP442_DEVICE_ID 0x42 63 65 64 66 static const struct i2c_device_id tmp421_id[] = { 65 67 { "tmp421", 2 }, 66 68 { "tmp422", 3 }, 67 69 { "tmp423", 4 }, 70 + { "tmp441", 2 }, 71 + { "tmp442", 3 }, 68 72 { } 69 73 }; 70 74 MODULE_DEVICE_TABLE(i2c, tmp421_id); ··· 239 235 { 240 236 enum chips kind; 241 237 struct i2c_adapter *adapter = client->adapter; 242 - const char *names[] = { "TMP421", "TMP422", "TMP423" }; 238 + const char * const names[] = { "TMP421", "TMP422", "TMP423", 239 + "TMP441", "TMP442" }; 243 240 int addr = client->addr; 244 241 u8 reg; 245 242 ··· 273 268 if (addr != 0x4c && addr != 0x4d) 274 269 return -ENODEV; 275 270 kind = tmp423; 271 + break; 272 + case TMP441_DEVICE_ID: 273 + kind = tmp441; 274 + break; 275 + case TMP442_DEVICE_ID: 276 + if (addr != 0x4c && addr != 0x4d) 277 + return -ENODEV; 278 + kind = tmp442; 276 279 break; 277 280 default: 278 281 return -ENODEV; ··· 332 319 module_i2c_driver(tmp421_driver); 333 320 334 321 MODULE_AUTHOR("Andre Prendel <andre.prendel@gmx.de>"); 335 - MODULE_DESCRIPTION("Texas Instruments TMP421/422/423 temperature sensor driver"); 322 + MODULE_DESCRIPTION("Texas Instruments TMP421/422/423/441/442 temperature sensor driver"); 336 323 MODULE_LICENSE("GPL");