* [PATCH v1] spi: pxa2xx: Don't touch CS pin until we have a transfer pending
@ 2017-07-27 15:49 Andy Shevchenko
[not found] ` <20170727154933.14143-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2017-07-27 15:49 UTC (permalink / raw)
To: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA
Cc: Andy Shevchenko, Mika Westerberg
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")
Cc: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
---
Note, while it has Fixes tag, it relies on 676a4e3bab44 to be reverted for newest kernel.
Revert had been sent earlier today.
drivers/spi/spi-pxa2xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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)
--
2.13.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v1] spi: pxa2xx: Don't touch CS pin until we have a transfer pending
[not found] ` <20170727154933.14143-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
@ 2017-07-28 10:51 ` Mika Westerberg
2017-07-28 12:38 ` Applied "spi: pxa2xx: Don't touch CS pin until we have a transfer pending" to the spi tree Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mika Westerberg @ 2017-07-28 10:51 UTC (permalink / raw)
To: Andy Shevchenko; +Cc: Mark Brown, linux-spi-u79uwXL29TY76Z2rM5mHXA
On Thu, Jul 27, 2017 at 06:49:33PM +0300, Andy Shevchenko wrote:
> 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")
> Cc: Mika Westerberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Yes, I think this is the right thing to do,
Acked-by: Mika Westeberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
* Applied "spi: pxa2xx: Don't touch CS pin until we have a transfer pending" to the spi tree
[not found] ` <20170727154933.14143-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-28 10:51 ` Mika Westerberg
@ 2017-07-28 12:38 ` Mark Brown
1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2017-07-28 12:38 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Mika Westeberg, Mark Brown, Mark Brown,
linux-spi-u79uwXL29TY76Z2rM5mHXA, Mika Westerberg,
linux-spi-u79uwXL29TY76Z2rM5mHXA
The patch
spi: pxa2xx: Don't touch CS pin until we have a transfer pending
has been applied to the spi tree at
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From d35f2dc9a2a84f4985d8b16b47040fd6291788ad Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Date: Thu, 27 Jul 2017 18:49:33 +0300
Subject: [PATCH] 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 <andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Acked-by: Mika Westeberg <mika.westerberg-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
Signed-off-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
---
drivers/spi/spi-pxa2xx.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
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)
--
2.13.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-28 12:38 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-27 15:49 [PATCH v1] spi: pxa2xx: Don't touch CS pin until we have a transfer pending Andy Shevchenko
[not found] ` <20170727154933.14143-1-andriy.shevchenko-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-07-28 10:51 ` Mika Westerberg
2017-07-28 12:38 ` Applied "spi: pxa2xx: Don't touch CS pin until we have a transfer pending" to the spi tree Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).