Commit 05c77ab240fdcba3886913235e37b43e3223e9ee

Authored by Guenter Roeck
1 parent a63ee9d83b

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>

Showing 3 changed files with 33 additions and 12 deletions Side-by-side Diff

Documentation/hwmon/tmp421
... ... @@ -14,6 +14,14 @@
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>
... ... @@ -21,13 +29,13 @@
21 29 Description
22 30 -----------
23 31  
24   -This driver implements support for Texas Instruments TMP421, TMP422
25   -and TMP423 temperature sensor chips. These chips implement one local
26   -and up to one (TMP421), up to two (TMP422) or up to three (TMP423)
27   -remote sensors. Temperature is measured in degrees Celsius. The chips
28   -are wired over I2C/SMBus and specified over a temperature range of -40
29   -to +125 degrees Celsius. Resolution for both the local and remote
30   -channels is 0.0625 degree C.
  32 +This driver implements support for Texas Instruments TMP421, TMP422,
  33 +TMP423, TMP441, and TMP442 temperature sensor chips. These chips
  34 +implement one local and up to one (TMP421, TMP441), up to two (TMP422,
  35 +TMP442) or up to three (TMP423) remote sensors. Temperature is measured
  36 +in degrees Celsius. The chips are wired over I2C/SMBus and specified
  37 +over a temperature range of -40 to +125 degrees Celsius. Resolution
  38 +for both the local and remote channels is 0.0625 degree C.
31 39  
32 40 The chips support only temperature measurement. The driver exports
33 41 the temperature values via the following sysfs files:
drivers/hwmon/Kconfig
... ... @@ -1431,7 +1431,7 @@
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.
drivers/hwmon/tmp421.c
... ... @@ -21,7 +21,7 @@
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,7 +39,7 @@
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
46 46  
... ... @@ -60,11 +60,15 @@
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);
... ... @@ -235,7 +239,8 @@
235 239 {
236 240 enum chips kind;
237 241 struct i2c_adapter *adapter = client->adapter;
238   - const char *names[] = { "TMP421", "TMP422", "TMP423" };
  242 + const char * const names[] = { "TMP421", "TMP422", "TMP423",
  243 + "TMP441", "TMP442" };
239 244 int addr = client->addr;
240 245 u8 reg;
241 246  
... ... @@ -269,6 +274,14 @@
269 274 return -ENODEV;
270 275 kind = tmp423;
271 276 break;
  277 + case TMP441_DEVICE_ID:
  278 + kind = tmp441;
  279 + break;
  280 + case TMP442_DEVICE_ID:
  281 + if (addr != 0x4c && addr != 0x4d)
  282 + return -ENODEV;
  283 + kind = tmp442;
  284 + break;
272 285 default:
273 286 return -ENODEV;
274 287 }
... ... @@ -319,6 +332,6 @@
319 332 module_i2c_driver(tmp421_driver);
320 333  
321 334 MODULE_AUTHOR("Andre Prendel <andre.prendel@gmx.de>");
322   -MODULE_DESCRIPTION("Texas Instruments TMP421/422/423 temperature sensor driver");
  335 +MODULE_DESCRIPTION("Texas Instruments TMP421/422/423/441/442 temperature sensor driver");
323 336 MODULE_LICENSE("GPL");