From 9cf5d6948348ab1e1df4260549c8c7590809f143 Mon Sep 17 00:00:00 2001 From: Jon Lin Date: Tue, 21 Nov 2023 10:32:19 +0800 Subject: [PATCH] spi: rockchip: Preset SPI slave controller configuration Ensure that cs io is in the input state in initial progress. Change-Id: I808994ec14e3f4ab1c580f2f07e3e41b444bcc2e Signed-off-by: Jon Lin --- drivers/spi/spi-rockchip.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/spi/spi-rockchip.c b/drivers/spi/spi-rockchip.c index b627663667a6..ff62a171da0f 100644 --- a/drivers/spi/spi-rockchip.c +++ b/drivers/spi/spi-rockchip.c @@ -906,6 +906,8 @@ static int rockchip_spi_setup(struct spi_device *spi) cr0 |= ((spi->mode & 0x3) << CR0_SCPH_OFFSET); if (spi->mode & SPI_CS_HIGH) cr0 |= BIT(spi->chip_select) << CR0_SOI_OFFSET; + if (spi_controller_is_slave(spi->controller)) + cr0 |= CR0_OPM_SLAVE << CR0_OPM_OFFSET; writel_relaxed(cr0, rs->regs + ROCKCHIP_SPI_CTRLR0);