linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / 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 related	[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, other threads:[~2019-07-17 21:05 UTC | newest]

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

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