The initial CS gpio state is unknown. When it's asserted the first
transfer might fail. Deassert the CS during setup to make sure the
slave gets a fresh start.

Signed-off-by: Sascha Hauer <s.ha...@pengutronix.de>
---
 drivers/spi/gpio_spi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/spi/gpio_spi.c b/drivers/spi/gpio_spi.c
index 417e8db30e..36e6204283 100644
--- a/drivers/spi/gpio_spi.c
+++ b/drivers/spi/gpio_spi.c
@@ -165,6 +165,7 @@ static int gpio_spi_transfer(struct spi_device *spi, struct 
spi_message *msg)
 
 static int gpio_spi_setup(struct spi_device *spi)
 {
+       gpio_spi_set_cs(spi, 0);
        return 0;
 }
 

-- 
2.39.5


Reply via email to