Commit 62df57b9 authored by Minda Chen's avatar Minda Chen Committed by Bjorn Helgaas
Browse files

PCI: microchip: Add INTx and MSI event num to struct plda_event

The INTx and MSI interrupt event num is different across platforms, so
add two event num fields in struct plda_event.

Link: https://lore.kernel.org/linux-pci/20240328091835.14797-14-minda.chen@starfivetech.com


Signed-off-by: default avatarMinda Chen <minda.chen@starfivetech.com>
Signed-off-by: default avatarKrzysztof Wilczyński <kwilczynski@kernel.org>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarConor Dooley <conor.dooley@microchip.com>
parent 64769047
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -817,6 +817,8 @@ static int mc_request_event_irq(struct plda_pcie_rp *plda, int event_irq,

static const struct plda_event mc_event = {
	.request_event_irq = mc_request_event_irq,
	.intx_event        = EVENT_LOCAL_PM_MSI_INT_INTX,
	.msi_event         = EVENT_LOCAL_PM_MSI_INT_MSI,
};

static int plda_pcie_init_irq_domains(struct plda_pcie_rp *port)
@@ -960,7 +962,7 @@ static int plda_init_interrupts(struct platform_device *pdev,
	}

	intx_irq = irq_create_mapping(port->event_domain,
				      EVENT_LOCAL_PM_MSI_INT_INTX);
				      event->intx_event);
	if (!intx_irq) {
		dev_err(dev, "failed to map INTx interrupt\n");
		return -ENXIO;
@@ -970,7 +972,7 @@ static int plda_init_interrupts(struct platform_device *pdev,
	irq_set_chained_handler_and_data(intx_irq, plda_handle_intx, port);

	msi_irq = irq_create_mapping(port->event_domain,
				     EVENT_LOCAL_PM_MSI_INT_MSI);
				     event->msi_event);
	if (!msi_irq)
		return -ENXIO;

+2 −0
Original line number Diff line number Diff line
@@ -130,6 +130,8 @@ struct plda_pcie_rp {
struct plda_event {
	int (*request_event_irq)(struct plda_pcie_rp *pcie,
				 int event_irq, int event);
	int intx_event;
	int msi_event;
};

void plda_pcie_setup_window(void __iomem *bridge_base_addr, u32 index,