Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4464138ybl; Mon, 3 Feb 2020 19:31:51 -0800 (PST) X-Google-Smtp-Source: APXvYqyWxsn7qRRKhPL3WvHIhSOy8M1GOjCq6G3P+o08cNPGZzw2TN4sqPBFMmdTyWnGb4NuIh8i X-Received: by 2002:aca:1314:: with SMTP id e20mr1979764oii.112.1580787111646; Mon, 03 Feb 2020 19:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580787111; cv=none; d=google.com; s=arc-20160816; b=dSZ7symUoYZRX4JDm92VjtHG+f7AtaqRX/+o1GiKYYFbrrg59HT/LTsMK0CY07zbtJ QOjWKlKl8VCAI/K6DzeeS/CE/8QYf2aKkW5vMATsZr09bIWNuE33n6V3AjRBoFBEp4MS iw8kebXjEAce/IcdIfyEZLFAPmmL+bdeLRdDaMzi/ZHGAubn8QN21lJYUrpqmL0Vpctl bNkqTmLAykRM2TSXbBByyp2CVKljP7R/BZVsOKUt/s2FE79vogG6L554q2NlYXDcRYVw gc8aiUn+yoYP5NjjsVrGKCjTSwB2w4ueOqHIHpSLcsAP+vn+cgUuE3kX9Tqg5m5jwaAc khLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S12NbNvzyitASYeuyiRTGlWzIthLnwLfrSqRKnQYHxY=; b=b+G/kP6Xa06QoWAYXsDjR6Cv36QjDQGpKM3RVErHQtXFrO0DgD7HkR7RxNFSMSfNM1 3H/LDC1IsVRwpoblctuo4fbEzE5CJlSzIBR1TV49fycdNzKmq5nhz+kqmJ5CGSvM8hFp 0SPvCfz6ypBB2PIHNmybdtyd3at8E8Owf5YXkAD9PbIHAk3aBQvwVz5oQFm8ovrEOgRi Kiqv8qqn7Xmk2mQQmcSmSxJxqPj+FatFzKAm6WPjNqn6qUzxf+GtAi9CQZzutaKVUI8W 6J8PtNbEA6ecFCkvcGRP+j2P+Oa3qU5KwVH4pveKjf0Kridxmo472n+IuTz+ZG+1PT7V J1KQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=DYgC15CL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u132si7427840oie.250.2020.02.03.19.31.39; Mon, 03 Feb 2020 19:31:51 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=DYgC15CL; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727185AbgBDD2y (ORCPT + 99 others); Mon, 3 Feb 2020 22:28:54 -0500 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:54308 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726694AbgBDD2y (ORCPT ); Mon, 3 Feb 2020 22:28:54 -0500 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 35245886BF; Tue, 4 Feb 2020 16:28:47 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1580786927; bh=S12NbNvzyitASYeuyiRTGlWzIthLnwLfrSqRKnQYHxY=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=DYgC15CL/HBZUXollf40qLbO9WZA+CaaBboFwwZw2DCS0r3VDSzOtOH6lFCrc1Wxg cT8OBwCtXNrA/kRm7x48sZe8HOblOKv7lUh+AzjOyxujEY9Li/u6hXcWut5rpFQOVR lo1Adbc4VRF/t4/yHDz6gC1B033g4O6nw5Q9LbGSAw79OdfEeFJDkGZ00xPgAHhmJo JPG9u86Eb83Hfyyt9LgfevNmfBTzkLo6P2nR0gTrp6YHvUZyypyNeGbOZlg1eIY73F k4/YOXnmX8sc6QuNagQFoi/KPLYQoA/vIvGh4JbHjg9ngOYb4eGxyZj5xu9sV0a9fF Z1jyvF0UuncBw== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Tue, 04 Feb 2020 16:28:46 +1300 Received: from chrisp-dl.ws.atlnz.lc (chrisp-dl.ws.atlnz.lc [10.33.22.20]) by smtp (Postfix) with ESMTP id 880DE13EEFA; Tue, 4 Feb 2020 16:28:41 +1300 (NZDT) Received: by chrisp-dl.ws.atlnz.lc (Postfix, from userid 1030) id B4513280071; Tue, 4 Feb 2020 16:28:41 +1300 (NZDT) From: Chris Packham To: broonie@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, Andy Shevchenko Cc: linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Chris Packham Subject: [PATCH v5 1/2] dt-bindings: spi: Document binding for generic SPI multiplexer Date: Tue, 4 Feb 2020 16:28:37 +1300 Message-Id: <20200204032838.20739-2-chris.packham@alliedtelesis.co.nz> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200204032838.20739-1-chris.packham@alliedtelesis.co.nz> References: <20200204032838.20739-1-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Rob Herring --- Notes: Changes in v5: - Add reviewed-by from Rob =20 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