diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-03-15 23:55:08 +0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-04-08 08:16:42 +0400 |
commit | a1fac92b8b2c439678424f7660f066341607a82a (patch) | |
tree | 672ef38fd52db6e1d65592183cdd4aef3fbd52ef /drivers/hwmon/tmp401.c | |
parent | 58615a94f6a190f2fb9f9a99f1894d161c4b85b9 (diff) | |
download | linux-a1fac92b8b2c439678424f7660f066341607a82a.tar.xz |
hwmon: (tmp401) Add support for TMP431
TMP431 is compatible to TMP401.
Also add support for additional I2C addresses supported by TMP411B
and TMP411C.
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Acked-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/tmp401.c')
-rw-r--r-- | drivers/hwmon/tmp401.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c index 97bf34494d84..f4290ec7d9e7 100644 --- a/drivers/hwmon/tmp401.c +++ b/drivers/hwmon/tmp401.c @@ -40,9 +40,9 @@ #include <linux/sysfs.h> /* Addresses to scan */ -static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; +static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; -enum chips { tmp401, tmp411 }; +enum chips { tmp401, tmp411, tmp431 }; /* * The TMP401 registers, note some registers have different addresses for @@ -90,6 +90,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; #define TMP401_MANUFACTURER_ID 0x55 #define TMP401_DEVICE_ID 0x11 #define TMP411_DEVICE_ID 0x12 +#define TMP431_DEVICE_ID 0x31 /* * Driver data (common to all clients) @@ -98,6 +99,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; static const struct i2c_device_id tmp401_id[] = { { "tmp401", tmp401 }, { "tmp411", tmp411 }, + { "tmp431", tmp431 }, { } }; MODULE_DEVICE_TABLE(i2c, tmp401_id); @@ -555,11 +557,18 @@ static int tmp401_detect(struct i2c_client *client, switch (reg) { case TMP401_DEVICE_ID: + if (client->addr != 0x4c) + return -ENODEV; kind = tmp401; break; case TMP411_DEVICE_ID: kind = tmp411; break; + case TMP431_DEVICE_ID: + if (client->addr == 0x4e) + return -ENODEV; + kind = tmp431; + break; default: return -ENODEV; } @@ -603,7 +612,7 @@ static int tmp401_probe(struct i2c_client *client, { int i, err = 0; struct tmp401_data *data; - const char *names[] = { "TMP401", "TMP411" }; + const char *names[] = { "TMP401", "TMP411", "TMP431" }; data = devm_kzalloc(&client->dev, sizeof(struct tmp401_data), GFP_KERNEL); |