devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3] spi: dt-bindings: Document CS active-high
@ 2024-12-16  9:57 Iker Pedrosa
  2024-12-17 15:32 ` Rob Herring (Arm)
  2024-12-17 17:44 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Iker Pedrosa @ 2024-12-16  9:57 UTC (permalink / raw)
  To: linux-kernel
  Cc: Iker Pedrosa, broonie, robh, krzk+dt, conor+dt, linux-spi,
	devicetree, javierm

The current documentation does not clearly explain how to invert the SPI
CS signal to make it active-high. This makes it very difficult to
understand.

This patch adds a simple explanation on how to set the CS line in
active-high and adds an example to make it easier for users who need
that setup for their SPI peripherals.

Link: https://forums.raspberrypi.com/viewtopic.php?t=378222
Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
---

Changes in v3:
- Use subject line reflecting the style of the subsystem (Mark Brown)
- Change compatible display to an existing one and adapt SPI MAX frequency (Rob
  Herring)

Changes in v2:
- Include header for GPIO_ACTIVE_HIGH (Rob Herring)

 .../bindings/spi/spi-controller.yaml          | 25 +++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/Documentation/devicetree/bindings/spi/spi-controller.yaml b/Documentation/devicetree/bindings/spi/spi-controller.yaml
index 093150c0cb87..82d051f7bd6e 100644
--- a/Documentation/devicetree/bindings/spi/spi-controller.yaml
+++ b/Documentation/devicetree/bindings/spi/spi-controller.yaml
@@ -69,6 +69,11 @@ properties:
          Should be generally avoided and be replaced by
          spi-cs-high + ACTIVE_HIGH.
 
+      The simplest way to obtain an active-high CS signal is to configure the
+      controller's cs-gpio property with the ACTIVE_HIGH flag and set the
+      peripheral's spi-cs-high property. See example below for a better
+      understanding.
+
   fifo-depth:
     $ref: /schemas/types.yaml#/definitions/uint32
     description:
@@ -189,3 +194,23 @@ examples:
             stacked-memories = /bits/ 64 <0x10000000 0x10000000>;
         };
     };
+
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+
+    spi@20204000 {
+        #address-cells = <1>;
+        #size-cells = <0>;
+        compatible = "brcm,bcm2835-spi";
+        reg = <0x7e204000 0x1000>;
+        interrupts = <2 22>;
+        clocks = <&clk_spi>;
+        cs-gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
+
+        display@0 {
+            compatible = "lg,lg4573";
+            spi-max-frequency = <1000000>;
+            reg = <0>;
+            spi-cs-high;
+        };
+    };
-- 
2.47.1


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

* Re: [PATCH v3] spi: dt-bindings: Document CS active-high
  2024-12-16  9:57 [PATCH v3] spi: dt-bindings: Document CS active-high Iker Pedrosa
@ 2024-12-17 15:32 ` Rob Herring (Arm)
  2024-12-17 17:44 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Rob Herring (Arm) @ 2024-12-17 15:32 UTC (permalink / raw)
  To: Iker Pedrosa
  Cc: javierm, krzk+dt, linux-spi, conor+dt, linux-kernel, broonie,
	devicetree


On Mon, 16 Dec 2024 10:57:33 +0100, Iker Pedrosa wrote:
> The current documentation does not clearly explain how to invert the SPI
> CS signal to make it active-high. This makes it very difficult to
> understand.
> 
> This patch adds a simple explanation on how to set the CS line in
> active-high and adds an example to make it easier for users who need
> that setup for their SPI peripherals.
> 
> Link: https://forums.raspberrypi.com/viewtopic.php?t=378222
> Signed-off-by: Iker Pedrosa <ikerpedrosam@gmail.com>
> ---
> 
> Changes in v3:
> - Use subject line reflecting the style of the subsystem (Mark Brown)
> - Change compatible display to an existing one and adapt SPI MAX frequency (Rob
>   Herring)
> 
> Changes in v2:
> - Include header for GPIO_ACTIVE_HIGH (Rob Herring)
> 
>  .../bindings/spi/spi-controller.yaml          | 25 +++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


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

* Re: [PATCH v3] spi: dt-bindings: Document CS active-high
  2024-12-16  9:57 [PATCH v3] spi: dt-bindings: Document CS active-high Iker Pedrosa
  2024-12-17 15:32 ` Rob Herring (Arm)
@ 2024-12-17 17:44 ` Mark Brown
  1 sibling, 0 replies; 3+ messages in thread
From: Mark Brown @ 2024-12-17 17:44 UTC (permalink / raw)
  To: linux-kernel, Iker Pedrosa
  Cc: robh, krzk+dt, conor+dt, linux-spi, devicetree, javierm

On Mon, 16 Dec 2024 10:57:33 +0100, Iker Pedrosa wrote:
> The current documentation does not clearly explain how to invert the SPI
> CS signal to make it active-high. This makes it very difficult to
> understand.
> 
> This patch adds a simple explanation on how to set the CS line in
> active-high and adds an example to make it easier for users who need
> that setup for their SPI peripherals.
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: dt-bindings: Document CS active-high
      commit: 7b4035ebf2af2c2f1450e8c38bf4f41acd3f01bf

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


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

end of thread, other threads:[~2024-12-17 17:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-16  9:57 [PATCH v3] spi: dt-bindings: Document CS active-high Iker Pedrosa
2024-12-17 15:32 ` Rob Herring (Arm)
2024-12-17 17:44 ` Mark Brown

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