Skip to contentSkip to conversation

hwmon: (lm78) Prevent misdetection of

PATCH New Jean Delvare 1 participant 1 message Sep 11, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 3/5 hwmon: (lm78) Prevent misdetection of

The LM78 detection is relatively weak, and sometimes recent Winbond chips can be misdetected as an LM78. We have had repeated reports of this happening. We have an explicit check against this for the ISA access, do the same for I2C access now.

---
 drivers/hwmon/lm78.c |    6 ++++++
 1 file changed, 6 insertions(+)
drivers/hwmon/lm78.c +6 -0
@@ -613,6 +613,12 @@ static int lm78_detect(struct i2c_adapte
 			err = -ENODEV;
 			goto ERROR2;
 		}
+		/* Explicitly prevent the misdetection of Winbond chips */
+		i = lm78_read_value(data, 0x4f);
+		if (i = 0xa3 || i = 0x5c) {
+			err = -ENODEV;
+			goto ERROR2;
+		}
 	}
 
 	/* Determine the chip type. */
Signature · 6 lines
Jean Delvare

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