diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-10-17 11:51:15 -0400 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-10-17 11:51:15 -0400 |
commit | ad3273be8e2a5bfe16f4940beef3da308daf259a (patch) | |
tree | da0660fa8f7e4dfa44ecaf6750fe47c5f223e074 /drivers | |
parent | 18c73f90421f9a87a0f6bc3a08880d0f1f9b2a74 (diff) |
hwmon: (lm78) Prevent misdetection of Winbond chips
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.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hwmon/lm78.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c index ec601bbf91b..f284ecbb9ca 100644 --- a/drivers/hwmon/lm78.c +++ b/drivers/hwmon/lm78.c | |||
@@ -613,6 +613,12 @@ static int lm78_detect(struct i2c_adapter *adapter, int address, int kind) | |||
613 | err = -ENODEV; | 613 | err = -ENODEV; |
614 | goto ERROR2; | 614 | goto ERROR2; |
615 | } | 615 | } |
616 | /* Explicitly prevent the misdetection of Winbond chips */ | ||
617 | i = lm78_read_value(data, 0x4f); | ||
618 | if (i == 0xa3 || i == 0x5c) { | ||
619 | err = -ENODEV; | ||
620 | goto ERROR2; | ||
621 | } | ||
616 | } | 622 | } |
617 | 623 | ||
618 | /* Determine the chip type. */ | 624 | /* Determine the chip type. */ |