summaryrefslogtreecommitdiff
path: root/drivers/pci/controller/plda/pcie-microchip-host.c
diff options
context:
space:
mode:
authorMinda Chen <minda.chen@starfivetech.com>2024-03-28 12:18:24 +0300
committerBjorn Helgaas <bhelgaas@google.com>2024-05-28 19:15:29 +0300
commitd4078c87a530094839e4ba82c75f20262545c5ae (patch)
tree23f801f0ddb1723842be87e6822b84bc0e7a4e7f /drivers/pci/controller/plda/pcie-microchip-host.c
parentf966c028cfae218871e0ab5bd1674c42fe042e96 (diff)
downloadlinux-d4078c87a530094839e4ba82c75f20262545c5ae.tar.xz
PCI: microchip: Add num_events field to struct plda_pcie_rp
The number of events is different across platforms. In order to share interrupt processing code, add a variable that defines the number of events so that it can be set per-platform instead of hardcoding it. Link: https://lore.kernel.org/linux-pci/20240328091835.14797-12-minda.chen@starfivetech.com Signed-off-by: Minda Chen <minda.chen@starfivetech.com> Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Diffstat (limited to 'drivers/pci/controller/plda/pcie-microchip-host.c')
-rw-r--r--drivers/pci/controller/plda/pcie-microchip-host.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/pci/controller/plda/pcie-microchip-host.c b/drivers/pci/controller/plda/pcie-microchip-host.c
index f4caca9e6e6e..4eba3e169b9b 100644
--- a/drivers/pci/controller/plda/pcie-microchip-host.c
+++ b/drivers/pci/controller/plda/pcie-microchip-host.c
@@ -653,7 +653,7 @@ static void plda_handle_event(struct irq_desc *desc)
events = mc_get_events(port);
- for_each_set_bit(bit, &events, NUM_EVENTS)
+ for_each_set_bit(bit, &events, port->num_events)
generic_handle_domain_irq(port->event_domain, bit);
chained_irq_exit(chip, desc);
@@ -816,7 +816,8 @@ static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port)
return -EINVAL;
}
- port->event_domain = irq_domain_add_linear(pcie_intc_node, NUM_EVENTS,
+ port->event_domain = irq_domain_add_linear(pcie_intc_node,
+ port->num_events,
&plda_event_domain_ops,
port);
if (!port->event_domain) {
@@ -920,7 +921,7 @@ static int plda_init_interrupts(struct platform_device *pdev, struct plda_pcie_r
if (irq < 0)
return -ENODEV;
- for (i = 0; i < NUM_EVENTS; i++) {
+ for (i = 0; i < port->num_events; i++) {
event_irq = irq_create_mapping(port->event_domain, i);
if (!event_irq) {
dev_err(dev, "failed to map hwirq %d\n", i);
@@ -1011,6 +1012,7 @@ static int mc_host_probe(struct platform_device *pdev)
bridge_base_addr = port->axi_base_addr + MC_PCIE_BRIDGE_ADDR;
plda->bridge_addr = bridge_base_addr;
+ plda->num_events = NUM_EVENTS;
/* Allow enabling MSI by disabling MSI-X */
val = readl(bridge_base_addr + PCIE_PCI_IRQ_DW0);