Skip to contentSkip to conversation

hwmon: (lm93) Add support for LM94

PATCH Superseded Anish Patel 2 participants 5 messages Jan 17, 2011 – Jan 18, 2011

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

please add device id 0x7a for the LM94 as well.

thanks

Quoted 83 lines · Guenter Roeck

This patch adds basic support for LM94 to the LM93 driver. LM94 specific sensors and features are not supported.

---
  Documentation/hwmon/lm93 |    7 +++++++
  drivers/hwmon/lm93.c     |   19 +++++++++++++++++--
  2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/hwmon/lm93 +7 -0
index 7a10616..f3b2ad2 100644
@@ -6,6 +6,10 @@ Supported chips:
      Prefix 'lm93'
      Addresses scanned: I2C 0x2c-0x2e
      Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
+  * National Semiconductor LM94
+    Prefix 'lm94'
+    Addresses scanned: I2C 0x2c-0x2e
+    Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
 
  Authors:
  	Mark M. Hoffman<[email protected]>
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
  for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
  processor Xeon class motherboard with a minimum of external components.
 
+LM94 is also supported in LM93 compatible mode. Extra sensors and features of
+LM94 are not supported.
+
 
  User Interface
  --------------
drivers/hwmon/lm93.c +16 -2
index c9ed14e..4a8b984 100644
@@ -135,6 +135,10 @@
  #define LM93_MFR_ID		0x73
  #define LM93_MFR_ID_PROTOTYPE	0x72
 
+/* LM94 REGISTER VALUES */
+#define LM94_MFR_ID		0x79
+#define LM94_MFR_ID_PROTOTYPE	0x78
+
  /* SMBus capabilities */
  #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
  		I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2508,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
  {
  	struct i2c_adapter *adapter = client->adapter;
  	int mfr, ver;
+	const char *name;
 
  	if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
  		return -ENODEV;
@@ -2517,13 +2522,22 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
  	}
 
  	ver = lm93_read_byte(client, LM93_REG_VER);
-	if (ver != LM93_MFR_ID&&  ver != LM93_MFR_ID_PROTOTYPE) {
+	switch (ver) {
+	case LM93_MFR_ID:
+	case LM93_MFR_ID_PROTOTYPE:
+		name = "lm93";
+		break;
+	case LM94_MFR_ID:
+	case LM94_MFR_ID_PROTOTYPE:
+		name = "lm94";
+		break;
+	default:
  		dev_dbg(&adapter->dev,
  			"detect failed, bad version id 0x%02x!\n", ver);
  		return -ENODEV;
  	}
 
-	strlcpy(info->type, "lm93", I2C_NAME_SIZE);
+	strlcpy(info->type, name, I2C_NAME_SIZE);
  	dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
  		client->name, i2c_adapter_id(client->adapter),
  		client->addr);

drivers/hwmon/lm93.c static int lm93_remove(struct i2c_client *client) · line 2622

Quoted 7 lines
drivers/hwmon/lm93.c +1 -0
@@ -2602,6 +2616,7 @@ static int lm93_remove(struct i2c_client *client)
 
  static const struct i2c_device_id lm93_id[] = {
  	{ "lm93", 0 },
+	{ "lm94", 0 },
  	{ }
  };
  MODULE_DEVICE_TABLE(i2c, lm93_id);

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#1 lore raw

PATCH 1/1 hwmon: (lm93) Add support for LM94

This patch adds basic support for LM94 to the LM93 driver. LM94 specific sensors and features are not supported.

---
 Documentation/hwmon/lm93 |    7 +++++++
 drivers/hwmon/lm93.c     |   19 +++++++++++++++++--
 2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/hwmon/lm93 +7 -0
index 7a10616..f3b2ad2 100644
@@ -6,6 +6,10 @@ Supported chips:
     Prefix 'lm93'
     Addresses scanned: I2C 0x2c-0x2e
     Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
+  * National Semiconductor LM94
+    Prefix 'lm94'
+    Addresses scanned: I2C 0x2c-0x2e
+    Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
 
 Authors:
 	Mark M. Hoffman <[email protected]>
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
 for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
 processor Xeon class motherboard with a minimum of external components.
 
+LM94 is also supported in LM93 compatible mode. Extra sensors and features of
+LM94 are not supported.
+
 
 User Interface
 --------------
drivers/hwmon/lm93.c +17 -2
index c9ed14e..4a8b984 100644
@@ -135,6 +135,10 @@
 #define LM93_MFR_ID		0x73
 #define LM93_MFR_ID_PROTOTYPE	0x72
 
+/* LM94 REGISTER VALUES */
+#define LM94_MFR_ID		0x79
+#define LM94_MFR_ID_PROTOTYPE	0x78
+
 /* SMBus capabilities */
 #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
 		I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2508,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
 {
 	struct i2c_adapter *adapter = client->adapter;
 	int mfr, ver;
+	const char *name;
 
 	if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
 		return -ENODEV;
@@ -2517,13 +2522,22 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
 	}
 
 	ver = lm93_read_byte(client, LM93_REG_VER);
-	if (ver != LM93_MFR_ID && ver != LM93_MFR_ID_PROTOTYPE) {
+	switch (ver) {
+	case LM93_MFR_ID:
+	case LM93_MFR_ID_PROTOTYPE:
+		name = "lm93";
+		break;
+	case LM94_MFR_ID:
+	case LM94_MFR_ID_PROTOTYPE:
+		name = "lm94";
+		break;
+	default:
 		dev_dbg(&adapter->dev,
 			"detect failed, bad version id 0x%02x!\n", ver);
 		return -ENODEV;
 	}
 
-	strlcpy(info->type, "lm93", I2C_NAME_SIZE);
+	strlcpy(info->type, name, I2C_NAME_SIZE);
 	dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
 		client->name, i2c_adapter_id(client->adapter),
 		client->addr);
@@ -2602,6 +2616,7 @@ static int lm93_remove(struct i2c_client *client)
 
 static const struct i2c_device_id lm93_id[] = {
 	{ "lm93", 0 },
+	{ "lm94", 0 },
 	{ }
 };
 MODULE_DEVICE_TABLE(i2c, lm93_id);
Signature · 7 lines
1.7.3.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
#2 lore raw
In reply to Anish Patel
Quoted 2 lines · Anish Patel

please add device id 0x7a for the LM94 as well.

Hint - top posting is discouraged.

I don't mind, but not even the "official" datasheet from National (dated 07/15/2010) lists 0x7a as supported stepping. Do you have information that this version of the chip exists ?

Thanks,
Guenter

Quoted 87 lines

thanks

Quoted 84 lines · Guenter Roeck

This patch adds basic support for LM94 to the LM93 driver. LM94 specific sensors and features are not supported.

---
  Documentation/hwmon/lm93 |    7 +++++++
  drivers/hwmon/lm93.c     |   19 +++++++++++++++++--
  2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/hwmon/lm93 +7 -0
index 7a10616..f3b2ad2 100644
@@ -6,6 +6,10 @@ Supported chips:
      Prefix 'lm93'
      Addresses scanned: I2C 0x2c-0x2e
      Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
+  * National Semiconductor LM94
+    Prefix 'lm94'
+    Addresses scanned: I2C 0x2c-0x2e
+    Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
 
  Authors:
  	Mark M. Hoffman<[email protected]>
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
  for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
  processor Xeon class motherboard with a minimum of external components.
 
+LM94 is also supported in LM93 compatible mode. Extra sensors and features of
+LM94 are not supported.
+
 
  User Interface
  --------------
drivers/hwmon/lm93.c +16 -2
index c9ed14e..4a8b984 100644
@@ -135,6 +135,10 @@
  #define LM93_MFR_ID		0x73
  #define LM93_MFR_ID_PROTOTYPE	0x72
 
+/* LM94 REGISTER VALUES */
+#define LM94_MFR_ID		0x79
+#define LM94_MFR_ID_PROTOTYPE	0x78
+
  /* SMBus capabilities */
  #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
  		I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2508,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
  {
  	struct i2c_adapter *adapter = client->adapter;
  	int mfr, ver;
+	const char *name;
 
  	if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
  		return -ENODEV;
@@ -2517,13 +2522,22 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
  	}
 
  	ver = lm93_read_byte(client, LM93_REG_VER);
-	if (ver != LM93_MFR_ID&&  ver != LM93_MFR_ID_PROTOTYPE) {
+	switch (ver) {
+	case LM93_MFR_ID:
+	case LM93_MFR_ID_PROTOTYPE:
+		name = "lm93";
+		break;
+	case LM94_MFR_ID:
+	case LM94_MFR_ID_PROTOTYPE:
+		name = "lm94";
+		break;
+	default:
  		dev_dbg(&adapter->dev,
  			"detect failed, bad version id 0x%02x!\n", ver);
  		return -ENODEV;
  	}
 
-	strlcpy(info->type, "lm93", I2C_NAME_SIZE);
+	strlcpy(info->type, name, I2C_NAME_SIZE);
  	dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
  		client->name, i2c_adapter_id(client->adapter),
  		client->addr);
@@ -2602,6 +2616,7 @@ static int lm93_remove(struct i2c_client *client)
 
Quoted 7 lines

drivers/hwmon/lm93.c static int lm93_remove(struct i2c_client *client) · line 2622

Quoted 6 lines
drivers/hwmon/lm93.c +1 -0
  static const struct i2c_device_id lm93_id[] = {
  	{ "lm93", 0 },
+	{ "lm94", 0 },
  	{ }
  };
  MODULE_DEVICE_TABLE(i2c, lm93_id);

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#3 lore raw
In reply to Anish Patel
Quoted 5 lines · Guenter Roeck
Quoted 2 lines · Anish Patel

please add device id 0x7a for the LM94 as well.

Hint - top posting is discouraged.

sorry, won't do it again

Quoted 3 lines

I don't mind, but not even the "official" datasheet from National (dated 07/15/2010) lists 0x7a as supported stepping. Do you have information that this version of the chip exists ?

yes, i have about 15 boards here with an LM94 that have the 0x7a ID i will post the i2cdump tomorrow morning.

Quoted 90 lines

Thanks,
Guenter

Quoted 87 lines

thanks

Quoted 84 lines · Guenter Roeck

This patch adds basic support for LM94 to the LM93 driver. LM94 specific sensors and features are not supported.

---
   Documentation/hwmon/lm93 |    7 +++++++
   drivers/hwmon/lm93.c     |   19 +++++++++++++++++--
   2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/hwmon/lm93 +7 -0
index 7a10616..f3b2ad2 100644
@@ -6,6 +6,10 @@ Supported chips:
       Prefix 'lm93'
       Addresses scanned: I2C 0x2c-0x2e
       Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
+  * National Semiconductor LM94
+    Prefix 'lm94'
+    Addresses scanned: I2C 0x2c-0x2e
+    Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
 
   Authors:
   	Mark M. Hoffman<[email protected]>
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
   for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
   processor Xeon class motherboard with a minimum of external components.
 
+LM94 is also supported in LM93 compatible mode. Extra sensors and features of
+LM94 are not supported.
+
 
   User Interface
   --------------
drivers/hwmon/lm93.c +16 -2
index c9ed14e..4a8b984 100644
@@ -135,6 +135,10 @@
   #define LM93_MFR_ID		0x73
   #define LM93_MFR_ID_PROTOTYPE	0x72
 
+/* LM94 REGISTER VALUES */
+#define LM94_MFR_ID		0x79
+#define LM94_MFR_ID_PROTOTYPE	0x78
+
   /* SMBus capabilities */
   #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
   		I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2508,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
   {
   	struct i2c_adapter *adapter = client->adapter;
   	int mfr, ver;
+	const char *name;
 
   	if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
   		return -ENODEV;
@@ -2517,13 +2522,22 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
   	}
 
   	ver = lm93_read_byte(client, LM93_REG_VER);
-	if (ver != LM93_MFR_ID&&   ver != LM93_MFR_ID_PROTOTYPE) {
+	switch (ver) {
+	case LM93_MFR_ID:
+	case LM93_MFR_ID_PROTOTYPE:
+		name = "lm93";
+		break;
+	case LM94_MFR_ID:
+	case LM94_MFR_ID_PROTOTYPE:
+		name = "lm94";
+		break;
+	default:
   		dev_dbg(&adapter->dev,
   			"detect failed, bad version id 0x%02x!\n", ver);
   		return -ENODEV;
   	}
 
-	strlcpy(info->type, "lm93", I2C_NAME_SIZE);
+	strlcpy(info->type, name, I2C_NAME_SIZE);
   	dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
   		client->name, i2c_adapter_id(client->adapter),
   		client->addr);
@@ -2602,6 +2616,7 @@ static int lm93_remove(struct i2c_client *client)
 
Quoted 8 lines
Quoted 6 lines

drivers/hwmon/lm93.c static int lm93_remove(struct i2c_client *client) · line 2622

Quoted 6 lines
drivers/hwmon/lm93.c +1 -0
   static const struct i2c_device_id lm93_id[] = {
   	{ "lm93", 0 },
+	{ "lm94", 0 },
   	{ }
   };
   MODULE_DEVICE_TABLE(i2c, lm93_id);

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

#4 lore raw
In reply to Anish Patel
Quoted 99 lines · Guenter Roeck
Quoted 2 lines · Anish Patel

please add device id 0x7a for the LM94 as well.

Hint - top posting is discouraged.

I don't mind, but not even the "official" datasheet from National (dated 07/15/2010) lists 0x7a as supported stepping. Do you have information that this version of the chip exists ?

Thanks,
Guenter

Quoted 87 lines

thanks

Quoted 84 lines · Guenter Roeck

This patch adds basic support for LM94 to the LM93 driver. LM94 specific sensors and features are not supported.

---
   Documentation/hwmon/lm93 |    7 +++++++
   drivers/hwmon/lm93.c     |   19 +++++++++++++++++--
   2 files changed, 24 insertions(+), 2 deletions(-)
Documentation/hwmon/lm93 +7 -0
index 7a10616..f3b2ad2 100644
@@ -6,6 +6,10 @@ Supported chips:
       Prefix 'lm93'
       Addresses scanned: I2C 0x2c-0x2e
       Datasheet: http://www.national.com/ds.cgi/LM/LM93.pdf
+  * National Semiconductor LM94
+    Prefix 'lm94'
+    Addresses scanned: I2C 0x2c-0x2e
+    Datasheet: http://www.national.com/ds.cgi/LM/LM94.pdf
 
   Authors:
   	Mark M. Hoffman<[email protected]>
@@ -56,6 +60,9 @@ previous motherboard management ASICs and uses some of the LM85's features
   for dynamic Vccp monitoring and PROCHOT. It is designed to monitor a dual
   processor Xeon class motherboard with a minimum of external components.
 
+LM94 is also supported in LM93 compatible mode. Extra sensors and features of
+LM94 are not supported.
+
 
   User Interface
   --------------
drivers/hwmon/lm93.c +16 -2
index c9ed14e..4a8b984 100644
@@ -135,6 +135,10 @@
   #define LM93_MFR_ID		0x73
   #define LM93_MFR_ID_PROTOTYPE	0x72
 
+/* LM94 REGISTER VALUES */
+#define LM94_MFR_ID		0x79
+#define LM94_MFR_ID_PROTOTYPE	0x78
+
   /* SMBus capabilities */
   #define LM93_SMBUS_FUNC_FULL (I2C_FUNC_SMBUS_BYTE_DATA | \
   		I2C_FUNC_SMBUS_WORD_DATA | I2C_FUNC_SMBUS_BLOCK_DATA)
@@ -2504,6 +2508,7 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
   {
   	struct i2c_adapter *adapter = client->adapter;
   	int mfr, ver;
+	const char *name;
 
   	if (!i2c_check_functionality(adapter, LM93_SMBUS_FUNC_MIN))
   		return -ENODEV;
@@ -2517,13 +2522,22 @@ static int lm93_detect(struct i2c_client *client, struct i2c_board_info *info)
   	}
 
   	ver = lm93_read_byte(client, LM93_REG_VER);
-	if (ver != LM93_MFR_ID&&   ver != LM93_MFR_ID_PROTOTYPE) {
+	switch (ver) {
+	case LM93_MFR_ID:
+	case LM93_MFR_ID_PROTOTYPE:
+		name = "lm93";
+		break;
+	case LM94_MFR_ID:
+	case LM94_MFR_ID_PROTOTYPE:
+		name = "lm94";
+		break;
+	default:
   		dev_dbg(&adapter->dev,
   			"detect failed, bad version id 0x%02x!\n", ver);
   		return -ENODEV;
   	}
 
-	strlcpy(info->type, "lm93", I2C_NAME_SIZE);
+	strlcpy(info->type, name, I2C_NAME_SIZE);
   	dev_dbg(&adapter->dev,"loading %s at %d,0x%02x\n",
   		client->name, i2c_adapter_id(client->adapter),
   		client->addr);
@@ -2602,6 +2616,7 @@ static int lm93_remove(struct i2c_client *client)
 
Quoted 8 lines
Quoted 6 lines

drivers/hwmon/lm93.c static int lm93_remove(struct i2c_client *client) · line 2622

Quoted 6 lines
drivers/hwmon/lm93.c +1 -0
   static const struct i2c_device_id lm93_id[] = {
   	{ "lm93", 0 },
+	{ "lm94", 0 },
   	{ }
   };
   MODULE_DEVICE_TABLE(i2c, lm93_id);

dump of LM94

i2cdump -y 0 0x2e
No size specified (using byte-data access)

      0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
00: 00 00 00 00 00 00 35 80 35 80 00 00 00 00 00 00    ......5?5?......
10: 80 35 80 35 00 80 00 80 80 35 80 35 00 80 00 80    ?5?5.?.??5?5.?.?
20: 00 22 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ."..............
30: 00 00 00 00 00 30 00 00 00 80 80 00 00 00 01 7a    .....0...??...?z
40: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
50: 35 80 22 00 35 80 bd bd bc af c2 bc b0 ae c5 c3    5?".5???????????
60: 73 ab d4 ed ff c1 00 00 00 00 00 2c 00 00 fc ff    s???.?.....,..?.
70: fc ff fc ff fc ff 00 00 80 80 80 80 80 80 80 80    ?.?.?...????????
80: 3c 3c 23 23 00 00 00 00 00 00 00 00 00 00 00 00<<##............
90: 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff    ................
a0: 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff 00 ff    ................
b0: ff ff 17 17 fc ff fc ff fc ff fc ff 00 00 00 00    ..???.?.?.?.....
c0: 44 44 00 00 00 00 00 11 00 00 00 00 00 00 00 00    DD.....?........
d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
e0: 00 3f 00 80 03 ff 0f ff 0f 07 ff 07 ff 3f 00 00    .?.??.?.??.?.?..
f0: 09 09 08 08 06 10 04 08 0c 20 08 08 10 09 09 09    ????????? ??????

img - http://img152.imageshack.us/img152/5526/dsc00870w.jpg

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors