Commit a128f6ec authored by Serge Semin's avatar Serge Semin Committed by Mark Brown

spi: dw: Clear IRQ status on DW SPI controller reset

It turns out the IRQ status isn't cleared after switching the controller
off and getting it back on, which may cause raising false error interrupts
if controller has been unsuccessfully used by, for instance, a bootloader
before the driver is loaded. Let's explicitly clear the interrupts status
in the dedicated controller reset method.
Signed-off-by: default avatarSerge Semin <Sergey.Semin@baikalelectronics.ru>
Link: https://lore.kernel.org/r/20200920112914.26501-6-Sergey.Semin@baikalelectronics.ruSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 8225c1c9
...@@ -230,14 +230,15 @@ static inline void spi_umask_intr(struct dw_spi *dws, u32 mask) ...@@ -230,14 +230,15 @@ static inline void spi_umask_intr(struct dw_spi *dws, u32 mask)
} }
/* /*
* This does disable the SPI controller, interrupts, and re-enable the * This disables the SPI controller, interrupts, clears the interrupts status,
* controller back. Transmit and receive FIFO buffers are cleared when the * and re-enable the controller back. Transmit and receive FIFO buffers are
* device is disabled. * cleared when the device is disabled.
*/ */
static inline void spi_reset_chip(struct dw_spi *dws) static inline void spi_reset_chip(struct dw_spi *dws)
{ {
spi_enable_chip(dws, 0); spi_enable_chip(dws, 0);
spi_mask_intr(dws, 0xff); spi_mask_intr(dws, 0xff);
dw_readl(dws, DW_SPI_ICR);
spi_enable_chip(dws, 1); spi_enable_chip(dws, 1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment