From 05644147064acabb8587c4cbd690047494f7b3a1 Mon Sep 17 00:00:00 2001 From: Uwe Kleine-König Date: Thu, 9 Feb 2012 22:21:45 +0100 Subject: spi/gpio: start with CS non-active MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Acked-by: Linus Walleij Signed-off-by: Mark Brown --- drivers/spi/spi-gpio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/spi/spi-gpio.c') diff --git a/drivers/spi/spi-gpio.c b/drivers/spi/spi-gpio.c index 0094c645ff0d..0b56cfc71fab 100644 --- a/drivers/spi/spi-gpio.c +++ b/drivers/spi/spi-gpio.c @@ -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) -- cgit v1.2.3