Commit | Line | Data |
---|---|---|
d548ed71 CP |
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# | |
6 | ||
7 | title: Generic SPI Multiplexer | |
8 | ||
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. | |
15 | ||
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 | +------------+ | |
31 | ||
32 | allOf: | |
33 | - $ref: "/schemas/spi/spi-controller.yaml#" | |
34 | ||
35 | maintainers: | |
36 | - Chris Packham <chris.packham@alliedtelesis.co.nz> | |
37 | ||
38 | properties: | |
39 | compatible: | |
40 | const: spi-mux | |
41 | ||
42 | mux-controls: | |
43 | maxItems: 1 | |
44 | ||
45 | required: | |
f516fb70 RH |
46 | - compatible |
47 | - reg | |
48 | - spi-max-frequency | |
49 | - mux-controls | |
d548ed71 CP |
50 | |
51 | examples: | |
f516fb70 RH |
52 | - | |
53 | #include <dt-bindings/gpio/gpio.h> | |
54 | mux: mux-controller { | |
55 | compatible = "gpio-mux"; | |
56 | #mux-control-cells = <0>; | |
d548ed71 | 57 | |
f516fb70 RH |
58 | mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; |
59 | }; | |
d548ed71 | 60 | |
f516fb70 RH |
61 | spi { |
62 | #address-cells = <1>; | |
63 | #size-cells = <0>; | |
64 | spi@0 { | |
65 | compatible = "spi-mux"; | |
66 | reg = <0>; | |
67 | #address-cells = <1>; | |
68 | #size-cells = <0>; | |
69 | spi-max-frequency = <100000000>; | |
d548ed71 | 70 | |
f516fb70 | 71 | mux-controls = <&mux>; |
d548ed71 | 72 | |
f516fb70 RH |
73 | spi-flash@0 { |
74 | compatible = "jedec,spi-nor"; | |
75 | reg = <0>; | |
76 | #address-cells = <1>; | |
77 | #size-cells = <0>; | |
78 | spi-max-frequency = <40000000>; | |
79 | }; | |
d548ed71 | 80 | |
f516fb70 RH |
81 | spi-device@1 { |
82 | compatible = "lineartechnology,ltc2488"; | |
83 | reg = <1>; | |
84 | #address-cells = <1>; | |
85 | #size-cells = <0>; | |
86 | spi-max-frequency = <10000000>; | |
87 | }; | |
88 | }; | |
89 | }; |