From d35f2dc9a2a84f4985d8b16b47040fd6291788ad Mon Sep 17 00:00:00 2001 From: Andy Shevchenko Date: Thu, 27 Jul 2017 18:49:33 +0300 Subject: spi: pxa2xx: Don't touch CS pin until we have a transfer pending GPIO descriptors, when being requested, may configure pin at the same time. In case of SPI chip select we shouldn't do any assumptions of the state of pin since we don't know yet what chip is connected there and if it uses high or low active state. So, leave the state of pin as is until transfer will start. Fixes: 99f499cd6504 ("spi: pxa2xx: Add support for GPIO descriptor chip selects") Signed-off-by: Andy Shevchenko Acked-by: Mika Westeberg Signed-off-by: Mark Brown --- drivers/spi/spi-pxa2xx.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/spi/spi-pxa2xx.c') diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c index 38d053682892..6e5af88b7c6f 100644 --- a/drivers/spi/spi-pxa2xx.c +++ b/drivers/spi/spi-pxa2xx.c @@ -1769,8 +1769,7 @@ static int pxa2xx_spi_probe(struct platform_device *pdev) for (i = 0; i < master->num_chipselect; i++) { struct gpio_desc *gpiod; - gpiod = devm_gpiod_get_index(dev, "cs", i, - GPIOD_OUT_HIGH); + gpiod = devm_gpiod_get_index(dev, "cs", i, GPIOD_ASIS); if (IS_ERR(gpiod)) { /* Means use native chip select */ if (PTR_ERR(gpiod) == -ENOENT) -- cgit v1.2.3