Generic SPI Multiplexer
Schema identifier ($id): "http://devicetree.org/schemas/spi/spi-mux.yaml#"
Schema dialect ($schema): "http://devicetree.org/meta-schemas/core.yaml#"
This binding describes a SPI bus multiplexer to route the SPI chip select signals. This can be used when you need more devices than the SPI controller has chip selects available. An example setup is shown in ASCII art; the actual setting of the multiplexer to a channel needs to be done by a specific SPI mux driver.
MOSI /--------------------------------+--------+--------+--------\
MISO |/------------------------------+|-------+|-------+|-------\|
SCL ||/----------------------------+||------+||------+||------\||
||| ||| ||| ||| |||
+------------+ ||| ||| ||| |||
| SoC ||| | +-+++-+ +-+++-+ +-+++-+ +-+++-+
| ||| | | dev | | dev | | dev | | dev |
| +--+++-+ | CS-X +------+\ +--+--+ +--+--+ +--+--+ +--+--+
| | SPI +-|-------+ Mux |\\ CS-0 | | | |
| +------+ | +--+---+\\\-------/ CS-1 | | |
| | | \\\----------------/ CS-2 | |
| +------+ | | \\-------------------------/ CS-3 |
| | ? +-|----------/ \----------------------------------/
| +------+ |
+------------+
All of these rules must match (allOf) #
Rule 1 #
Shared schema rule (
$ref):/schemas/spi/spi-controller.yaml#
Rule 2 #
Shared schema rule (
$ref):/schemas/spi/spi-peripheral-props.yaml#
Maintainers (maintainers): "Chris Packham <chris.packham@alliedtelesis.co.nz>"
Properties and child nodes (properties) #
compatible — required here #
Exact value (const): "spi-mux"
mux-controls — required here #
Maximum number of items (maxItems): 1
Required in this object (required): "compatible", "reg", "mux-controls"
Properties not evaluated by applicable rules (unevaluatedProperties) #
false
Not allowed by this rule.
Examples (examples) #
#include <dt-bindings/gpio/gpio.h>
mux: mux-controller {
compatible = "gpio-mux";
#mux-control-cells = <0>;
mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
};
spi {
#address-cells = <1>;
#size-cells = <0>;
spi@0 {
compatible = "spi-mux";
reg = <0>;
#address-cells = <1>;
#size-cells = <0>;
spi-max-frequency = <100000000>;
mux-controls = <&mux>;
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <40000000>;
};
sensor@1 {
compatible = "bosch,bme680";
reg = <1>;
spi-max-frequency = <10000000>;
};
};
};
Source notes #
Annotations retained from the schema source
Line 1: SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)