1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-C 1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) 2 %YAML 1.2 2 %YAML 1.2 3 --- 3 --- 4 $id: http://devicetree.org/schemas/spi/spi-mux 4 $id: http://devicetree.org/schemas/spi/spi-mux.yaml# 5 $schema: http://devicetree.org/meta-schemas/co 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 6 6 7 title: Generic SPI Multiplexer 7 title: Generic SPI Multiplexer 8 8 9 description: | 9 description: | 10 This binding describes a SPI bus multiplexer 10 This binding describes a SPI bus multiplexer to route the SPI chip select 11 signals. This can be used when you need more 11 signals. This can be used when you need more devices than the SPI controller 12 has chip selects available. An example setup 12 has chip selects available. An example setup is shown in ASCII art; the actual 13 setting of the multiplexer to a channel need 13 setting of the multiplexer to a channel needs to be done by a specific SPI mux 14 driver. 14 driver. 15 15 16 MOSI /-------------------------------- 16 MOSI /--------------------------------+--------+--------+--------\ 17 MISO |/------------------------------+ 17 MISO |/------------------------------+|-------+|-------+|-------\| 18 SCL ||/----------------------------+| 18 SCL ||/----------------------------+||------+||------+||------\|| 19 ||| || 19 ||| ||| ||| ||| ||| 20 +------------+ || 20 +------------+ ||| ||| ||| ||| 21 | SoC ||| | +-++ 21 | SoC ||| | +-+++-+ +-+++-+ +-+++-+ +-+++-+ 22 | ||| | | de 22 | ||| | | dev | | dev | | dev | | dev | 23 | +--+++-+ | CS-X +------+\ +--+ 23 | +--+++-+ | CS-X +------+\ +--+--+ +--+--+ +--+--+ +--+--+ 24 | | SPI +-|-------+ Mux |\\ CS-0 | 24 | | SPI +-|-------+ Mux |\\ CS-0 | | | | 25 | +------+ | +--+---+\\\-------/ 25 | +------+ | +--+---+\\\-------/ CS-1 | | | 26 | | | \\\-------- 26 | | | \\\----------------/ CS-2 | | 27 | +------+ | | \\-------- 27 | +------+ | | \\-------------------------/ CS-3 | 28 | | ? +-|----------/ \-------- 28 | | ? +-|----------/ \----------------------------------/ 29 | +------+ | 29 | +------+ | 30 +------------+ 30 +------------+ 31 31 32 allOf: 32 allOf: 33 - $ref: /schemas/spi/spi-controller.yaml# 33 - $ref: /schemas/spi/spi-controller.yaml# 34 - $ref: /schemas/spi/spi-peripheral-props.ya 34 - $ref: /schemas/spi/spi-peripheral-props.yaml# 35 35 36 maintainers: 36 maintainers: 37 - Chris Packham <chris.packham@alliedtelesis. 37 - Chris Packham <chris.packham@alliedtelesis.co.nz> 38 38 39 properties: 39 properties: 40 compatible: 40 compatible: 41 const: spi-mux 41 const: spi-mux 42 42 43 mux-controls: 43 mux-controls: 44 maxItems: 1 44 maxItems: 1 45 45 46 required: 46 required: 47 - compatible 47 - compatible 48 - reg 48 - reg 49 - spi-max-frequency 49 - spi-max-frequency 50 - mux-controls 50 - mux-controls 51 51 52 unevaluatedProperties: false 52 unevaluatedProperties: false 53 53 54 examples: 54 examples: 55 - | 55 - | 56 #include <dt-bindings/gpio/gpio.h> 56 #include <dt-bindings/gpio/gpio.h> 57 mux: mux-controller { 57 mux: mux-controller { 58 compatible = "gpio-mux"; 58 compatible = "gpio-mux"; 59 #mux-control-cells = <0>; 59 #mux-control-cells = <0>; 60 60 61 mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH 61 mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; 62 }; 62 }; 63 63 64 spi { 64 spi { 65 #address-cells = <1>; 65 #address-cells = <1>; 66 #size-cells = <0>; 66 #size-cells = <0>; 67 spi@0 { 67 spi@0 { 68 compatible = "spi-mux"; 68 compatible = "spi-mux"; 69 reg = <0>; 69 reg = <0>; 70 #address-cells = <1>; 70 #address-cells = <1>; 71 #size-cells = <0>; 71 #size-cells = <0>; 72 spi-max-frequency = <100000000>; 72 spi-max-frequency = <100000000>; 73 73 74 mux-controls = <&mux>; 74 mux-controls = <&mux>; 75 75 76 flash@0 { 76 flash@0 { 77 compatible = "jedec,spi-nor"; 77 compatible = "jedec,spi-nor"; 78 reg = <0>; 78 reg = <0>; 79 spi-max-frequency = <40000000> 79 spi-max-frequency = <40000000>; 80 }; 80 }; 81 81 82 sensor@1 { 82 sensor@1 { 83 compatible = "bosch,bme680"; 83 compatible = "bosch,bme680"; 84 reg = <1>; 84 reg = <1>; 85 spi-max-frequency = <10000000> 85 spi-max-frequency = <10000000>; 86 }; 86 }; 87 }; 87 }; 88 }; 88 };
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.