Changeset 726
- Timestamp:
- 02/04/00 01:16:44 (9 years ago)
- Files:
-
- lm-sensors/trunk/kernel/busses/i2c-amd756.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
lm-sensors/trunk/kernel/busses/i2c-amd756.c
r707 r726 41 41 42 42 /* AMD756 SMBus address offsets */ 43 #define SMB_GLOBAL_STATUS (0xE0 + amd756_smba) 44 #define SMB_GLOBAL_ENABLE (0xE2 + amd756_smba) 45 #define SMB_HOST_ADDRESS (0xE4 + amd756_smba) 46 #define SMB_HOST_DATA (0xE6 + amd756_smba) 47 #define SMB_HOST_COMMAND (0xE8 + amd756_smba) 48 #define SMB_HOST_BLOCK_DATA (0xE9 + amd756_smba) 49 #define SMB_HAS_DATA (0xEA + amd756_smba) 50 #define SMB_HAS_DEVICE_ADDRESS (0xEC + amd756_smba) 51 #define SMB_HAS_HOST_ADDRESS (0xEE + amd756_smba) 52 #define SMB_SNOOP_ADDRESS (0xEF + amd756_smba) 43 #define SMB_ADDR_OFFSET 0xE0 44 #define SMB_IOSIZE 16 45 #define SMB_GLOBAL_STATUS (0x0 + amd756_smba) 46 #define SMB_GLOBAL_ENABLE (0x2 + amd756_smba) 47 #define SMB_HOST_ADDRESS (0x4 + amd756_smba) 48 #define SMB_HOST_DATA (0x6 + amd756_smba) 49 #define SMB_HOST_COMMAND (0x8 + amd756_smba) 50 #define SMB_HOST_BLOCK_DATA (0x9 + amd756_smba) 51 #define SMB_HAS_DATA (0xA + amd756_smba) 52 #define SMB_HAS_DEVICE_ADDRESS (0xC + amd756_smba) 53 #define SMB_HAS_HOST_ADDRESS (0xE + amd756_smba) 54 #define SMB_SNOOP_ADDRESS (0xF + amd756_smba) 53 55 54 56 /* PCI Address Constants */ … … 159 161 } 160 162 161 /* Determine the address of the SMBus areas */ 162 163 164 pci_read_config_byte(AMD756_dev, SMBGCFG, &temp); 165 if ((temp & 128) == 0) { 166 printk 167 ("SMBUS: Error: Host SMBus controller I/O not enabled!\n"); 168 error_return = -ENODEV; 169 goto END; 170 } 171 172 /* Determine the address of the SMBus areas */ 163 173 /* Technically it is a dword but... */ 164 174 pci_read_config_word(AMD756_dev, SMBBA, &amd756_smba); 165 amd756_smba &= 0xfff0; 166 167 if (check_region(amd756_smba, 8)) { 175 amd756_smba &= 0xff00; 176 amd756_smba += SMB_ADDR_OFFSET; 177 178 if (check_region(amd756_smba, SMB_IOSIZE)) { 168 179 printk 169 180 ("i2c-amd756.o: AMD756_smb region 0x%x already in use!\n", … … 173 184 } 174 185 175 pci_read_config_byte(AMD756_dev, SMBGCFG, &temp);176 177 if ((temp & 128) == 0) {178 printk179 ("SMBUS: Error: Host SMBus controller I/O not enabled!\n");180 error_return = -ENODEV;181 goto END;182 }183 184 186 /* Everything is happy, let's grab the memory and set things up. */ 185 request_region(amd756_smba, 8, "amd756-smbus");187 request_region(amd756_smba, SMB_IOSIZE, "amd756-smbus"); 186 188 187 189 #ifdef DEBUG … … 487 489 } 488 490 if (amd756_initialized >= 1) { 489 release_region(amd756_smba, 8);491 release_region(amd756_smba, SMB_IOSIZE); 490 492 amd756_initialized--; 491 493 }
