Changeset 592 for GPL/branches/uniaud32-2.1.x/lib32/pci.c
- Timestamp:
- Mar 9, 2017, 1:01:06 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/branches/uniaud32-2.1.x/lib32/pci.c
r576 r592 47 47 //struct pci_bus pci_busses[MAX_PCI_BUSSES] = {0}; 48 48 49 BOOL fRewired = FALSE;50 49 extern int nrCardsDetected; 51 50 … … 55 54 #define PCI_CONFIG_DATA 0xCFC 56 55 57 #ifdef ACPI58 APIRET APIENTRY ACPIFindPCIDevice(ULONG Bus, ULONG Dev, ULONG Fun, ULONG *PicIRQ, ULONG *ApicIRQ, ULONG *Hdl, char *Component);59 #endif60 61 56 //****************************************************************************** 62 57 #define CONFIG_CMD(dev, where) \ … … 140 135 int resNo, addr; 141 136 u32 devNr, busNr, funcNr, detectedId, cfgaddrreg, ulPciAdr, ulTmp1, ulTmp2; 142 #ifdef ACPI143 APIRET rc;144 ULONG PicIRQ, ApicIRQ;145 #endif146 137 u8 headerType; 147 138 … … 239 230 pci_read_config_dword(pcidev, PCI_INTERRUPT_LINE, &ulTmp1); 240 231 rprintf(("pci_query_device: PCI config IRQ=%d", ulTmp1&0xff)); 241 #ifdef ACPI242 rc = ACPIFindPCIDevice( (ULONG)busNr, // Bus243 (ULONG)devNr, // Dev244 (ULONG)(pcidev->devfn >> 8) & 7, // Function245 &PicIRQ, // PIC IRQ246 &ApicIRQ, // APIC IRQ247 NULL, // ACPI handle to finding device248 "Uniaud32"); // Name for acpi log249 if (!rc) {250 if (PicIRQ) ulTmp1 = (ulTmp1 & (~0xff)) | (PicIRQ & 0xff); // Choose Pic interrupt for init time processing251 else if (ApicIRQ) ulTmp1 = (ulTmp1 & (~0xff)) | (ApicIRQ & 0xff);252 rprintf(("pci_query_device: IRQs ACPI PIC=%ld APIC=%ld chosen=%d", PicIRQ, ApicIRQ, ulTmp1&0xff));253 pcidev->picirq = PicIRQ; // Save the Pic and254 pcidev->apicirq = ApicIRQ; // Save the Apic interrupt for switching later255 }256 #endif /* ACPI */257 232 if( (u8)ulTmp1 && (u8)ulTmp1 != 0xff ) { 258 233 pcidev->irq_resource[0].flags = IORESOURCE_IRQ; … … 972 947 } 973 948 974 #ifdef ACPI975 void PciAdjustInterrupts() {976 int i;977 struct pci_dev *pcidev;978 struct pci_driver *driver;979 ULONG ulTmp1, rc;980 981 for (i=0; i<MAX_PCI_DEVICES; i++) {982 if (!pci_devices[i].devfn) continue;983 pcidev = &pci_devices[i];984 ulTmp1 = pcidev->irq;985 if (pcidev->apicirq) ulTmp1 = pcidev->apicirq;986 else if (pcidev->picirq) ulTmp1 = pcidev->picirq;987 rprintf(("PciAdjustInterrupts: IRQs ACPI PIC=%ld APIC=%ld was=%d chosen=%ld", pcidev->picirq, pcidev->apicirq, pcidev->irq, ulTmp1));988 if( (u8)ulTmp1 && ((u8)ulTmp1 != 0xff) && ((u8)ulTmp1 != pcidev->irq) ) {989 RMSetHandles(pcidev->hAdapter, pcidev->hDevice); /* DAZ - dirty hack */990 driver = pcidev->pcidriver;991 if(driver && driver->suspend) driver->suspend(pcidev, SNDRV_CTL_POWER_D0);992 993 pcidev->irq_resource[0].flags = IORESOURCE_IRQ;994 pcidev->irq_resource[0].start = pcidev->irq_resource[0].end = ulTmp1 & 0xffff;995 pcidev->irq = (u8)ulTmp1;996 997 fRewired = TRUE;998 // if(driver && driver->resume) driver->resume(pcidev);999 }1000 } /* for loop */1001 }1002 #endif
Note:
See TracChangeset
for help on using the changeset viewer.