0001 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
0002 %YAML 1.2
0003 ---
0004 $id: http://devicetree.org/schemas/spi/spi-mux.yaml#
0005 $schema: http://devicetree.org/meta-schemas/core.yaml#
0006
0007 title: Generic SPI Multiplexer
0008
0009 description: |
0010 This binding describes a SPI bus multiplexer to route the SPI chip select
0011 signals. This can be used when you need more devices than the SPI controller
0012 has chip selects available. An example setup is shown in ASCII art; the actual
0013 setting of the multiplexer to a channel needs to be done by a specific SPI mux
0014 driver.
0015
0016 MOSI /--------------------------------+--------+--------+--------\
0017 MISO |/------------------------------+|-------+|-------+|-------\|
0018 SCL ||/----------------------------+||------+||------+||------\||
0019 ||| ||| ||| ||| |||
0020 +------------+ ||| ||| ||| |||
0021 | SoC ||| | +-+++-+ +-+++-+ +-+++-+ +-+++-+
0022 | ||| | | dev | | dev | | dev | | dev |
0023 | +--+++-+ | CS-X +------+\ +--+--+ +--+--+ +--+--+ +--+--+
0024 | | SPI +-|-------+ Mux |\\ CS-0 | | | |
0025 | +------+ | +--+---+\\\-------/ CS-1 | | |
0026 | | | \\\----------------/ CS-2 | |
0027 | +------+ | | \\-------------------------/ CS-3 |
0028 | | ? +-|----------/ \----------------------------------/
0029 | +------+ |
0030 +------------+
0031
0032 allOf:
0033 - $ref: "/schemas/spi/spi-controller.yaml#"
0034 - $ref: "/schemas/spi/spi-peripheral-props.yaml#"
0035
0036 maintainers:
0037 - Chris Packham <chris.packham@alliedtelesis.co.nz>
0038
0039 properties:
0040 compatible:
0041 const: spi-mux
0042
0043 mux-controls:
0044 maxItems: 1
0045
0046 required:
0047 - compatible
0048 - reg
0049 - spi-max-frequency
0050 - mux-controls
0051
0052 unevaluatedProperties: false
0053
0054 examples:
0055 - |
0056 #include <dt-bindings/gpio/gpio.h>
0057 mux: mux-controller {
0058 compatible = "gpio-mux";
0059 #mux-control-cells = <0>;
0060
0061 mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
0062 };
0063
0064 spi {
0065 #address-cells = <1>;
0066 #size-cells = <0>;
0067 spi@0 {
0068 compatible = "spi-mux";
0069 reg = <0>;
0070 #address-cells = <1>;
0071 #size-cells = <0>;
0072 spi-max-frequency = <100000000>;
0073
0074 mux-controls = <&mux>;
0075
0076 flash@0 {
0077 compatible = "jedec,spi-nor";
0078 reg = <0>;
0079 spi-max-frequency = <40000000>;
0080 };
0081
0082 sensor@1 {
0083 compatible = "bosch,bme680";
0084 reg = <1>;
0085 spi-max-frequency = <10000000>;
0086 };
0087 };
0088 };