From a8acdd0d8879d3a2be96c72196dc4924ad27f5a2 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 22 Oct 2008 16:25:11 +0000 Subject: [PATCH] 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. (Backport from Linux 2.6.) git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@5371 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/chips/lm78.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGES b/CHANGES index 2f83e172..a7172c15 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,7 @@ SVN-HEAD Properly report bus arbitration lost (2.6 backport) Module i2c-piix4: Minor cleanups (2.6 backport) Module i2c-viapro: Add VX800/VX820 support (2.6 backport) + Module lm78: Prevent misdetection of Winbond chips Module lm90: Don't spam the kernel log (2.6 backport) Program pwmconfig: Fix MINSTOP and MINSTART test functions (#2340) Change default for MINTEMP from 0 to 20 degrees C diff --git a/kernel/chips/lm78.c b/kernel/chips/lm78.c index cd57e977..055dde49 100644 --- a/kernel/chips/lm78.c +++ b/kernel/chips/lm78.c @@ -329,6 +329,10 @@ static int lm78_detect(struct i2c_adapter *adapter, int address, if (!is_isa && (lm78_read_value(new_client, LM78_REG_I2C_ADDR) != address)) goto ERROR1; + /* Explicitly prevent the misdetection of Winbond chips */ + i = lm78_read_value(new_client, 0x4f); + if (i == 0xa3 || i == 0x5c) + goto ERROR1; } /* Determine the chip type. */