Skip to content

Commit 7b4035e

Browse files
ikerexxebroonie
authored andcommitted
spi: dt-bindings: Document CS active-high
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> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Link: https://patch.msgid.link/20241216095739.27320-1-ikerpedrosam@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent e490cef commit 7b4035e

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Documentation/devicetree/bindings/spi/spi-controller.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ properties:
6969
Should be generally avoided and be replaced by
7070
spi-cs-high + ACTIVE_HIGH.
7171
72+
The simplest way to obtain an active-high CS signal is to configure the
73+
controller's cs-gpio property with the ACTIVE_HIGH flag and set the
74+
peripheral's spi-cs-high property. See example below for a better
75+
understanding.
76+
7277
fifo-depth:
7378
$ref: /schemas/types.yaml#/definitions/uint32
7479
description:
@@ -189,3 +194,23 @@ examples:
189194
stacked-memories = /bits/ 64 <0x10000000 0x10000000>;
190195
};
191196
};
197+
198+
- |
199+
#include <dt-bindings/gpio/gpio.h>
200+
201+
spi@20204000 {
202+
#address-cells = <1>;
203+
#size-cells = <0>;
204+
compatible = "brcm,bcm2835-spi";
205+
reg = <0x7e204000 0x1000>;
206+
interrupts = <2 22>;
207+
clocks = <&clk_spi>;
208+
cs-gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
209+
210+
display@0 {
211+
compatible = "lg,lg4573";
212+
spi-max-frequency = <1000000>;
213+
reg = <0>;
214+
spi-cs-high;
215+
};
216+
};

0 commit comments

Comments
 (0)