diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-04-12 16:12:06 -0700 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2014-08-04 07:01:38 -0700 |
commit | 05c77ab240fdcba3886913235e37b43e3223e9ee (patch) | |
tree | 90f8051576d893426fc216e1addc18bd7088e9ab /drivers/hwmon | |
parent | a63ee9d83b960199ae111ff4e2413fbe328d32fe (diff) | |
download | linux-05c77ab240fdcba3886913235e37b43e3223e9ee.tar.bz2 |
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>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/Kconfig | 2 | ||||
-rw-r--r-- | drivers/hwmon/tmp421.c | 21 |
2 files changed, 18 insertions, 5 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index ae1e2160c1b5..37908ff8f7ff 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig @@ -1431,7 +1431,7 @@ config SENSORS_TMP421 depends on I2C help If you say yes here you get support for Texas Instruments TMP421, - TMP422 and TMP423 temperature sensor chips. + TMP422, TMP423, TMP441, and TMP442 temperature sensor chips. This driver can also be built as a module. If so, the module will be called tmp421. diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index 9438c1bd5d59..2ae383f737b4 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c @@ -21,7 +21,7 @@ /* * Driver for the Texas Instruments TMP421 SMBus temperature sensor IC. - * Supported models: TMP421, TMP422, TMP423 + * Supported models: TMP421, TMP422, TMP423, TMP441, TMP442 */ #include <linux/module.h> @@ -39,7 +39,7 @@ static const unsigned short normal_i2c[] = { 0x2a, 0x4c, 0x4d, 0x4e, 0x4f, I2C_CLIENT_END }; -enum chips { tmp421, tmp422, tmp423 }; +enum chips { tmp421, tmp422, tmp423, tmp441, tmp442 }; /* The TMP421 registers */ #define TMP421_STATUS_REG 0x08 @@ -60,11 +60,15 @@ static const u8 TMP421_TEMP_LSB[4] = { 0x10, 0x11, 0x12, 0x13 }; #define TMP421_DEVICE_ID 0x21 #define TMP422_DEVICE_ID 0x22 #define TMP423_DEVICE_ID 0x23 +#define TMP441_DEVICE_ID 0x41 +#define TMP442_DEVICE_ID 0x42 static const struct i2c_device_id tmp421_id[] = { { "tmp421", 2 }, { "tmp422", 3 }, { "tmp423", 4 }, + { "tmp441", 2 }, + { "tmp442", 3 }, { } }; MODULE_DEVICE_TABLE(i2c, tmp421_id); @@ -235,7 +239,8 @@ static int tmp421_detect(struct i2c_client *client, { enum chips kind; struct i2c_adapter *adapter = client->adapter; - const char *names[] = { "TMP421", "TMP422", "TMP423" }; + const char * const names[] = { "TMP421", "TMP422", "TMP423", + "TMP441", "TMP442" }; int addr = client->addr; u8 reg; @@ -269,6 +274,14 @@ static int tmp421_detect(struct i2c_client *client, return -ENODEV; kind = tmp423; break; + case TMP441_DEVICE_ID: + kind = tmp441; + break; + case TMP442_DEVICE_ID: + if (addr != 0x4c && addr != 0x4d) + return -ENODEV; + kind = tmp442; + break; default: return -ENODEV; } @@ -319,5 +332,5 @@ static struct i2c_driver tmp421_driver = { module_i2c_driver(tmp421_driver); MODULE_AUTHOR("Andre Prendel <andre.prendel@gmx.de>"); -MODULE_DESCRIPTION("Texas Instruments TMP421/422/423 temperature sensor driver"); +MODULE_DESCRIPTION("Texas Instruments TMP421/422/423/441/442 temperature sensor driver"); MODULE_LICENSE("GPL"); |