From 124c706b61ea07809e62b0d2160b14998227a674 Mon Sep 17 00:00:00 2001 From: Kyosti Malkki Date: Thu, 23 Jan 2003 23:24:05 +0000 Subject: [PATCH] =?UTF-8?q?(Ky=C3=B6sti)=20Clean=20PCI=20IDs=20already=20d?= =?UTF-8?q?efined=20for=202.4.9.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1708 7894878c-1315-0410-8ee3-d5d059ff63e0 --- kernel/busses/i2c-i801.c | 14 +++------ kernel/busses/i2c-i810.c | 7 ----- kernel/busses/i2c-piix4.c | 29 ++--------------- kernel/busses/i2c-sis5595.c | 16 ---------- kernel/busses/i2c-sis630.c | 16 ---------- kernel/busses/i2c-sis645.c | 17 ---------- kernel/busses/i2c-via.c | 63 +++++++++++++------------------------ kernel/busses/i2c-viapro.c | 13 -------- kernel/busses/i2c-voodoo3.c | 8 ----- kernel/chips/sis5595.c | 16 ---------- kernel/chips/via686a.c | 4 --- 11 files changed, 30 insertions(+), 173 deletions(-) diff --git a/kernel/busses/i2c-i801.c b/kernel/busses/i2c-i801.c index 820d4885..b0210e13 100644 --- a/kernel/busses/i2c-i801.c +++ b/kernel/busses/i2c-i801.c @@ -56,17 +56,13 @@ MODULE_LICENSE("GPL"); #define HAVE_PEC #endif -#ifndef PCI_DEVICE_ID_INTEL_82801AA_3 -#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 -#endif -#ifndef PCI_DEVICE_ID_INTEL_82801AB_3 -#define PCI_DEVICE_ID_INTEL_82801AB_3 0x2423 -#endif -#ifndef PCI_DEVICE_ID_INTEL_82801BA_2 -#define PCI_DEVICE_ID_INTEL_82801BA_2 0x2443 -#endif +#ifndef PCI_DEVICE_ID_INTEL_82801CA_SMBUS #define PCI_DEVICE_ID_INTEL_82801CA_SMBUS 0x2483 +#endif + +#ifndef PCI_DEVICE_ID_INTEL_82801DB_SMBUS #define PCI_DEVICE_ID_INTEL_82801DB_SMBUS 0x24C3 +#endif static int supported[] = {PCI_DEVICE_ID_INTEL_82801AA_3, PCI_DEVICE_ID_INTEL_82801AB_3, diff --git a/kernel/busses/i2c-i810.c b/kernel/busses/i2c-i810.c index 4618147e..3ed05aef 100644 --- a/kernel/busses/i2c-i810.c +++ b/kernel/busses/i2c-i810.c @@ -45,13 +45,6 @@ MODULE_LICENSE("GPL"); -/* PCI defines */ -#ifndef PCI_DEVICE_ID_INTEL_82810_IG1 -#define PCI_DEVICE_ID_INTEL_82810_IG1 0x7121 -#endif -#ifndef PCI_DEVICE_ID_INTEL_82810_IG3 -#define PCI_DEVICE_ID_INTEL_82810_IG3 0x7123 -#endif #ifndef PCI_DEVICE_ID_INTEL_82815_2 #define PCI_DEVICE_ID_INTEL_82815_2 0x1132 #endif diff --git a/kernel/busses/i2c-piix4.c b/kernel/busses/i2c-piix4.c index 89cc4cd7..969195de 100644 --- a/kernel/busses/i2c-piix4.c +++ b/kernel/busses/i2c-piix4.c @@ -43,32 +43,6 @@ #include "version.h" #include "dmi_scan.h" -/* Note: We assume all devices are identical - to the Intel PIIX4; we only mention it during detection. */ - -#ifndef PCI_DEVICE_ID_SERVERWORKS_OSB4 -#define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 -#endif - -#ifndef PCI_DEVICE_ID_SERVERWORKS_CSB5 -#define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 -#endif - -#ifndef PCI_VENDOR_ID_SERVERWORKS -#define PCI_VENDOR_ID_SERVERWORKS 0x01166 -#endif - -#ifndef PCI_DEVICE_ID_INTEL_82443MX_3 -#define PCI_DEVICE_ID_INTEL_82443MX_3 0x719b -#endif - -#ifndef PCI_VENDOR_ID_EFAR -#define PCI_VENDOR_ID_EFAR 0x1055 -#endif - -#ifndef PCI_DEVICE_ID_EFAR_SLC90E66_3 -#define PCI_DEVICE_ID_EFAR_SLC90E66_3 0x9463 -#endif struct sd { const unsigned short mfr; @@ -77,6 +51,9 @@ struct sd { const char *name; }; +/* Note: We assume all devices are identical + to the Intel PIIX4; we only mention it during detection. */ + static struct sd supported[] = { {PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, 3, "PIIX4"}, {PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_OSB4, 0, "OSB4"}, diff --git a/kernel/busses/i2c-sis5595.c b/kernel/busses/i2c-sis5595.c index 9e0404ad..236cfbec 100644 --- a/kernel/busses/i2c-sis5595.c +++ b/kernel/busses/i2c-sis5595.c @@ -62,22 +62,6 @@ MODULE_LICENSE("GPL"); -#ifndef PCI_DEVICE_ID_SI_540 -#define PCI_DEVICE_ID_SI_540 0x0540 -#endif -#ifndef PCI_DEVICE_ID_SI_550 -#define PCI_DEVICE_ID_SI_550 0x0550 -#endif -#ifndef PCI_DEVICE_ID_SI_630 -#define PCI_DEVICE_ID_SI_630 0x0630 -#endif -#ifndef PCI_DEVICE_ID_SI_730 -#define PCI_DEVICE_ID_SI_730 0x0730 -#endif -#ifndef PCI_DEVICE_ID_SI_5598 -#define PCI_DEVICE_ID_SI_5598 0x5598 -#endif - static int blacklist[] = { PCI_DEVICE_ID_SI_540, PCI_DEVICE_ID_SI_550, diff --git a/kernel/busses/i2c-sis630.c b/kernel/busses/i2c-sis630.c index ad596c86..2a8ed46a 100644 --- a/kernel/busses/i2c-sis630.c +++ b/kernel/busses/i2c-sis630.c @@ -59,22 +59,6 @@ #include #include "version.h" -#ifndef PCI_VENDOR_ID_SI -#define PCI_VENDOR_ID_SI 0x1039 -#endif - -#ifndef PCI_DEVICE_ID_SI_630 -#define PCI_DEVICE_ID_SI_630 0x0630 -#endif - -#ifndef PCI_DEVICE_ID_SI_730 -#define PCI_DEVICE_ID_SI_730 0x0730 -#endif - -#ifndef PCI_DEVICE_ID_SI_503 -#define PCI_DEVICE_ID_SI_503 0x0008 -#endif - struct sd { const unsigned short mfr; const unsigned short dev; diff --git a/kernel/busses/i2c-sis645.c b/kernel/busses/i2c-sis645.c index 9a4b0b8a..95657fc7 100644 --- a/kernel/busses/i2c-sis645.c +++ b/kernel/busses/i2c-sis645.c @@ -47,13 +47,6 @@ #define DRV_NAME "i2c-sis645" -/* PCI identifiers */ - -/* SiS645 north bridge */ -#ifndef PCI_DEVICE_ID_SI_645 -#define PCI_DEVICE_ID_SI_645 0x0645 -#endif - /* SiS645DX north bridge */ #ifndef PCI_DEVICE_ID_SI_646 #define PCI_DEVICE_ID_SI_646 0x0646 @@ -64,15 +57,6 @@ #define PCI_DEVICE_ID_SI_648 0x0648 #endif -/* SiS650 north bridge */ -#ifndef PCI_DEVICE_ID_SI_650 -#define PCI_DEVICE_ID_SI_650 0x0650 -#endif - -/* SiS735 combo chipset */ -#ifndef PCI_DEVICE_ID_SI_735 -#define PCI_DEVICE_ID_SI_735 0x0735 -#endif /* SiS961 south bridge */ #ifndef PCI_DEVICE_ID_SI_961 @@ -84,7 +68,6 @@ #define PCI_DEVICE_ID_SI_962 0x0962 #endif - #define PCI_DEVICE_ID_SI_SMBUS 0x16 /* base address register in PCI config space */ diff --git a/kernel/busses/i2c-via.c b/kernel/busses/i2c-via.c index 3d2528c8..c507822a 100644 --- a/kernel/busses/i2c-via.c +++ b/kernel/busses/i2c-via.c @@ -32,12 +32,6 @@ #include #include "version.h" -MODULE_LICENSE("GPL"); - -/* PCI device */ -#define VENDOR PCI_VENDOR_ID_VIA -#define DEVICE PCI_DEVICE_ID_VIA_82C586_3 - /* Power management registers */ #define PM_CFG_REVID 0x08 /* silicon revision code */ @@ -54,14 +48,7 @@ MODULE_LICENSE("GPL"); #define IOSPACE 0x06 #define IOTEXT "via-i2c" -/* ----- global defines ----------------------------------------------- */ -#define DEB(x) x /* silicon revision, io addresses */ -#define DEB2(x) x /* line status */ -#define DEBE(x) /* */ - -/* ----- local functions ---------------------------------------------- */ - -static u16 pm_io_base; +static u16 pm_io_base = 0; /* It does not appear from the datasheet that the GPIO pins are @@ -94,24 +81,6 @@ static int bit_via_getsda(void *data) } -/* When exactly was the new pci interface introduced? */ -static int find_via(void) -{ - struct pci_dev *s_bridge; - - if (!pci_present()) - return -ENODEV; - - s_bridge = pci_find_device(VENDOR, DEVICE, NULL); - - if (!s_bridge) { - printk("i2c-via.o: vt82c586b not found\n"); - return -ENODEV; - } - - return 0; -} - static struct i2c_algo_bit_data bit_data = { .setsda = bit_via_setsda, .setscl = bit_via_setscl, @@ -122,15 +91,16 @@ static struct i2c_algo_bit_data bit_data = { .timeout = HZ }; -static struct i2c_adapter bit_via_adapter = { +static struct i2c_adapter vt586b_adapter = { .owner = THIS_MODULE, .name = "VIA i2c", .id = I2C_HW_B_VIA, - .algo_data = &bit_data, + .algo_data = &bit_data, }; static struct pci_device_id vt586b_ids[] __devinitdata = { + { PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, { 0, } }; @@ -138,6 +108,12 @@ static int __devinit vt586b_probe(struct pci_dev *dev, const struct pci_device_i { u16 base; u8 rev; + int res; + + if (pm_io_base) { + printk(KERN_ERR "i2c-via.o: Will only support one host\n"); + return -EBUSY; + } pci_read_config_byte(dev, PM_CFG_REVID, &rev); @@ -158,8 +134,6 @@ static int __devinit vt586b_probe(struct pci_dev *dev, const struct pci_device_i pci_read_config_word(dev, base, &pm_io_base); pm_io_base &= (0xff << 8); - return -ENODEV; - if (! request_region(I2C_DIR, IOSPACE, IOTEXT)) { printk("i2c-via.o: IO 0x%x-0x%x already in use\n", I2C_DIR, I2C_DIR + IOSPACE); @@ -167,13 +141,21 @@ static int __devinit vt586b_probe(struct pci_dev *dev, const struct pci_device_i } outb(inb(I2C_DIR) & ~(I2C_SDA | I2C_SCL), I2C_DIR); outb(inb(I2C_OUT) & ~(I2C_SDA | I2C_SCL), I2C_OUT); - - i2c_bit_add_bus(&bit_via_adapter); + + res = i2c_bit_add_bus(&vt586b_adapter); + if ( res < 0 ) { + release_region(I2C_DIR, IOSPACE); + pm_io_base = 0; + return res; + } + return 0; } static void __devexit vt586b_remove(struct pci_dev *dev) { - i2c_bit_del_bus(&bit_via_adapter); + i2c_bit_del_bus(&vt586b_adapter); + release_region(I2C_DIR, IOSPACE); + pm_io_base = 0; } @@ -194,13 +176,12 @@ static int __init i2c_vt586b_init(void) static void __exit i2c_vt586b_exit(void) { pci_unregister_driver(&vt586b_driver); - release_region(I2C_DIR, IOSPACE); } - MODULE_AUTHOR("Kyösti Mälkki "); MODULE_DESCRIPTION("i2c for Via vt82c586b southbridge"); +MODULE_LICENSE("GPL"); module_init(i2c_vt586b_init); module_exit(i2c_vt586b_exit); diff --git a/kernel/busses/i2c-viapro.c b/kernel/busses/i2c-viapro.c index bc48e543..5ddeb00d 100644 --- a/kernel/busses/i2c-viapro.c +++ b/kernel/busses/i2c-viapro.c @@ -43,19 +43,6 @@ #include #include "version.h" -#ifndef PCI_DEVICE_ID_VIA_82C596_3 -#define PCI_DEVICE_ID_VIA_82C596_3 0x3050 -#endif -#ifndef PCI_DEVICE_ID_VIA_82C596B_3 -#define PCI_DEVICE_ID_VIA_82C596B_3 0x3051 -#endif -#ifndef PCI_DEVICE_ID_VIA_82C686_4 -#define PCI_DEVICE_ID_VIA_82C686_4 0x3057 -#endif -#ifndef PCI_DEVICE_ID_VIA_8233_0 -#define PCI_DEVICE_ID_VIA_8233_0 0x3074 -#endif - #define SMBBA1 0x90 #define SMBBA2 0x80 #define SMBBA3 0xD0 diff --git a/kernel/busses/i2c-voodoo3.c b/kernel/busses/i2c-voodoo3.c index 51415c3d..ce5ceffd 100644 --- a/kernel/busses/i2c-voodoo3.c +++ b/kernel/busses/i2c-voodoo3.c @@ -37,14 +37,6 @@ MODULE_LICENSE("GPL"); -/* 3DFX defines */ -#ifndef PCI_DEVICE_ID_3DFX_VOODOO3 -#define PCI_DEVICE_ID_3DFX_VOODOO3 0x05 -#endif -#ifndef PCI_DEVICE_ID_3DFX_BANSHEE -#define PCI_DEVICE_ID_3DFX_BANSHEE 0x03 -#endif - /* the only registers we use */ #define REG 0x78 #define REG2 0x70 diff --git a/kernel/chips/sis5595.c b/kernel/chips/sis5595.c index 934f0a13..164b44ac 100644 --- a/kernel/chips/sis5595.c +++ b/kernel/chips/sis5595.c @@ -79,22 +79,6 @@ static unsigned int normal_isa_range[] = { SENSORS_ISA_END }; /* Insmod parameters */ SENSORS_INSMOD_1(sis5595); -#ifndef PCI_DEVICE_ID_SI_540 -#define PCI_DEVICE_ID_SI_540 0x0540 -#endif -#ifndef PCI_DEVICE_ID_SI_550 -#define PCI_DEVICE_ID_SI_550 0x0550 -#endif -#ifndef PCI_DEVICE_ID_SI_630 -#define PCI_DEVICE_ID_SI_630 0x0630 -#endif -#ifndef PCI_DEVICE_ID_SI_730 -#define PCI_DEVICE_ID_SI_730 0x0730 -#endif -#ifndef PCI_DEVICE_ID_SI_5598 -#define PCI_DEVICE_ID_SI_5598 0x5598 -#endif - static int blacklist[] = { PCI_DEVICE_ID_SI_540, PCI_DEVICE_ID_SI_550, diff --git a/kernel/chips/via686a.c b/kernel/chips/via686a.c index 1e0e3c26..659c19c7 100644 --- a/kernel/chips/via686a.c +++ b/kernel/chips/via686a.c @@ -41,10 +41,6 @@ #include #include "version.h" -#ifndef PCI_DEVICE_ID_VIA_82C686_4 -#define PCI_DEVICE_ID_VIA_82C686_4 0x3057 -#endif - /* If force_addr is set to anything different from 0, we forcibly enable the device at the given address. */