linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] spi: amlogic: meson-spicc: Use pinctrl to drive CLK line when idle
@ 2022-10-04 11:10 Amjad Ouled-Ameur
  2022-10-04 11:10 ` [PATCH v2 1/2] spi: dt-bindings: amlogic, meson-gx-spicc: Add pinctrl names for SPI signal states Amjad Ouled-Ameur
  2022-10-04 11:10 ` [PATCH v2 2/2] spi: meson-spicc: Use pinctrl to drive CLK line when idle Amjad Ouled-Ameur
  0 siblings, 2 replies; 11+ messages in thread
From: Amjad Ouled-Ameur @ 2022-10-04 11:10 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Neil Armstrong, Rob Herring,
	Martin Blumenstingl, Kevin Hilman, Jerome Brunet, Mark Brown
  Cc: Neil Armstrong, Da Xue, linux-kernel, Amjad Ouled-Ameur,
	linux-spi, linux-amlogic, devicetree, linux-arm-kernel

Between SPI transactions, all SPI pins are in HiZ state. When using the SS
signal from the SPICC controller it's not an issue because when the
transaction resumes all pins come back to the right state at the same time
as SS.

The problem is when we use CS as a GPIO. In fact, between the GPIO CS
state change and SPI pins state change from idle, you can have a missing or
spurious clock transition.

Set a bias on the clock depending on the clock polarity requested before CS
goes active, by passing a special "idle-low" and "idle-high" pinctrl state
and setting the right state at a start of a message.

Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
---
Amjad Ouled-Ameur (2):
      spi: dt-bindings: amlogic, meson-gx-spicc: Add pinctrl names for SPI signal states
      spi: meson-spicc: Use pinctrl to drive CLK line when idle

 .../bindings/spi/amlogic,meson-gx-spicc.yaml       | 15 +++++++++
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 14 ++++++++
 drivers/spi/spi-meson-spicc.c                      | 39 +++++++++++++++++++++-
 3 files changed, 67 insertions(+), 1 deletion(-)
---
base-commit: 725737e7c21d2d25a4312c2aaa82a52bd03e3126
change-id: 20221004-up-aml-fix-spi-c2bb7e78e603

Best regards,
-- 
Amjad Ouled-Ameur <aouledameur@baylibre.com>

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

end of thread, other threads:[~2022-10-07  8:29 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-04 11:10 [PATCH v2 0/2] spi: amlogic: meson-spicc: Use pinctrl to drive CLK line when idle Amjad Ouled-Ameur
2022-10-04 11:10 ` [PATCH v2 1/2] spi: dt-bindings: amlogic, meson-gx-spicc: Add pinctrl names for SPI signal states Amjad Ouled-Ameur
2022-10-05  8:14   ` Krzysztof Kozlowski
2022-10-06 10:57     ` Amjad Ouled-Ameur
2022-10-06 14:11       ` Krzysztof Kozlowski
2022-10-06 15:48         ` Neil Armstrong
2022-10-07  7:04           ` Krzysztof Kozlowski
2022-10-07  7:45             ` neil.armstrong
2022-10-07  8:17               ` Krzysztof Kozlowski
2022-10-07  8:29                 ` Krzysztof Kozlowski
2022-10-04 11:10 ` [PATCH v2 2/2] spi: meson-spicc: Use pinctrl to drive CLK line when idle Amjad Ouled-Ameur

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).