Linux SPI subsystem development
 help / color / mirror / Atom feed
* [PATCH] spi: rb4xx: Fix set_cs logic.
@ 2015-04-20 13:53 Bert Vermeulen
       [not found] ` <1429538005-1985-1-git-send-email-bert-Nh2F35Ii2RQ@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Bert Vermeulen @ 2015-04-20 13:53 UTC (permalink / raw)
  To: broonie-DgEjT+Ai2ygdnm+yROfE0A, linux-spi-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: Bert Vermeulen

As it turns out, the set_cs() enable parameter refers to the logic level
on the CS pin, not the state of chip selection.

This broke functionality of the LEDs behind the CPLD, or at least delayed
the commands until another one came in to toggle CS.

Signed-off-by: Bert Vermeulen <bert-Nh2F35Ii2RQ@public.gmane.org>
---
 drivers/spi/spi-rb4xx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/spi-rb4xx.c b/drivers/spi/spi-rb4xx.c
index 9b449d4..50f49f3 100644
--- a/drivers/spi/spi-rb4xx.c
+++ b/drivers/spi/spi-rb4xx.c
@@ -90,7 +90,7 @@ static void rb4xx_set_cs(struct spi_device *spi, bool enable)
 	 * since it's all on the same hardware register. However the
 	 * CPLD needs CS deselected after every command.
 	 */
-	if (!enable)
+	if (enable)
 		rb4xx_write(rbspi, AR71XX_SPI_REG_IOC,
 			    AR71XX_SPI_IOC_CS0 | AR71XX_SPI_IOC_CS1);
 }
-- 
1.9.1

--
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] 5+ messages in thread

end of thread, other threads:[~2015-04-21 11:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-20 13:53 [PATCH] spi: rb4xx: Fix set_cs logic Bert Vermeulen
     [not found] ` <1429538005-1985-1-git-send-email-bert-Nh2F35Ii2RQ@public.gmane.org>
2015-04-20 20:37   ` Mark Brown
     [not found]     ` <20150420203703.GG14892-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2015-04-21  9:46       ` Geert Uytterhoeven
2015-04-21 11:01         ` Bert Vermeulen
2015-04-21 11:09           ` Mark Brown

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