diff options
author | Guenter Roeck <linux@roeck-us.net> | 2013-03-15 15:55:08 -0400 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2013-04-08 00:16:42 -0400 |
commit | a1fac92b8b2c439678424f7660f066341607a82a (patch) | |
tree | 672ef38fd52db6e1d65592183cdd4aef3fbd52ef /drivers/hwmon | |
parent | 58615a94f6a190f2fb9f9a99f1894d161c4b85b9 (diff) |
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')
-rw-r--r-- | drivers/hwmon/Kconfig | 4 | ||||
-rw-r--r-- | drivers/hwmon/tmp401.c | 15 |
2 files changed, 14 insertions, 5 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig index a0f1d6a406eb..43ed3aef21c8 100644 --- a/drivers/hwmon/Kconfig +++ b/drivers/hwmon/Kconfig | |||
@@ -1238,8 +1238,8 @@ config SENSORS_TMP401 | |||
1238 | tristate "Texas Instruments TMP401 and compatibles" | 1238 | tristate "Texas Instruments TMP401 and compatibles" |
1239 | depends on I2C | 1239 | depends on I2C |
1240 | help | 1240 | help |
1241 | If you say yes here you get support for Texas Instruments TMP401 and | 1241 | If you say yes here you get support for Texas Instruments TMP401, |
1242 | TMP411 temperature sensor chips. | 1242 | TMP411, and TMP431 temperature sensor chips. |
1243 | 1243 | ||
1244 | This driver can also be built as a module. If so, the module | 1244 | This driver can also be built as a module. If so, the module |
1245 | will be called tmp401. | 1245 | will be called tmp401. |
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 @@ | |||
40 | #include <linux/sysfs.h> | 40 | #include <linux/sysfs.h> |
41 | 41 | ||
42 | /* Addresses to scan */ | 42 | /* Addresses to scan */ |
43 | static const unsigned short normal_i2c[] = { 0x4c, I2C_CLIENT_END }; | 43 | static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; |
44 | 44 | ||
45 | enum chips { tmp401, tmp411 }; | 45 | enum chips { tmp401, tmp411, tmp431 }; |
46 | 46 | ||
47 | /* | 47 | /* |
48 | * The TMP401 registers, note some registers have different addresses for | 48 | * The TMP401 registers, note some registers have different addresses for |
@@ -90,6 +90,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; | |||
90 | #define TMP401_MANUFACTURER_ID 0x55 | 90 | #define TMP401_MANUFACTURER_ID 0x55 |
91 | #define TMP401_DEVICE_ID 0x11 | 91 | #define TMP401_DEVICE_ID 0x11 |
92 | #define TMP411_DEVICE_ID 0x12 | 92 | #define TMP411_DEVICE_ID 0x12 |
93 | #define TMP431_DEVICE_ID 0x31 | ||
93 | 94 | ||
94 | /* | 95 | /* |
95 | * Driver data (common to all clients) | 96 | * Driver data (common to all clients) |
@@ -98,6 +99,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; | |||
98 | static const struct i2c_device_id tmp401_id[] = { | 99 | static const struct i2c_device_id tmp401_id[] = { |
99 | { "tmp401", tmp401 }, | 100 | { "tmp401", tmp401 }, |
100 | { "tmp411", tmp411 }, | 101 | { "tmp411", tmp411 }, |
102 | { "tmp431", tmp431 }, | ||
101 | { } | 103 | { } |
102 | }; | 104 | }; |
103 | MODULE_DEVICE_TABLE(i2c, tmp401_id); | 105 | MODULE_DEVICE_TABLE(i2c, tmp401_id); |
@@ -555,11 +557,18 @@ static int tmp401_detect(struct i2c_client *client, | |||
555 | 557 | ||
556 | switch (reg) { | 558 | switch (reg) { |
557 | case TMP401_DEVICE_ID: | 559 | case TMP401_DEVICE_ID: |
560 | if (client->addr != 0x4c) | ||
561 | return -ENODEV; | ||
558 | kind = tmp401; | 562 | kind = tmp401; |
559 | break; | 563 | break; |
560 | case TMP411_DEVICE_ID: | 564 | case TMP411_DEVICE_ID: |
561 | kind = tmp411; | 565 | kind = tmp411; |
562 | break; | 566 | break; |
567 | case TMP431_DEVICE_ID: | ||
568 | if (client->addr == 0x4e) | ||
569 | return -ENODEV; | ||
570 | kind = tmp431; | ||
571 | break; | ||
563 | default: | 572 | default: |
564 | return -ENODEV; | 573 | return -ENODEV; |
565 | } | 574 | } |
@@ -603,7 +612,7 @@ static int tmp401_probe(struct i2c_client *client, | |||
603 | { | 612 | { |
604 | int i, err = 0; | 613 | int i, err = 0; |
605 | struct tmp401_data *data; | 614 | struct tmp401_data *data; |
606 | const char *names[] = { "TMP401", "TMP411" }; | 615 | const char *names[] = { "TMP401", "TMP411", "TMP431" }; |
607 | 616 | ||
608 | data = devm_kzalloc(&client->dev, sizeof(struct tmp401_data), | 617 | data = devm_kzalloc(&client->dev, sizeof(struct tmp401_data), |
609 | GFP_KERNEL); | 618 | GFP_KERNEL); |