aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-01-18 17:30:00 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2011-01-18 17:30:00 -0500
commit39f3b1a6878bd9d8c81443546c1115c38d18d44d (patch)
treebc30eb676c6f62236c222837730c811461d6baa0 /drivers/hwmon
parent335bc70b6b5fdc9b4e28cb56c27f10124064f9da (diff)
parentc7bf71c517abfc3b15970d67910e0f62e0522939 (diff)
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/staging: hwmon: (lm93) Add support for LM94
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/Kconfig4
-rw-r--r--drivers/hwmon/lm93.c21
2 files changed, 21 insertions, 4 deletions
diff --git a/drivers/hwmon/Kconfig b/drivers/hwmon/Kconfig
index 35f00dae3676..773e484f1646 100644
--- a/drivers/hwmon/Kconfig
+++ b/drivers/hwmon/Kconfig
@@ -618,8 +618,8 @@ config SENSORS_LM93
618 depends on I2C 618 depends on I2C
619 select HWMON_VID 619 select HWMON_VID
620 help 620 help
621 If you say yes here you get support for National Semiconductor LM93 621 If you say yes here you get support for National Semiconductor LM93,
622 sensor chips. 622 LM94, and compatible sensor chips.
623 623
624 This driver can also be built as a module. If so, the module 624 This driver can also be built as a module. If so, the module
625 will be called lm93. 625 will be called lm93.
diff --git a/drivers/hwmon/lm93.c b/drivers/hwmon/lm93.c
index c9ed14eba5a6..3b43df418613 100644
--- a/drivers/hwmon/lm93.c
+++ b/drivers/hwmon/lm93.c
@@ -135,6 +135,11 @@
135#define LM93_MFR_ID 0x73 135#define LM93_MFR_ID 0x73
136#define LM93_MFR_ID_PROTOTYPE 0x72 136#define LM93_MFR_ID_PROTOTYPE 0x72
137 137
138/* LM94 REGISTER VALUES */
139#define LM94_MFR_ID_2 0x7a
140#define LM94_MFR_ID 0x79
141#define LM94_MFR_ID_PROTOTYPE 0x78
142
138/* SMBus capabilities */ 143/* SMBus capabilities */
139#define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \ 144#define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
140 I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA) 145 I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2509,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
2504{ 2509{
2505 struct i2c_adapter *adapter = client->adapter; 2510 struct i2c_adapter *adapter = client->adapter;
2506 int mfr, ver; 2511 int mfr, ver;
2512 const char *name;
2507 2513
2508 if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN)) 2514 if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
2509 return -ENODEV; 2515 return -ENODEV;
@@ -2517,13 +2523,23 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
2517 } 2523 }
2518 2524
2519 ver = lm93_read_byte(client, LM93_REG_VER); 2525 ver = lm93_read_byte(client, LM93_REG_VER);
2520 if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) { 2526 switch (ver) {
2527 case LM93_MFR_ID:
2528 case LM93_MFR_ID_PROTOTYPE:
2529 name = "lm93";
2530 break;
2531 case LM94_MFR_ID_2:
2532 case LM94_MFR_ID:
2533 case LM94_MFR_ID_PROTOTYPE:
2534 name = "lm94";
2535 break;
2536 default:
2521 dev_dbg(&adapter->dev, 2537 dev_dbg(&adapter->dev,
2522 "detect failed, bad version id 0x%02x!\n", ver); 2538 "detect failed, bad version id 0x%02x!\n", ver);
2523 return -ENODEV; 2539 return -ENODEV;
2524 } 2540 }
2525 2541
2526 strlcpy(info->type, "lm93", I2C_NAME_SIZE); 2542 strlcpy(info->type, name, I2C_NAME_SIZE);
2527 dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n", 2543 dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
2528 client->name, i2c_adapter_id(client->adapter), 2544 client->name, i2c_adapter_id(client->adapter),
2529 client->addr); 2545 client->addr);
@@ -2602,6 +2618,7 @@ static int lm93_remove(struct i2c_client *client)
2602 2618
2603static const struct i2c_device_id lm93_id[] = { 2619static const struct i2c_device_id lm93_id[] = {
2604 { "lm93", 0 }, 2620 { "lm93", 0 },
2621 { "lm94", 0 },
2605 { } 2622 { }
2606}; 2623};
2607MODULE_DEVICE_TABLE(i2c, lm93_id); 2624MODULE_DEVICE_TABLE(i2c, lm93_id);