[PATCH v5 3/7] dt-bindings: mikrobus: Add mikrobus-spi binding

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add bindings for MikroBUS boards using SPI interface.

Almost all of the properties that are valid for SPI devices can be used
except reg. Since the goal is to allow use of the same MikroBUS board
across different connectors, config needs to be independent of the actual
SPI controller in mikroBUS port(s), it is not possible to define the
chipselect by number in advance. Thus, `spi-cs-apply` property is used to
specify the chipselect(s) by name.

Another important fact is that while there is a CS pin in the mikroBUS
connector, some boards (eg SPI Extend Click) use additional pins as
chipselect. Thus we need a way to specify the CS pin(s) in terms of
mikcrobus-connector which can then handle bindings the actual CS pin(s).

Link: https://www.mikroe.com/spi-extend-click SPI Extend Click

Signed-off-by: Ayush Singh <ayush@xxxxxxxxxxxxxxx>
---
 .../devicetree/bindings/mikrobus/mikrobus-spi.yaml | 37 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 2 files changed, 38 insertions(+)

diff --git a/Documentation/devicetree/bindings/mikrobus/mikrobus-spi.yaml b/Documentation/devicetree/bindings/mikrobus/mikrobus-spi.yaml
new file mode 100644
index 000000000000..35ca2cce3b03
--- /dev/null
+++ b/Documentation/devicetree/bindings/mikrobus/mikrobus-spi.yaml
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mikrobus/mikrobus-spi.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: mikroBUS add-on board using SPI
+
+maintainers:
+  - Ayush Singh <ayush@xxxxxxxxxxxxxxx>
+
+allOf:
+  - $ref: /schemas/mikrobus/mikrobus-board.yaml#
+
+properties:
+  compatible:
+    const: mikrobus-spi
+
+  spi-cs-apply:
+    minItems: 1
+    maxItems: 12
+    items:
+      enum: [default, pwm, int, rx, tx, scl, sda, an, rst, sck, cipo, copi]
+
+required:
+  - compatible
+
+additionalProperties: false
+
+examples:
+  - |
+    thermo-click {
+      compatible = "maxim,max31855k", "mikrobus,spi";
+      spi-max-frequency = <1000000>;
+      pinctrl-apply = "default", "spi_default";
+      spi-cs-apply = "default";
+    };
diff --git a/MAINTAINERS b/MAINTAINERS
index 14eba18832d5..88f2b3adc824 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -15114,6 +15114,7 @@ M:	Vaishnav M A <vaishnav@xxxxxxxxxxxxxxx>
 S:	Maintained
 F:	Documentation/devicetree/bindings/connector/mikrobus-connector.yaml
 F:	Documentation/devicetree/bindings/mikrobus/mikrobus-board.yaml
+F:	Documentation/devicetree/bindings/mikrobus/mikrobus-spi.yaml
 
 MIKROTIK CRS3XX 98DX3236 BOARD SUPPORT
 M:	Luka Kovacic <luka.kovacic@xxxxxxxxxx>

-- 
2.45.2





[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux