Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] ARM: dts: pxa3xx: Fix polarity on Raumfeld SPI CS
@ 2019-07-16 21:35 Linus Walleij
  2019-07-17 21:05 ` Daniel Mack
  0 siblings, 1 reply; 2+ messages in thread
From: Linus Walleij @ 2019-07-16 21:35 UTC (permalink / raw)
  To: Daniel Mack, Haojian Zhuang, Robert Jarzmik
  Cc: Linus Walleij, linux-arm-kernel

The SPI CS is active low and you probably will get a
warning in dmesg of the DT core enforcing it active low.

The reason it was set as GPIO_ACTIVE_HIGH in the old
board file was that the old spi-gpio driver would
invert the value and drive it low deliberately to
activate CS. The SPI and gpiolib core handling now
expects proper polarity to be used in the machine
descriptions.

Cc: Daniel Mack <daniel@zonque.org>
Cc: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 arch/arm/boot/dts/pxa300-raumfeld-common.dtsi | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi b/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
index 8ac24e3c8513..86568637e6d9 100644
--- a/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
+++ b/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
@@ -78,9 +78,9 @@
 		gpio-miso = <&gpio 98 GPIO_ACTIVE_HIGH>;
 		gpio-mosi = <&gpio 97 GPIO_ACTIVE_HIGH>;
 		cs-gpios = <
-			&gpio 34 GPIO_ACTIVE_HIGH
-			&gpio 125 GPIO_ACTIVE_HIGH
-			&gpio 96 GPIO_ACTIVE_HIGH
+			&gpio 34 GPIO_ACTIVE_LOW
+			&gpio 125 GPIO_ACTIVE_LOW
+			&gpio 96 GPIO_ACTIVE_LOW
 		>;
 		num-chipselects = <3>;
 
-- 
2.21.0


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH] ARM: dts: pxa3xx: Fix polarity on Raumfeld SPI CS
  2019-07-16 21:35 [PATCH] ARM: dts: pxa3xx: Fix polarity on Raumfeld SPI CS Linus Walleij
@ 2019-07-17 21:05 ` Daniel Mack
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Mack @ 2019-07-17 21:05 UTC (permalink / raw)
  To: Linus Walleij, Haojian Zhuang, Robert Jarzmik; +Cc: linux-arm-kernel

On 16/7/2019 11:35 PM, Linus Walleij wrote:
> The SPI CS is active low and you probably will get a
> warning in dmesg of the DT core enforcing it active low.
> 
> The reason it was set as GPIO_ACTIVE_HIGH in the old
> board file was that the old spi-gpio driver would
> invert the value and drive it low deliberately to
> activate CS. The SPI and gpiolib core handling now
> expects proper polarity to be used in the machine
> descriptions.

Can't test this right now, but your explanation makes sense.

> Cc: Robert Jarzmik <robert.jarzmik@free.fr>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

Acked-by: Daniel Mack <daniel@zonque.org>



Thanks,
Daniel

> ---
>  arch/arm/boot/dts/pxa300-raumfeld-common.dtsi | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi b/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
> index 8ac24e3c8513..86568637e6d9 100644
> --- a/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
> +++ b/arch/arm/boot/dts/pxa300-raumfeld-common.dtsi
> @@ -78,9 +78,9 @@
>  		gpio-miso = <&gpio 98 GPIO_ACTIVE_HIGH>;
>  		gpio-mosi = <&gpio 97 GPIO_ACTIVE_HIGH>;
>  		cs-gpios = <
> -			&gpio 34 GPIO_ACTIVE_HIGH
> -			&gpio 125 GPIO_ACTIVE_HIGH
> -			&gpio 96 GPIO_ACTIVE_HIGH
> +			&gpio 34 GPIO_ACTIVE_LOW
> +			&gpio 125 GPIO_ACTIVE_LOW
> +			&gpio 96 GPIO_ACTIVE_LOW
>  		>;
>  		num-chipselects = <3>;
>  
> 


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-16 21:35 [PATCH] ARM: dts: pxa3xx: Fix polarity on Raumfeld SPI CS Linus Walleij
2019-07-17 21:05 ` Daniel Mack

Linux-ARM-Kernel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/0 linux-arm-kernel/git/0.git
	git clone --mirror https://lore.kernel.org/linux-arm-kernel/1 linux-arm-kernel/git/1.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-arm-kernel linux-arm-kernel/ https://lore.kernel.org/linux-arm-kernel \
		linux-arm-kernel@lists.infradead.org infradead-linux-arm-kernel@archiver.kernel.org
	public-inbox-index linux-arm-kernel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-arm-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox