Changeset 4061
- Timestamp:
- 06/23/06 23:05:37 (7 years ago)
- Location:
- lm-sensors/trunk
- Files:
-
- 2 modified
-
CHANGES (modified) (1 diff)
-
kernel/busses/i2c-i801.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lm-sensors/trunk/CHANGES
r4060 r4061 19 19 Fix block transaction poll loops (2.6 backport) 20 20 Remove PCI function check (2.6 backport) 21 Cleanups (2.6 backport) 21 22 Module i2c-nforce2: Add nForce4 MCP51, MCP55 support (2.6 backport) 22 23 Module i2c-piix4: Add ServerWorks HT-1000 support (2.6 backport) -
lm-sensors/trunk/kernel/busses/i2c-i801.c
r4060 r4061 1 1 /* 2 i 801.c - Part of lm_sensors, Linux kernel modules for hardware2 i2c-i801.c - Part of lm_sensors, Linux kernel modules for hardware 3 3 monitoring 4 4 Copyright (c) 1998 - 2002 Frodo Looijaard <frodol@dds.nl>, … … 162 162 static int isich5; /* is i2c block read supported? */ 163 163 164 static int i801_setup(struct pci_dev *dev) 165 { 166 int error_return = 0; 164 static int __devinit i801_setup(struct pci_dev *dev) 165 { 167 166 unsigned char temp; 168 167 … … 180 179 isich5 = isich4 && dev->device != PCI_DEVICE_ID_INTEL_82801DB_3; 181 180 182 /* Determine the address of the SMBus area s*/181 /* Determine the address of the SMBus area */ 183 182 if (force_addr) { 184 183 i801_smba = force_addr & 0xfff0; … … 196 195 dev_err(dev, "I801_smb region 0x%x already in use!\n", 197 196 i801_smba); 198 error_return = -EBUSY; 199 goto END; 197 return -EBUSY; 200 198 } 201 199 … … 207 205 sure, we disable the device first. */ 208 206 if (force_addr) { 209 pci_write_config_byte(I801_dev, SMBHSTCFG, temp & 0xfe); 207 pci_write_config_byte(I801_dev, SMBHSTCFG, 208 temp & ~SMBHSTCFG_HST_EN); 210 209 pci_write_config_word(I801_dev, SMBBA, i801_smba); 211 pci_write_config_byte(I801_dev, SMBHSTCFG, temp | 0x01); 210 pci_write_config_byte(I801_dev, SMBHSTCFG, 211 temp | SMBHSTCFG_HST_EN); 212 212 dev_warn(dev, "WARNING: I801 SMBus interface set to " 213 213 "new address %04x!\n", i801_smba); 214 } else if ((temp & 1) == 0) { 215 pci_write_config_byte(I801_dev, SMBHSTCFG, temp | 1); 214 } else if (!(temp & SMBHSTCFG_HST_EN)) { 215 pci_write_config_byte(I801_dev, SMBHSTCFG, 216 temp | SMBHSTCFG_HST_EN); 216 217 dev_warn(dev, "enabling SMBus device\n"); 217 218 } 218 219 219 if (temp & 0x02)220 if (temp & SMBHSTCFG_SMB_SMI_EN) 220 221 dev_dbg(dev, "I801 using Interrupt SMI# for SMBus.\n"); 221 222 else … … 226 227 dev_dbg(dev, "I801_smba = 0x%X\n", i801_smba); 227 228 228 END: 229 return error_return; 229 return 0; 230 230 } 231 231 … … 681 681 static int __devinit i801_probe(struct pci_dev *dev, const struct pci_device_id *id) 682 682 { 683 684 if (i801_setup(dev)) { 685 dev_warn(dev, 686 "I801 not detected, module not inserted.\n"); 687 return -ENODEV; 688 } 683 int err; 684 685 if ((err = i801_setup(dev))) 686 return err; 689 687 690 688 snprintf(i801_adapter.name, 32,
