Changeset 726

Show
Ignore:
Timestamp:
02/04/00 01:16:44 (9 years ago)
Author:
mds
Message:

(mds) fix request_region() call. Was requesting xx00 - xx07, now

correctly requesting xxE0 - xxEF. Should resolve conflict with
ACPI.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/kernel/busses/i2c-amd756.c

    r707 r726  
    4141 
    4242/* 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) 
    5355 
    5456/* PCI Address Constants */ 
     
    159161        } 
    160162 
    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 */ 
    163173        /* Technically it is a dword but... */ 
    164174        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)) { 
    168179                printk 
    169180                    ("i2c-amd756.o: AMD756_smb region 0x%x already in use!\n", 
     
    173184        } 
    174185 
    175         pci_read_config_byte(AMD756_dev, SMBGCFG, &temp); 
    176  
    177         if ((temp & 128) == 0) { 
    178                 printk 
    179                     ("SMBUS: Error: Host SMBus controller I/O not enabled!\n"); 
    180                 error_return = -ENODEV; 
    181                 goto END; 
    182         } 
    183  
    184186        /* 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"); 
    186188 
    187189#ifdef DEBUG 
     
    487489        } 
    488490        if (amd756_initialized >= 1) { 
    489                 release_region(amd756_smba, 8); 
     491                release_region(amd756_smba, SMB_IOSIZE); 
    490492                amd756_initialized--; 
    491493        }