Skip to contentSkip to conversation

hwmon: (smsc47m1) Differentiate between

PATCH In review Jean Delvare 2 participants 2 messages Jul 20, 2009 – Jul 26, 2009 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hwmon: (smsc47m1) Differentiate between

The SMSC LPC47M233 and LPC47M292 chips have the same device ID but are not compatible.

Cc Juerg Haefliger <[email protected]>
---
 drivers/hwmon/smsc47m1.c |   11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/hwmon/smsc47m1.c +11 -0
@@ -86,6 +86,7 @@ superio_exit(void)
 #define SUPERIO_REG_ACT		0x30
 #define SUPERIO_REG_BASE	0x60
 #define SUPERIO_REG_DEVID	0x20
+#define SUPERIO_REG_DEVREV	0x21
 
 /* Logical device registers */
 
@@ -429,6 +430,9 @@ static int __init smsc47m1_find(unsigned
 	 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it
 	 * supports a 3rd fan, and the pin configuration registers are
 	 * unfortunately different.
+	 * The LPC47M233 has the same device id (0x6B) but is not compatible.
+	 * We check the high bit of the device revision register to
+	 * differentiate them.
 	 */
 	switch (val) {
 	case 0x51:
@@ -448,6 +452,13 @@ static int __init smsc47m1_find(unsigned
 		sio_data->type = smsc47m1;
 		break;
 	case 0x6B:
+		if (superio_inb(SUPERIO_REG_DEVREV) & 0x80) {
+			pr_debug(DRVNAME ": "
+				 "Found SMSC LPC47M233, unsupported\n");
+			superio_exit();
+			return -ENODEV;
+		}
+
 		pr_info(DRVNAME ": Found SMSC LPC47M292\n");
 		sio_data->type = smsc47m2;
 		break;
Signature · 6 lines
Jean Delvare

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
Acked-by on v1 1/1
#1 lore raw

Looks good to me,

Regards,

Hans

Quoted 35 lines · Jean Delvare

The SMSC LPC47M233 and LPC47M292 chips have the same device ID but are not compatible.

Cc Juerg Haefliger<[email protected]>
---
  drivers/hwmon/smsc47m1.c |   11 +++++++++++
  1 file changed, 11 insertions(+)
drivers/hwmon/smsc47m1.c +4 -0
@@ -86,6 +86,7 @@ superio_exit(void)
  #define SUPERIO_REG_ACT		0x30
  #define SUPERIO_REG_BASE	0x60
  #define SUPERIO_REG_DEVID	0x20
+#define SUPERIO_REG_DEVREV	0x21
 
  /* Logical device registers */
 
@@ -429,6 +430,9 @@ static int __init smsc47m1_find(unsigned
  	 * The LPC47M292 (device id 0x6B) is somewhat compatible, but it
  	 * supports a 3rd fan, and the pin configuration registers are
  	 * unfortunately different.
+	 * The LPC47M233 has the same device id (0x6B) but is not compatible.
+	 * We check the high bit of the device revision register to
+	 * differentiate them.
  	 */
  	switch (val) {
  	case 0x51:
@@ -448,6 +452,13 @@ static int __init smsc47m1_find(unsigned
  		sio_data->type = smsc47m1;
  		break;
  	case 0x6B:

drivers/hwmon/smsc47m1.c static int __init smsc47m1_find(unsigned · line 464

Quoted 10 lines
drivers/hwmon/smsc47m1.c +7 -0
+		if (superio_inb(SUPERIO_REG_DEVREV)&  0x80) {
+			pr_debug(DRVNAME ": "
+				 "Found SMSC LPC47M233, unsupported\n");
+			superio_exit();
+			return -ENODEV;
+		}
+
  		pr_info(DRVNAME ": Found SMSC LPC47M292\n");
  		sio_data->type = smsc47m2;
  		break;

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