mirror of
https://github.com/lm-sensors/lm-sensors.git
synced 2026-11-01 13:20:30 +00:00
PCI chip detection cleanup.
git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1011 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
1 parent
b4b343d74b
commit
377be956da
2 files changed
+19
-22
No files matched your search
@@ -21,6 +21,7 @@ ask CVS about it:
|
||||
File doc/FAQ: Updates
|
||||
File doc/chips/via686a: Claim support for 686b.
|
||||
File sensors.conf.eg: Adjust as99127f -12V calculation
|
||||
Module i2c-i801: Chip detection cleanup
|
||||
Module lm78: Recognize chipid=0x20
|
||||
Module lm87: Fix in0, in1 (2.5V and Vccp1) calculations
|
||||
Module sensors: Add xxx_init() calls for drivers added to mkpatch in 2.5.5.
|
||||
|
||||
+18
-22
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
i801.c - Part of lm_sensors, Linux kernel modules for hardware
|
||||
monitoring
|
||||
Copyright (c) 1998, 1999 Frodo Looijaard <frodol@dds.nl>,
|
||||
Copyright (c) 1998 - 2001 Frodo Looijaard <frodol@dds.nl>,
|
||||
Philip Edelbrock <phil@netroedge.com>, and Mark D. Studebaker
|
||||
<mdsxyz123@yahoo.com>
|
||||
|
||||
@@ -51,6 +51,11 @@
|
||||
#define PCI_DEVICE_ID_INTEL_82801BA_3 0x2443
|
||||
#endif
|
||||
|
||||
static int supported[] = {PCI_DEVICE_ID_INTEL_82801AA_3,
|
||||
PCI_DEVICE_ID_INTEL_82801AB_3,
|
||||
PCI_DEVICE_ID_INTEL_82801BA_3,
|
||||
0 };
|
||||
|
||||
/* I801 SMBus address offsets */
|
||||
#define SMBHSTSTS (0 + i801_smba)
|
||||
#define SMBHSTCNT (2 + i801_smba)
|
||||
@@ -158,6 +163,7 @@ static struct pci_dev *I801_dev = NULL;
|
||||
int i801_setup(void)
|
||||
{
|
||||
int error_return = 0;
|
||||
int *num = supported;
|
||||
unsigned char temp;
|
||||
|
||||
/* First check whether we can access PCI at all */
|
||||
@@ -167,29 +173,19 @@ int i801_setup(void)
|
||||
goto END;
|
||||
}
|
||||
|
||||
/* Look for the I801, function 3 */
|
||||
/* Have to check for both the 82801AA and 82801AB */
|
||||
/* Look for each chip */
|
||||
/* Note: we keep on searching until we have found 'function 3' */
|
||||
I801_dev = NULL;
|
||||
do
|
||||
I801_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82801AA_3,
|
||||
I801_dev);
|
||||
while (I801_dev && (PCI_FUNC(I801_dev->devfn) != 3));
|
||||
if (I801_dev == NULL) {
|
||||
do
|
||||
I801_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82801AB_3,
|
||||
I801_dev);
|
||||
while (I801_dev && (PCI_FUNC(I801_dev->devfn) != 3));
|
||||
}
|
||||
if (I801_dev == NULL) {
|
||||
do
|
||||
I801_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
|
||||
PCI_DEVICE_ID_INTEL_82801BA_3,
|
||||
I801_dev);
|
||||
while (I801_dev && (PCI_FUNC(I801_dev->devfn) != 3));
|
||||
}
|
||||
do {
|
||||
if((I801_dev = pci_find_device(PCI_VENDOR_ID_INTEL,
|
||||
*num, I801_dev))) {
|
||||
if(PCI_FUNC(I801_dev->devfn) != 3)
|
||||
continue;
|
||||
break;
|
||||
}
|
||||
num++;
|
||||
} while (*num != 0);
|
||||
|
||||
if (I801_dev == NULL) {
|
||||
printk
|
||||
("i2c-i801.o: Error: Can't detect I801, function 3!\n");
|
||||
|
||||
Reference in new issue
Block a user