From ec50f22d9ddf9b0fc66809b321f18758a7343f34 Mon Sep 17 00:00:00 2001 From: "Mark D. Studebaker" Date: Sat, 13 Oct 2001 03:51:49 +0000 Subject: [PATCH] fix support for rev B0. git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1199 7894878c-1315-0410-8ee3-d5d059ff63e0 --- CHANGES | 1 + kernel/chips/sis5595.c | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 0ecaa31e..dcf44db3 100644 --- a/CHANGES +++ b/CHANGES @@ -25,6 +25,7 @@ ask CVS about it: Module i2c-i801: Add 82801CA/CAM support Module i2c-piix4: Add Intel 82443MX and SMSC Victory66 support Module i2c-viapro: Add Via VT8233 support + Module sis5595: Fix support for rev B0 Module via686a: Make limit initializations reliable Program sensors-detect: Add ALI1535 detection, add Intel 82443MX and 82801CA/CAM detection, diff --git a/kernel/chips/sis5595.c b/kernel/chips/sis5595.c index 6d084eee..6f1367c9 100644 --- a/kernel/chips/sis5595.c +++ b/kernel/chips/sis5595.c @@ -24,8 +24,8 @@ /* Supports following revisions: Version PCI ID PCI Revision - 1 1039/0008 01 - 2 1039/0008 C0 + 1 1039/0008 AF or less + 2 1039/0008 B0 or greater Note: these chips contain a 0008 device which is incompatible with the 5595. We recognize these by the presence of the listed @@ -146,11 +146,12 @@ static int blacklist[] = { The registers are the same as well. OVER and HYST are really MAX and MIN. */ -#define SIS5595_REG_TEMP (( data->revision) >= 0xc0) ? \ +#define REV2MIN 0xb0 +#define SIS5595_REG_TEMP (( data->revision) >= REV2MIN) ? \ SIS5595_REG_IN(4) : 0x27 -#define SIS5595_REG_TEMP_OVER (( data->revision) >= 0xc0) ? \ +#define SIS5595_REG_TEMP_OVER (( data->revision) >= REV2MIN) ? \ SIS5595_REG_IN_MAX(4) : 0x39 -#define SIS5595_REG_TEMP_HYST (( data->revision) >= 0xc0) ? \ +#define SIS5595_REG_TEMP_HYST (( data->revision) >= REV2MIN) ? \ SIS5595_REG_IN_MIN(4) : 0x3a #define SIS5595_REG_CONFIG 0x40 @@ -463,7 +464,7 @@ int sis5595_detect(struct i2c_adapter *adapter, int address, /* Check revision and pin registers to determine whether 3 or 4 voltages */ pci_read_config_byte(s_bridge, SIS5595_REVISION_REG, &(data->revision)); - if(data->revision < 0xb0) { + if(data->revision < REV2MIN) { data->maxins = 3; } else { pci_read_config_byte(s_bridge, SIS5595_PIN_REG, &val);