From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Packham Subject: [PATCH v3 1/2] dt-bindings: spi: Document binding for generic SPI multiplexer Date: Tue, 28 Jan 2020 10:04:14 +1300 Message-ID: <20200127210415.5708-2-chris.packham@alliedtelesis.co.nz> References: <20200127210415.5708-1-chris.packham@alliedtelesis.co.nz> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Cc: linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Chris Packham To: broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org Return-path: In-Reply-To: <20200127210415.5708-1-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org> Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Add binding documentation for the spi-mux driver. This allows a generic multiplexer to be used to provide access to multiple SPI devices. Signed-off-by: Chris Packham --- Notes: Changes in v3: - make dt_binding_check clean (properly this time) =20 Changes in v2: - update license - make dt_binding_check clean .../devicetree/bindings/spi/spi-mux.yaml | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 Documentation/devicetree/bindings/spi/spi-mux.yaml diff --git a/Documentation/devicetree/bindings/spi/spi-mux.yaml b/Documen= tation/devicetree/bindings/spi/spi-mux.yaml new file mode 100644 index 000000000000..0ae692dc28b5 --- /dev/null +++ b/Documentation/devicetree/bindings/spi/spi-mux.yaml @@ -0,0 +1,89 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/spi/spi-mux.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Generic SPI Multiplexer + +description: | + This binding describes a SPI bus multiplexer to route the SPI chip sel= ect + signals. This can be used when you need more devices than the SPI cont= roller + has chip selects available. An example setup is shown in ASCII art; th= e 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 | | d= ev | + | +--+++-+ | CS-X +------+\ +--+--+ +--+--+ +--+--+ +--= +--+ + | | SPI +-|-------+ Mux |\\ CS-0 | | | = | + | +------+ | +--+---+\\\-------/ CS-1 | | = | + | | | \\\----------------/ CS-2 | = | + | +------+ | | \\-------------------------/ CS-3 = | + | | ? +-|----------/ \----------------------------------= / + | +------+ | + +------------+ + +allOf: + - $ref: "/schemas/spi/spi-controller.yaml#" + +maintainers: + - Chris Packham + +properties: + compatible: + const: spi-mux + + mux-controls: + maxItems: 1 + +required: + - compatible + - reg + - spi-max-frequency + - mux-controls + +examples: + - | + #include + mux: mux-controller { + compatible =3D "gpio-mux"; + #mux-control-cells =3D <0>; + + mux-gpios =3D <&gpio0 3 GPIO_ACTIVE_HIGH>; + }; + + spi { + #address-cells =3D <1>; + #size-cells =3D <0>; + spi@0 { + compatible =3D "spi-mux"; + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + spi-max-frequency =3D <100000000>; + + mux-controls =3D <&mux>; + + spi-flash@0 { + compatible =3D "jedec,spi-nor"; + reg =3D <0>; + #address-cells =3D <1>; + #size-cells =3D <0>; + spi-max-frequency =3D <40000000>; + }; + + spi-device@1 { + compatible =3D "lineartechnology,ltc2488"; + reg =3D <1>; + #address-cells =3D <1>; + #size-cells =3D <0>; + spi-max-frequency =3D <10000000>; + }; + }; + }; --=20 2.25.0