Changeset 1154

Show
Ignore:
Timestamp:
08/03/01 03:25:11 (7 years ago)
Author:
mds
Message:

add support for AMD 766 to i2c-amd756. Appears to be compatible w/ 756.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lm-sensors/trunk/CHANGES

    r1150 r1154  
    2525  Library: ds1621 and it87 updates 
    2626  Module i2c-ali15x3: Allow force_addr=0xaddr; enable if not enabled. 
     27  Module i2c-amd756: Add AMD 766 support 
    2728  Module i2c-i801: Fix 82801BA detection broken by kernel 2.4.6 
    2829  Module i2c-sis5595: Recognize unsupported chips and refuse to load 
     
    3334  Module w83781d: Fix fan speed for as99127f (broken by 2.6.0) 
    3435  Program sensors: it87 updates 
    35   Program sensors-detect: Fix ADM1024 and ADM1025 detection. 
     36  Program sensors-detect: Fix ADM1024 and ADM1025 detection; 
     37                          recognize unsupported SiS chips; 
     38                          recognize AMD 766. 
    3639 
    37402.6.0 (20010612) 
  • lm-sensors/trunk/README

    r1137 r1154  
    3333At least the following I2C/SMBus adapters are supported: 
    3434  Acer Labs M1533, M1535, and M1543C 
    35   AMD 756 
     35  AMD 756, 766 
    3636  Apple Hydra (used on some PPC machines) 
    3737  DEC 21272/21274 (Tsunami/Typhoon - on Alpha boards) 
  • lm-sensors/trunk/kernel/busses/i2c-amd756.c

    r949 r1154  
    2525*/ 
    2626 
    27 /* Note: we assume there can only be one AMD756, with one SMBus interface */ 
     27/* 
     28   Supports AMD756 and AMD766. 
     29   Note: we assume there can only be one device, with one SMBus interface. 
     30*/ 
    2831 
    2932#include <linux/version.h> 
     
    3942 
    4043#include <linux/init.h> 
     44 
     45#ifndef PCI_DEVICE_ID_AMD_756 
     46#define PCI_DEVICE_ID_AMD_756 0x740B 
     47#endif 
     48#ifndef PCI_DEVICE_ID_AMD_766 
     49#define PCI_DEVICE_ID_AMD_766 0x7413 
     50#endif 
     51 
     52static int supported[] = {PCI_DEVICE_ID_AMD_756, 
     53                          PCI_DEVICE_ID_AMD_766, 
     54                          0 }; 
    4155 
    4256/* AMD756 SMBus address offsets */ 
     
    105119        /* master_xfer */ NULL, 
    106120        /* smbus_access */ amd756_access, 
    107         /* slave_send */ NULL, 
     121        /* slave;_send */ NULL, 
    108122        /* slave_rcv */ NULL, 
    109123        /* algo_control */ NULL, 
     
    125139static unsigned short amd756_smba = 0; 
    126140 
    127 /* externalize it */ 
    128 #define PCI_DEVICE_ID_AMD_756 0x740B 
    129  
    130141/* Detect whether a AMD756 can be found, and initialize it, where necessary. 
    131142   Note the differences between kernels with the old PCI BIOS interface and 
     
    136147        int error_return = 0; 
    137148        unsigned char temp; 
    138  
    139         struct pci_dev *AMD756_dev
     149        int *num = supported; 
     150        struct pci_dev *AMD756_dev = NULL
    140151 
    141152        /* First check whether we can access PCI at all */ 
    142153        if (pci_present() == 0) { 
    143154                printk("i2c-amd756.o: Error: No PCI-bus found!\n"); 
    144                 error_return = -ENODEV; 
    145                 goto END; 
     155                return(-ENODEV); 
    146156        } 
    147157 
    148158        /* Look for the AMD756, function 3 */ 
    149159        /* Note: we keep on searching until we have found 'function 3' */ 
    150         AMD756_dev = NULL; 
    151         do 
    152                 AMD756_dev = pci_find_device(PCI_VENDOR_ID_AMD, 
    153                                              PCI_DEVICE_ID_AMD_756, 
    154                                              AMD756_dev); 
    155         while (AMD756_dev && (PCI_FUNC(AMD756_dev->devfn) != 3)); 
     160        do { 
     161                if((AMD756_dev = pci_find_device(PCI_VENDOR_ID_AMD, 
     162                                              *num, AMD756_dev))) { 
     163                        if(PCI_FUNC(AMD756_dev->devfn) != 3) 
     164                                continue; 
     165                        break; 
     166                } 
     167                num++; 
     168        } while (*num != 0); 
     169 
    156170        if (AMD756_dev == NULL) { 
    157171                printk 
    158172                    ("i2c-amd756.o: Error: Can't detect AMD756, function 3!\n"); 
    159                 error_return = -ENODEV; 
    160                 goto END; 
     173                return(-ENODEV); 
    161174        } 
    162175 
     
    166179                printk 
    167180                    ("SMBUS: Error: Host SMBus controller I/O not enabled!\n"); 
    168                 error_return = -ENODEV; 
    169                 goto END; 
     181                return(-ENODEV); 
    170182        } 
    171183 
     
    180192                    ("i2c-amd756.o: AMD756_smb region 0x%x already in use!\n", 
    181193                     amd756_smba); 
    182                 error_return = -ENODEV; 
    183                 goto END; 
     194                return(-ENODEV); 
    184195        } 
    185196 
     
    203214#endif                          /* DEBUG */ 
    204215 
    205       END: 
    206         return error_return; 
     216        return 0; 
    207217} 
    208218 
     
    459469        if ((res = amd756_setup())) { 
    460470                printk 
    461                     ("i2c-amd756.o: AMD756 not detected, module not inserted.\n"); 
     471                    ("i2c-amd756.o: AMD756/766 not detected, module not inserted.\n"); 
    462472                amd756_cleanup(); 
    463473                return res; 
    464474        } 
    465475        amd756_initialized++; 
    466         sprintf(amd756_adapter.name, "SMBus AMD756 adapter at %04x", 
     476        sprintf(amd756_adapter.name, "SMBus AMD7X6 adapter at %04x", 
    467477                amd756_smba); 
    468478        if ((res = i2c_add_adapter(&amd756_adapter))) { 
     
    473483        } 
    474484        amd756_initialized++; 
    475         printk("i2c-amd756.o: AMD756 bus detected and initialized\n"); 
     485        printk("i2c-amd756.o: AMD756/766 bus detected and initialized\n"); 
    476486        return 0; 
    477487} 
     
    500510 
    501511MODULE_AUTHOR("Merlin Hughes <merlin@merlin.org>"); 
    502 MODULE_DESCRIPTION("AMD756 SMBus driver"); 
     512MODULE_DESCRIPTION("AMD756/766 SMBus driver"); 
    503513 
    504514int init_module(void) 
  • lm-sensors/trunk/prog/detect/sensors-detect

    r1152 r1154  
    178178       procid => "AMD-756 Athlon ACPI", 
    179179       driver => "i2c-amd756", 
    180        match => sub { $_[0] =~ /^SMBus AMD756 adapter at [0-9,a-f]{4}/ }, 
     180       match => sub { $_[0] =~ /^SMBus AMD7X6 adapter at [0-9,a-f]{4}/ }, 
     181     }, 
     182     {  
     183       vendid => 0x1022, 
     184       devid  => 0x7413, 
     185       func => 3, 
     186       procid => "AMD-766 Athlon ACPI", 
     187       driver => "i2c-amd756", 
     188       match => sub { $_[0] =~ /^SMBus AMD7X6 adapter at [0-9,a-f]{4}/ }, 
    181189     }, 
    182190     {