spi/gpio: start with CS non-active

The chip select line was configured as output with the initial value
being active explicitly. It was later deasserted during
spi_bitbang_setup() without any clock activity in between. So it makes
no sense to activate the device at all and the chip select line can
better start non-active.

Signed-off-by: Uwe Kleine-König <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
This commit is contained in:
Uwe Kleine-König 2012-02-09 22:21:45 +01:00 • committed by Mark Brown
commit 0564414706

View file

@ -235,7 +235,8 @@ static int spi_gpio_setup(struct spi_device *spi)
status = gpio_request(cs, dev_name(&spi->dev));
if (status)
return status;
status = gpio_direction_output(cs, spi->mode & SPI_CS_HIGH);
status = gpio_direction_output(cs,
!(spi->mode & SPI_CS_HIGH));
}
}
if (!status)