Commit a1fac92b authored by Guenter Roeck's avatar Guenter Roeck

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: default avatarGuenter Roeck <linux@roeck-us.net>
Acked-by: default avatarJean Delvare <khali@linux-fr.org>
parent 58615a94
...@@ -8,8 +8,12 @@ Supported chips: ...@@ -8,8 +8,12 @@ Supported chips:
Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp401.html Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp401.html
* Texas Instruments TMP411 * Texas Instruments TMP411
Prefix: 'tmp411' Prefix: 'tmp411'
Addresses scanned: I2C 0x4c Addresses scanned: I2C 0x4c, 0x4d, 0x4e
Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp411.html Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp411.html
* Texas Instruments TMP431
Prefix: 'tmp431'
Addresses scanned: I2C 0x4c, 0x4d
Datasheet: http://focus.ti.com/docs/prod/folders/print/tmp431.html
Authors: Authors:
Hans de Goede <hdegoede@redhat.com> Hans de Goede <hdegoede@redhat.com>
...@@ -18,8 +22,8 @@ Authors: ...@@ -18,8 +22,8 @@ Authors:
Description Description
----------- -----------
This driver implements support for Texas Instruments TMP401 and This driver implements support for Texas Instruments TMP401, TMP411,
TMP411 chips. These chips implements one remote and one local and TMP431 chips. These chips implement one remote and one local
temperature sensor. Temperature is measured in degrees temperature sensor. Temperature is measured in degrees
Celsius. Resolution of the remote sensor is 0.0625 degree. Local Celsius. Resolution of the remote sensor is 0.0625 degree. Local
sensor resolution can be set to 0.5, 0.25, 0.125 or 0.0625 degree (not sensor resolution can be set to 0.5, 0.25, 0.125 or 0.0625 degree (not
...@@ -27,10 +31,10 @@ supported by the driver so far, so using the default resolution of 0.5 ...@@ -27,10 +31,10 @@ supported by the driver so far, so using the default resolution of 0.5
degree). degree).
The driver provides the common sysfs-interface for temperatures (see The driver provides the common sysfs-interface for temperatures (see
/Documentation/hwmon/sysfs-interface under Temperatures). Documentation/hwmon/sysfs-interface under Temperatures).
The TMP411 chip is compatible with TMP401. It provides some additional The TMP411 and TMP431 chips are compatible with TMP401. TMP411 provides
features. some additional features.
* Minimum and Maximum temperature measured since power-on, chip-reset * Minimum and Maximum temperature measured since power-on, chip-reset
......
...@@ -1238,8 +1238,8 @@ config SENSORS_TMP401 ...@@ -1238,8 +1238,8 @@ config SENSORS_TMP401
tristate "Texas Instruments TMP401 and compatibles" tristate "Texas Instruments TMP401 and compatibles"
depends on I2C depends on I2C
help help
If you say yes here you get support for Texas Instruments TMP401 and If you say yes here you get support for Texas Instruments TMP401,
TMP411 temperature sensor chips. TMP411, and TMP431 temperature sensor chips.
This driver can also be built as a module. If so, the module This driver can also be built as a module. If so, the module
will be called tmp401. will be called tmp401.
......
...@@ -40,9 +40,9 @@ ...@@ -40,9 +40,9 @@
#include <linux/sysfs.h> #include <linux/sysfs.h>
/* Addresses to scan */ /* 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 * 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,6 +90,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 };
#define TMP401_MANUFACTURER_ID 0x55 #define TMP401_MANUFACTURER_ID 0x55
#define TMP401_DEVICE_ID 0x11 #define TMP401_DEVICE_ID 0x11
#define TMP411_DEVICE_ID 0x12 #define TMP411_DEVICE_ID 0x12
#define TMP431_DEVICE_ID 0x31
/* /*
* Driver data (common to all clients) * Driver data (common to all clients)
...@@ -98,6 +99,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 }; ...@@ -98,6 +99,7 @@ static const u8 TMP411_TEMP_HIGHEST_LSB[2] = { 0x33, 0x37 };
static const struct i2c_device_id tmp401_id[] = { static const struct i2c_device_id tmp401_id[] = {
{ "tmp401", tmp401 }, { "tmp401", tmp401 },
{ "tmp411", tmp411 }, { "tmp411", tmp411 },
{ "tmp431", tmp431 },
{ } { }
}; };
MODULE_DEVICE_TABLE(i2c, tmp401_id); MODULE_DEVICE_TABLE(i2c, tmp401_id);
...@@ -555,11 +557,18 @@ static int tmp401_detect(struct i2c_client *client, ...@@ -555,11 +557,18 @@ static int tmp401_detect(struct i2c_client *client,
switch (reg) { switch (reg) {
case TMP401_DEVICE_ID: case TMP401_DEVICE_ID:
if (client->addr != 0x4c)
return -ENODEV;
kind = tmp401; kind = tmp401;
break; break;
case TMP411_DEVICE_ID: case TMP411_DEVICE_ID:
kind = tmp411; kind = tmp411;
break; break;
case TMP431_DEVICE_ID:
if (client->addr == 0x4e)
return -ENODEV;
kind = tmp431;
break;
default: default:
return -ENODEV; return -ENODEV;
} }
...@@ -603,7 +612,7 @@ static int tmp401_probe(struct i2c_client *client, ...@@ -603,7 +612,7 @@ static int tmp401_probe(struct i2c_client *client,
{ {
int i, err = 0; int i, err = 0;
struct tmp401_data *data; struct tmp401_data *data;
const char *names[] = { "TMP401", "TMP411" }; const char *names[] = { "TMP401", "TMP411", "TMP431" };
data = devm_kzalloc(&client->dev, sizeof(struct tmp401_data), data = devm_kzalloc(&client->dev, sizeof(struct tmp401_data),
GFP_KERNEL); GFP_KERNEL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment