aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasahisa Kojima2022-05-17 17:41:37 +0900
committerTom Rini2022-06-10 13:37:32 -0400
commit88d50ed8a15fc4a0df37e2a274607827a52a2217 (patch)
treef71aa0629c8233770e43b0e1cd29293367ad8271
parent29d382b94e6a1b0eddb3b7ae52099c9736c37a20 (diff)
spi: synquacer: wait until slave is deselected
synquacer_cs_set() function does not wait the chip select is deasserted when the driver sets the DMSTOP to deselect the slave. This commit checks the Slave Select Released(SRS) bit to wait until the slave is deselected. Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org> Signed-off-by: Satoru Okamoto <okamoto.satoru@socionext.com> Acked-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r--drivers/spi/spi-synquacer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/spi/spi-synquacer.c b/drivers/spi/spi-synquacer.c
index 62f85f03353..f1422cf893e 100644
--- a/drivers/spi/spi-synquacer.c
+++ b/drivers/spi/spi-synquacer.c
@@ -46,7 +46,9 @@
#define RXE 0x24
#define RXC 0x28
#define TFLETE 4
+#define TSSRS 6
#define RFMTE 5
+#define RSSRS 6
#define FAULTF 0x2c
#define FAULTC 0x30
@@ -170,6 +172,11 @@ static void synquacer_cs_set(struct synquacer_spi_priv *priv, bool active)
priv->rx_words = 16;
read_fifo(priv);
}
+
+ /* wait until slave is deselected */
+ while (!(readl(priv->base + TXF) & BIT(TSSRS)) ||
+ !(readl(priv->base + RXF) & BIT(RSSRS)))
+ ;
}
}