diff --git a/CHANGES b/CHANGES index d75c584f..83da4089 100644 --- a/CHANGES +++ b/CHANGES @@ -42,7 +42,7 @@ ask CVS about it: Module mtp008: Fix temp initializations; Save BIOS pin configuration of temps and fans Module sensors: Disabled, moved to i2c package as i2c-proc.c - Module sis5595: Fix temp, add in4. + Module sis5595: Fix temp, add in4 for chip revision 0xc0. Module via686a: Allow force=9191,address (for A7V/K7V boards) Module w83781d: Don't reinitialize as99127f chip; this may cause fan/temp reading changes @@ -57,7 +57,8 @@ ask CVS about it: Change mtp008 temps from max/min to limit/hyst. Program sensors-detect: Recognize lm78 with chipid=0x20; Recognize SMSC Victory66 South Bridge; - Add devfs /dev/i2c/x support + Add devfs /dev/i2c/x support; + Add thinkpad warning. Program tellerstats: new 2.5.5 (20010115) diff --git a/doc/chips/sis5595 b/doc/chips/sis5595 index 568451cb..30027920 100644 --- a/doc/chips/sis5595 +++ b/doc/chips/sis5595 @@ -9,6 +9,11 @@ Supported chips: Addresses scanned: ISA in PCI-space encoded address Datasheet: Publicly available at the Silicon Integrated Systems Corp. site. + Supports following revisions: + Version PCI ID PCI Revision + 1 1039/0008 01 + 2 1039/0008 C0 + Author: Kyösti Mälkki @@ -27,7 +32,11 @@ For the I2C bus driver see i2c-sis5595. The SiS5595 implements zero or one temperature sensor, two FAN speed sensors, four or five voltage sensors, and alarms. -The temperature sensor (temp) and the fifth voltage sensor (in4) share a pin +On the first version of the chip, there are four voltage +sensors and one temperature sensor. + +On the second version of the chip, +the temperature sensor (temp) and the fifth voltage sensor (in4) share a pin which is configurable, but not through the driver. Sorry. The driver senses the configuration of the pin, which was hopefully set by the BIOS. diff --git a/kernel/chips/sis5595.c b/kernel/chips/sis5595.c index cee692d7..f3a14591 100644 --- a/kernel/chips/sis5595.c +++ b/kernel/chips/sis5595.c @@ -21,6 +21,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* + Supports following revisions: + Version PCI ID PCI Revision + 1 1039/0008 01 + 2 1039/0008 C0 +*/ + #include #include #include @@ -67,6 +74,7 @@ SENSORS_INSMOD_1(sis5595); /* Length of ISA address segment */ #define SIS5595_EXTENT 8 /* PCI Config Registers */ +#define SIS5595_REVISION_REG 0x08 #define SIS5595_BASE_REG 0x68 #define SIS5595_PIN_REG 0x7A #define SIS5595_ENABLE_REG 0x7B @@ -83,12 +91,18 @@ SENSORS_INSMOD_1(sis5595); #define SIS5595_REG_FAN_MIN(nr) (0x3a + (nr)) #define SIS5595_REG_FAN(nr) (0x27 + (nr)) -/* TEMP pin is shared with IN4, configured in PCI register 0x7A. */ -/* The registers are the same as well. */ -/* OVER and HYST are really MAX and MIN. */ -#define SIS5595_REG_TEMP SIS5595_REG_IN(4) -#define SIS5595_REG_TEMP_OVER SIS5595_REG_IN_MAX(4) -#define SIS5595_REG_TEMP_HYST SIS5595_REG_IN_MIN(4) +/* On the first version of the chip, the temp registers are separate. + On the second version, + TEMP pin is shared with IN4, configured in PCI register 0x7A. + The registers are the same as well. + OVER and HYST are really MAX and MIN. */ + +#define SIS5595_REG_TEMP (( data->revision) >= 0xc0) ? \ + SIS5595_REG_IN(4) : 0x27 +#define SIS5595_REG_TEMP_OVER (( data->revision) >= 0xc0) ? \ + SIS5595_REG_IN_MAX(4) : 0x39 +#define SIS5595_REG_TEMP_HYST (( data->revision) >= 0xc0) ? \ + SIS5595_REG_IN_MIN(4) : 0x3a #define SIS5595_REG_CONFIG 0x40 #define SIS5595_REG_ALARM1 0x41 @@ -177,6 +191,7 @@ struct sis5595_data { char valid; /* !=0 if following fields are valid */ unsigned long last_updated; /* In jiffies */ char maxins; /* == 3 if temp enabled, otherwise == 4 */ + u8 revision; /* Reg. value */ u8 in[5]; /* Register value */ u8 in_max[5]; /* Register value */ @@ -357,13 +372,18 @@ int sis5595_detect(struct i2c_adapter *adapter, int address, /* Reserve the ISA region */ request_region(address, SIS5595_EXTENT, type_name); - pci_read_config_byte(s_bridge, SIS5595_PIN_REG, &val); - if(val & 0x80) - /* 3 voltages, 1 temp */ + pci_read_config_byte(s_bridge, SIS5595_PIN_REG, &(data->revision)); + if(data->revision < 0xc0) { data->maxins = 3; - else - /* 4 voltages, no temps */ - data->maxins = 4; + } else { + pci_read_config_byte(s_bridge, SIS5595_PIN_REG, &val); + if(val & 0x80) + /* 3 voltages, 1 temp */ + data->maxins = 3; + else + /* 4 voltages, no temps */ + data->maxins = 4; + } /* Fill in the remaining client fields and put it into the global list */ strcpy(new_client->name, client_name);