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