OSDN Git Service

PCI: altera: Use size=4 IRQ domain for legacy INTx
authorPaul Burton <paul.burton@imgtec.com>
Tue, 15 Aug 2017 21:24:38 +0000 (16:24 -0500)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 16 Aug 2017 16:41:20 +0000 (11:41 -0500)
commitbfdbbf0e3c2a6e3fe752e0dc858c982aa1ccecad
tree73308f15ba5958111341acbc2fe25a1439467109
parent8a3073860b7389ee4b6754961b05e15187dac33b
PCI: altera: Use size=4 IRQ domain for legacy INTx

The devicetree binding documentation for the Altera PCIe controller shows
an example which uses an interrupt-map property to map PCI INTx interrupts
to hardware IRQ numbers 1-4. The driver creates an IRQ domain with size 5
in order to cover this range, with hwirq=0 left unused.

This patch cleans up this wasted IRQ domain entry, modifying the driver to
use an IRQ domain of size 4 which matches the actual number of PCI INTx
interrupts. Since the hwirq numbers 1-4 are part of the devicetree binding,
and this is considered ABI, we cannot simply change the interrupt-map
property to use the range 0-3. Instead we make use of the
pci_irqd_intx_xlate() helper function to translate the range 1-4 used at
the DT level into the range 0-3 which is now used within the driver, and
stop adding 1 to decoded hwirq numbers in altera_pcie_isr().

Whilst cleaning up INTx handling we make use of the new PCI_NUM_INTX macro
& drop the custom INTX_NUM definition.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Cc: Ley Foon Tan <lftan@altera.com>
drivers/pci/host/pcie-altera.c