[3.11.y.z extended stable] Patch "spi: spi-ath79: fix initial GPIO CS line setup" has been added to staging queue
Luis Henriques
luis.henriques at canonical.com
Mon Mar 17 11:04:50 UTC 2014
This is a note to let you know that I have just added a patch titled
spi: spi-ath79: fix initial GPIO CS line setup
to the linux-3.11.y-queue branch of the 3.11.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.11.y-queue
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.11.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Luis
------
>From daf33a8c940244a6f338898cb59a9a1fe88daba0 Mon Sep 17 00:00:00 2001
From: Gabor Juhos <juhosg at openwrt.org>
Date: Sun, 2 Mar 2014 20:54:42 +0100
Subject: spi: spi-ath79: fix initial GPIO CS line setup
commit 61d1cf163c8653934cc8cd5d0b2a562d0990c265 upstream.
The 'ath79_spi_setup_cs' function initializes the chip
select line of a given SPI device in order to make sure
that the device is inactive.
If the SPI_CS_HIGH bit is set for a given device, it
means that the CS line of that device is active HIGH
so it must be set to LOW initially. In case of GPIO
CS lines, the 'ath79_spi_setup_cs' function does the
opposite of that due to the wrong GPIO flags.
Fix the code to use the correct GPIO flags.
Reported-by: Ronald Wahl <ronald.wahl at raritan.com>
Signed-off-by: Gabor Juhos <juhosg at openwrt.org>
Signed-off-by: Mark Brown <broonie at linaro.org>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
drivers/spi/spi-ath79.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/spi/spi-ath79.c b/drivers/spi/spi-ath79.c
index 0e06407..696599a 100644
--- a/drivers/spi/spi-ath79.c
+++ b/drivers/spi/spi-ath79.c
@@ -132,9 +132,9 @@ static int ath79_spi_setup_cs(struct spi_device *spi)
flags = GPIOF_DIR_OUT;
if (spi->mode & SPI_CS_HIGH)
- flags |= GPIOF_INIT_HIGH;
- else
flags |= GPIOF_INIT_LOW;
+ else
+ flags |= GPIOF_INIT_HIGH;
status = gpio_request_one(cdata->gpio, flags,
dev_name(&spi->dev));
--
1.9.0
More information about the kernel-team
mailing list