aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/tmp401.c
diff options
context:
space:
mode:
authorPatrick Titiano <ptitiano@baylibre.com>2014-12-04 11:45:51 -0500
committerGuenter Roeck <linux@roeck-us.net>2014-12-04 13:59:42 -0500
commit06adbaec2a7a3d04741557b411e264c7f9c91c85 (patch)
tree98e362c9dcb931ccda304befdf0d07415b692f0d /drivers/hwmon/tmp401.c
parentdfcd4c53be1da9e297bba340ec46f3269cbc239e (diff)
hwmon: (tmp401) Add support for TI TMP435
Signed-off-by: Patrick Titiano <ptitiano@baylibre.com> [Bartosz Golaszewski: prepared for submission, code review fixes] Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> [Guenter Roeck: Merged two patches into one] Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/tmp401.c')
-rw-r--r--drivers/hwmon/tmp401.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/hwmon/tmp401.c b/drivers/hwmon/tmp401.c
index 7fa6e7d0b9b6..ccd993880d74 100644
--- a/drivers/hwmon/tmp401.c
+++ b/drivers/hwmon/tmp401.c
@@ -46,7 +46,7 @@
46/* Addresses to scan */ 46/* Addresses to scan */
47static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END }; 47static const unsigned short normal_i2c[] = { 0x4c, 0x4d, 0x4e, I2C_CLIENT_END };
48 48
49enum chips { tmp401, tmp411, tmp431, tmp432 }; 49enum chips { tmp401, tmp411, tmp431, tmp432, tmp435 };
50 50
51/* 51/*
52 * The TMP401 registers, note some registers have different addresses for 52 * The TMP401 registers, note some registers have different addresses for
@@ -136,6 +136,7 @@ static const u8 TMP432_STATUS_REG[] = {
136#define TMP411C_DEVICE_ID 0x10 136#define TMP411C_DEVICE_ID 0x10
137#define TMP431_DEVICE_ID 0x31 137#define TMP431_DEVICE_ID 0x31
138#define TMP432_DEVICE_ID 0x32 138#define TMP432_DEVICE_ID 0x32
139#define TMP435_DEVICE_ID 0x35
139 140
140/* 141/*
141 * Driver data (common to all clients) 142 * Driver data (common to all clients)
@@ -146,6 +147,7 @@ static const struct i2c_device_id tmp401_id[] = {
146 { "tmp411", tmp411 }, 147 { "tmp411", tmp411 },
147 { "tmp431", tmp431 }, 148 { "tmp431", tmp431 },
148 { "tmp432", tmp432 }, 149 { "tmp432", tmp432 },
150 { "tmp435", tmp435 },
149 { } 151 { }
150}; 152};
151MODULE_DEVICE_TABLE(i2c, tmp401_id); 153MODULE_DEVICE_TABLE(i2c, tmp401_id);
@@ -684,6 +686,11 @@ static int tmp401_detect(struct i2c_client *client,
684 return -ENODEV; 686 return -ENODEV;
685 kind = tmp432; 687 kind = tmp432;
686 break; 688 break;
689 case TMP435_DEVICE_ID:
690 if (client->addr != 0x4c)
691 return -ENODEV;
692 kind = tmp435;
693 break;
687 default: 694 default:
688 return -ENODEV; 695 return -ENODEV;
689 } 696 }
@@ -705,7 +712,9 @@ static int tmp401_detect(struct i2c_client *client,
705static int tmp401_probe(struct i2c_client *client, 712static int tmp401_probe(struct i2c_client *client,
706 const struct i2c_device_id *id) 713 const struct i2c_device_id *id)
707{ 714{
708 const char *names[] = { "TMP401", "TMP411", "TMP431", "TMP432" }; 715 static const char * const names[] = {
716 "TMP401", "TMP411", "TMP431", "TMP432", "TMP435"
717 };
709 struct device *dev = &client->dev; 718 struct device *dev = &client->dev;
710 struct device *hwmon_dev; 719 struct device *hwmon_dev;
711 struct tmp401_data *data; 720 struct tmp401_data *data;