WIP FPC-III support
[linux/fpc-iii.git] / Documentation / devicetree / bindings / spi / spi-mux.yaml
blob6c21a132b51ffa728a489226071e999553a47523
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/spi/spi-mux.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
7 title: Generic SPI Multiplexer
9 description: |
10   This binding describes a SPI bus multiplexer to route the SPI chip select
11   signals. This can be used when you need more devices than the SPI controller
12   has chip selects available. An example setup is shown in ASCII art; the actual
13   setting of the multiplexer to a channel needs to be done by a specific SPI mux
14   driver.
16         MOSI /--------------------------------+--------+--------+--------\
17         MISO |/------------------------------+|-------+|-------+|-------\|
18          SCL ||/----------------------------+||------+||------+||------\||
19              |||                            |||      |||      |||      |||
20       +------------+                        |||      |||      |||      |||
21       | SoC  |||   |                      +-+++-+  +-+++-+  +-+++-+  +-+++-+
22       |      |||   |                      | dev |  | dev |  | dev |  | dev |
23       |   +--+++-+ | CS-X  +------+\      +--+--+  +--+--+  +--+--+  +--+--+
24       |   | SPI  +-|-------+ Mux  |\\   CS-0 |        |        |        |
25       |   +------+ |       +--+---+\\\-------/   CS-1 |        |        |
26       |            |          |    \\\----------------/   CS-2 |        |
27       |   +------+ |          |     \\-------------------------/   CS-3 |
28       |   | ?    +-|----------/      \----------------------------------/
29       |   +------+ |
30       +------------+
32 allOf:
33   - $ref: "/schemas/spi/spi-controller.yaml#"
35 maintainers:
36   - Chris Packham <chris.packham@alliedtelesis.co.nz>
38 properties:
39   compatible:
40     const: spi-mux
42   mux-controls:
43     maxItems: 1
45 required:
46   - compatible
47   - reg
48   - spi-max-frequency
49   - mux-controls
51 unevaluatedProperties: false
53 examples:
54   - |
55     #include <dt-bindings/gpio/gpio.h>
56     mux: mux-controller {
57         compatible = "gpio-mux";
58         #mux-control-cells = <0>;
60         mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
61     };
63     spi {
64         #address-cells = <1>;
65         #size-cells = <0>;
66         spi@0 {
67             compatible = "spi-mux";
68             reg = <0>;
69             #address-cells = <1>;
70             #size-cells = <0>;
71             spi-max-frequency = <100000000>;
73             mux-controls = <&mux>;
75             spi-flash@0 {
76                 compatible = "jedec,spi-nor";
77                 reg = <0>;
78                 #address-cells = <1>;
79                 #size-cells = <0>;
80                 spi-max-frequency = <40000000>;
81             };
83             spi-device@1 {
84                 compatible = "lineartechnology,ltc2488";
85                 reg = <1>;
86                 #address-cells = <1>;
87                 #size-cells = <0>;
88                 spi-max-frequency = <10000000>;
89             };
90         };
91     };