1 From 8a9c0607ce0daa91c48faefd70ea73bda54ed0ae Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.com>
3 Date: Tue, 29 Nov 2022 10:09:54 +0000
4 Subject: [PATCH] spi: dw: Handle combined tx and rx messages
6 Signed-off-by: Phil Elwell <phil@raspberrypi.com>
8 drivers/spi/spi-dw-core.c | 12 +++++++++---
9 drivers/spi/spi-dw-mmio.c | 8 ++++++--
10 2 files changed, 15 insertions(+), 5 deletions(-)
12 --- a/drivers/spi/spi-dw-core.c
13 +++ b/drivers/spi/spi-dw-core.c
14 @@ -244,8 +244,11 @@ static irqreturn_t dw_spi_transfer_handl
16 if (irq_status & DW_SPI_INT_TXEI) {
20 dw_spi_mask_intr(dws, DW_SPI_INT_TXEI);
22 + spi_finalize_current_transfer(dws->master);
27 @@ -372,8 +375,11 @@ static void dw_spi_irq_setup(struct dw_s
29 dws->transfer_handler = dw_spi_transfer_handler;
31 - imask = DW_SPI_INT_TXEI | DW_SPI_INT_TXOI |
32 - DW_SPI_INT_RXUI | DW_SPI_INT_RXOI | DW_SPI_INT_RXFI;
35 + imask |= DW_SPI_INT_TXEI | DW_SPI_INT_TXOI;
37 + imask |= DW_SPI_INT_RXUI | DW_SPI_INT_RXOI | DW_SPI_INT_RXFI;
38 dw_spi_umask_intr(dws, imask);
41 --- a/drivers/spi/spi-dw-mmio.c
42 +++ b/drivers/spi/spi-dw-mmio.c
44 #include <linux/property.h>
45 #include <linux/regmap.h>
46 #include <linux/reset.h>
47 +#include <linux/interrupt.h>
51 @@ -280,8 +281,11 @@ static int dw_spi_mmio_probe(struct plat
52 dws->paddr = mem->start;
54 dws->irq = platform_get_irq(pdev, 0);
56 - return dws->irq; /* -ENXIO */
58 + if (dws->irq != -ENXIO)
59 + return dws->irq; /* -ENXIO */
60 + dws->irq = IRQ_NOTCONNECTED;
63 dwsmmio->clk = devm_clk_get(&pdev->dev, NULL);
64 if (IS_ERR(dwsmmio->clk))