Lines Matching +full:irqs +full:- +full:map +full:- +full:range

1 // SPDX-License-Identifier: GPL-2.0-or-later
18 #include <asm/ppc-pci.h>
30 /* An array mapping offsets to hardware IRQs */
45 /* We don't support MSI-X */ in hsta_setup_msi_irqs()
47 pr_debug("%s: MSI-X not supported.\n", __func__); in hsta_setup_msi_irqs()
48 return -EINVAL; in hsta_setup_msi_irqs()
51 msi_for_each_desc(entry, &dev->dev, MSI_DESC_NOTASSOCIATED) { in hsta_setup_msi_irqs()
62 return -EINVAL; in hsta_setup_msi_irqs()
66 * HSTA generates interrupts on writes to 128-bit aligned in hsta_setup_msi_irqs()
84 return -EINVAL; in hsta_setup_msi_irqs()
101 return -EINVAL; in hsta_find_hwirq_offset()
109 msi_for_each_desc(entry, &dev->dev, MSI_DESC_ASSOCIATED) { in hsta_teardown_msi_irqs()
110 irq = hsta_find_hwirq_offset(entry->irq); in hsta_teardown_msi_irqs()
112 /* entry->irq should always be in irq_map */ in hsta_teardown_msi_irqs()
114 irq_set_msi_desc(entry->irq, NULL); in hsta_teardown_msi_irqs()
117 entry->irq, irq); in hsta_teardown_msi_irqs()
118 entry->irq = 0; in hsta_teardown_msi_irqs()
124 struct device *dev = &pdev->dev; in hsta_msi_probe()
132 return -EINVAL; in hsta_msi_probe()
135 irq_count = of_irq_count(dev->of_node); in hsta_msi_probe()
137 dev_err(dev, "Unable to find IRQ range\n"); in hsta_msi_probe()
138 return -EINVAL; in hsta_msi_probe()
142 ppc4xx_hsta_msi.address = mem->start; in hsta_msi_probe()
143 ppc4xx_hsta_msi.data = ioremap(mem->start, resource_size(mem)); in hsta_msi_probe()
146 dev_err(dev, "Unable to map memory\n"); in hsta_msi_probe()
147 return -ENOMEM; in hsta_msi_probe()
150 ret = msi_bitmap_alloc(&ppc4xx_hsta_msi.bmp, irq_count, dev->of_node); in hsta_msi_probe()
157 ret = -ENOMEM; in hsta_msi_probe()
164 irq_of_parse_and_map(dev->of_node, irq); in hsta_msi_probe()
166 dev_err(dev, "Unable to map IRQ\n"); in hsta_msi_probe()
167 ret = -EINVAL; in hsta_msi_probe()
173 phb->controller_ops.setup_msi_irqs = hsta_setup_msi_irqs; in hsta_msi_probe()
174 phb->controller_ops.teardown_msi_irqs = hsta_teardown_msi_irqs; in hsta_msi_probe()
191 .compatible = "ibm,hsta-msi",
199 .name = "hsta-msi",