spi: spi-pci1xxxx: Add support for per-instance DMA interrupt vectors
authorThangaraj Samynathan <thangaraj.s@microchip.com>
Tue, 24 Jun 2025 03:30:28 +0000 (09:00 +0530)
committerMark Brown <broonie@kernel.org>
Tue, 24 Jun 2025 12:14:30 +0000 (13:14 +0100)
commit3e36c822506d924894ff7de549b9377d3114c2d7
tree4449c9cdf753120eba0ed36cff894afa00fcd0af
parent1256eb42db5d1635f4c6da5b1b58db0b53320883
spi: spi-pci1xxxx: Add support for per-instance DMA interrupt vectors

Add support for dedicated DMA interrupt vectors for each SPI hardware
instance in the pci1xxxx driver. This improves scalability and interrupt
handling for systems using multiple SPI instances with DMA.

Introduce a constant `NUM_VEC_PER_INST` to define the number of IRQ
vectors per instance (main, DMA write, DMA read). Update the
`pci1xxxx_spi_internal` structure to use an IRQ array.

Refactor IRQ allocation and DMA initialization logic:
- Assign separate IRQ vectors for DMA read and write interrupts.
- Split the original DMA ISR into two handlers:
  `pci1xxxx_spi_isr_dma_rd` and `pci1xxxx_spi_isr_dma_wr`.
- Configure IMWR registers per instance using cached MSI data.
- Move DMA register configuration into a new helper function,
  `pci1xxxx_spi_dma_config()`.

Invoke the DMA initialization after all instances are configured to
ensure correct IRQ vector mapping.

Signed-off-by: Thangaraj Samynathan <thangaraj.s@microchip.com>
Link: https://patch.msgid.link/20250624033028.74389-1-thangaraj.s@microchip.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pci1xxxx.c