Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH v1] spi: fix client driver can't register success when use GPIO as CS
@ 2021-05-06 11:49 Xin Hao
  2021-05-06 12:30 ` Linus Walleij
  0 siblings, 1 reply; 14+ messages in thread
From: Xin Hao @ 2021-05-06 11:49 UTC (permalink / raw)
  To: broonie; +Cc: thesven73, linus.walleij, linux-spi

When i was testing the TPM2 device, I found that the driver
always failed to register which used SPI bus and GPIO as CS
signal, i found that the reason for the error was that CS could
not be set correctly, so there fixed it.

Fixes: 766c6b63aa044e ("spi: fix client driver breakages when using
GPIO descriptors")
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index b08efe88ccd6..d4342909c1c8 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -826,7 +826,7 @@ static void spi_set_cs(struct spi_device *spi, bool enable)
 			if (spi->cs_gpiod)
 				/* polarity handled by gpiolib */
 				gpiod_set_value_cansleep(spi->cs_gpiod,
-							 enable1);
+							 !enable);
 			else
 				/*
 				 * invert the enable line, as active low is
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2021-05-10 15:06 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-06 11:49 [PATCH v1] spi: fix client driver can't register success when use GPIO as CS Xin Hao
2021-05-06 12:30 ` Linus Walleij
2021-05-06 14:16   ` Andy Shevchenko
2021-05-07  1:55     ` Xin Hao
     [not found]       ` <CAHp75Vev1D5+QWyGCm+HgpdAyT4Uq_OAp7dCemVf9Cdvoay=Og@mail.gmail.com>
     [not found]         ` <6bd8f178-51a2-3f45-8a16-80fdd4a3ed8e@linux.alibaba.com>
     [not found]           ` <CAHp75Vfh+jqNLLbwWDe8pi1dQafnNFHak1Hk=5Cw3J+kJX9r3Q@mail.gmail.com>
2021-05-07 21:33             ` Linus Walleij
2021-05-08  1:22               ` xhao
2021-05-08  2:36               ` Sven Van Asbroeck
2021-05-08 11:38                 ` Sven Van Asbroeck
     [not found]                 ` <CAHp75VfD5kEnjvvRWUJwpmFaWksnnTf_ewBNDsxz3W3kQMUv+w@mail.gmail.com>
2021-05-08 11:46                   ` Sven Van Asbroeck
2021-05-08 12:48                     ` Sven Van Asbroeck
2021-05-10 11:36                     ` Andy Shevchenko
2021-05-10 13:56                       ` Sven Van Asbroeck
2021-05-10 14:01                         ` Andy Shevchenko
2021-05-10 14:27                           ` Sven Van Asbroeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox