]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
BCM270X_DT: Add spi0-cs overlay
authorPhil Elwell <phil@raspberrypi.org>
Mon, 16 Jan 2017 14:53:12 +0000 (14:53 +0000)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Tue, 19 Sep 2017 10:07:49 +0000 (12:07 +0200)
The spi0-cs overlay allows the software chip selectts to be modified
using the cs0_pin and cs1_pin parameters.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
arch/arm/boot/dts/overlays/Makefile
arch/arm/boot/dts/overlays/README
arch/arm/boot/dts/overlays/spi0-cs-overlay.dts [new file with mode: 0644]

index f1191c1ded82490be5f793ab6483bc5af5891db2..45fafd5c39bdc6e80b12e49d3bcd281638bec471 100644 (file)
@@ -83,6 +83,7 @@ dtbo-$(CONFIG_ARCH_BCM2835) += \
        smi-nand.dtbo \
        spi-gpio35-39.dtbo \
        spi-rtc.dtbo \
+       spi0-cs.dtbo \
        spi0-hw-cs.dtbo \
        spi1-1cs.dtbo \
        spi1-2cs.dtbo \
index 34109c69416c1caf28910895320a2b9cd539588e..4992a6203a5507144b6d405e03ed2bebaa11325f 100644 (file)
@@ -1138,7 +1138,7 @@ Params: <None>
 
 
 Name:   spi-gpio35-39
-Info:   move SPI function block to GPIO 35 to 39
+Info:   Move SPI function block to GPIO 35 to 39
 Load:   dtoverlay=spi-gpio35-39
 Params: <None>
 
@@ -1149,6 +1149,13 @@ Load:   dtoverlay=spi-rtc,<param>=<val>
 Params: pcf2123                 Select the PCF2123 device
 
 
+Name:   spi0-cs
+Info:   Allows the (software) CS pins for SPI0 to be changed
+Load:   dtoverlay=spi0-cs,<param>=<val>
+Params: cs0_pin                 GPIO pin for CS0 (default 8)
+        cs1_pin                 GPIO pin for CS1 (default 7)
+
+
 Name:   spi0-hw-cs
 Info:   Re-enables hardware CS/CE (chip selects) for SPI0
 Load:   dtoverlay=spi0-hw-cs
diff --git a/arch/arm/boot/dts/overlays/spi0-cs-overlay.dts b/arch/arm/boot/dts/overlays/spi0-cs-overlay.dts
new file mode 100644 (file)
index 0000000..7f79029
--- /dev/null
@@ -0,0 +1,29 @@
+/dts-v1/;
+/plugin/;
+
+
+/ {
+       compatible = "brcm,bcm2835", "brcm,bcm2708", "brcm,bcm2709";
+
+       fragment@0 {
+               target = <&spi0_cs_pins>;
+               frag0: __overlay__ {
+                       brcm,pins = <8 7>;
+               };
+       };
+
+       fragment@1 {
+               target = <&spi0>;
+               frag1: __overlay__ {
+                       cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
+                       status = "okay";
+               };
+       };
+
+       __overrides__ {
+               cs0_pin  = <&frag0>,"brcm,pins:0",
+                          <&frag1>,"cs-gpios:4";
+               cs1_pin  = <&frag0>,"brcm,pins:4",
+                          <&frag1>,"cs-gpios:16";
+       };
+};