Lines Matching +full:intc +full:- +full:nr +full:- +full:irqs

1 // SPDX-License-Identifier: GPL-2.0
19 * pci_request_irq - allocate an interrupt line for a PCI device
21 * @nr: device-relative interrupt vector index (0-based).
29 * @fmt: Printf-like format string naming the handler
37 int pci_request_irq(struct pci_dev *dev, unsigned int nr, irq_handler_t handler, in pci_request_irq() argument
52 return -ENOMEM; in pci_request_irq()
54 ret = request_threaded_irq(pci_irq_vector(dev, nr), handler, thread_fn, in pci_request_irq()
63 * pci_free_irq - free an interrupt allocated with pci_request_irq
65 * @nr: device-relative interrupt vector index (0-based).
76 void pci_free_irq(struct pci_dev *dev, unsigned int nr, void *dev_id) in pci_free_irq() argument
78 kfree(free_irq(pci_irq_vector(dev, nr), dev_id)); in pci_free_irq()
83 * pci_swizzle_interrupt_pin - swizzle INTx for device behind bridge
85 * @pin: the INTx pin (1=INTA, 2=INTB, 3=INTC, 4=INTD)
88 * required by section 9.1 of the PCI-to-PCI bridge specification for devices
89 * behind bridges on add-in cards. For devices with ARI enabled, the slot
97 if (pci_ari_enabled(dev->bus)) in pci_swizzle_interrupt_pin()
100 slot = PCI_SLOT(dev->devfn); in pci_swizzle_interrupt_pin()
102 return (((pin - 1) + slot) % 4) + 1; in pci_swizzle_interrupt_pin()
109 pin = dev->pin; in pci_get_interrupt_pin()
111 return -1; in pci_get_interrupt_pin()
113 while (!pci_is_root_bus(dev->bus)) { in pci_get_interrupt_pin()
115 dev = dev->bus->self; in pci_get_interrupt_pin()
122 * pci_common_swizzle - swizzle INTx all the way to root bridge
126 * Perform INTx swizzling for a device. This traverses through all PCI-to-PCI
133 while (!pci_is_root_bus(dev->bus)) { in pci_common_swizzle()
135 dev = dev->bus->self; in pci_common_swizzle()
138 return PCI_SLOT(dev->devfn); in pci_common_swizzle()
145 u8 slot = -1; in pci_assign_irq()
147 struct pci_host_bridge *hbrg = pci_find_host_bridge(dev->bus); in pci_assign_irq()
149 if (!(hbrg->map_irq)) { in pci_assign_irq()
158 * time the interrupt line passes through a PCI-PCI bridge we must in pci_assign_irq()
168 if (hbrg->swizzle_irq) in pci_assign_irq()
169 slot = (*(hbrg->swizzle_irq))(dev, &pin); in pci_assign_irq()
175 irq = (*(hbrg->map_irq))(dev, slot, pin); in pci_assign_irq()
176 if (irq == -1) in pci_assign_irq()
179 dev->irq = irq; in pci_assign_irq()
181 pci_dbg(dev, "assign IRQ: got %d\n", dev->irq); in pci_assign_irq()
192 struct pci_bus *bus = dev->bus; in pci_check_and_set_intx_mask()
208 bus->ops->read(bus, dev->devfn, PCI_COMMAND, 4, &cmd_status_dword); in pci_check_and_set_intx_mask()
227 bus->ops->write(bus, dev->devfn, PCI_COMMAND, 2, newcmd); in pci_check_and_set_intx_mask()
236 * pci_check_and_mask_intx - mask INTx on pending interrupt
249 * pci_check_and_unmask_intx - unmask INTx if no interrupt is pending
263 * pcibios_penalize_isa_irq - penalize an ISA IRQ
267 * Permits the platform to provide architecture-specific functionality when
268 * penalizing ISA IRQs. This is the default implementation. Architecture