Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6826515ybl; Wed, 15 Jan 2020 10:48:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxslqckOToF4sA4huGQyQnq5P5qA88zgzexxyL08dNWGQprvXXw49DCHUb8LTsXjODs+G9P X-Received: by 2002:aca:f505:: with SMTP id t5mr998622oih.136.1579114114356; Wed, 15 Jan 2020 10:48:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579114114; cv=none; d=google.com; s=arc-20160816; b=t4WRznw/6Ni8y0rD42vUaIcSY7CNSEUw9uD6EHaBRzCBbc/I03froKF1kQ7cbpyNU3 XNAuUcqY9z5dmRwROEUPw/hTEiA8SwCrjM24BkrntJTE9o3XI2We1slsKT5MlZpja6yS O18f/LC2ILGm/efDhscfXI9N1F/F83XQTiFqVTaQg1udKEwH7JgtFbjl1G/RG4JCeAMz uotNN0P2kuCwoC0wk03Zv+UtSHk2LbqKPE9QFfRJM3l/ujOU8OLMRouoBvSPqmIFtqxc AaWXeU72m4G4XpVpWDIBtE2Ye+rb6cIgYz0pHJ1EKis+c6G46mzV3fH/+uYhhICReWNc Hp1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=+rFzPkdp1AUSmfgb5/lBoRzu4CTExqSRBLut+HAbceQ=; b=ml49xBoTLicG3zk5N38csz+HLGXPzBVishrt5Z7+gFQzloL5mFjlyQe7zGNtdKi+w7 kTTiI4utICa4embg5gUUMFPHzV00Zoioz6UAGRObV7iRNXyZE0cq34dRUziGcfwrgCsZ +oTVaiNNWD73AXM5loVI1CtudbIQ7neJHd6aH7jSY+O7nk+hMIEaX8BVtKfJm4gYbzVI oPka7fD2oGAiJg9rz+f1hvjNT940Ob6SHfV61DcFtx/8pGIzcZhsQWa9TFPY4Z/i+tcH WBKrwo2Iahp2JhIqpC5lSRdZ5eXaBejXfkdVZRIh/fIbmAkzj+Q1K2oi/K5JOfi7g6WS X7ug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LSGcEUXb; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l26si11617364otn.48.2020.01.15.10.48.22; Wed, 15 Jan 2020 10:48:34 -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=@kernel.org header.s=default header.b=LSGcEUXb; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729340AbgAOSqR (ORCPT + 99 others); Wed, 15 Jan 2020 13:46:17 -0500 Received: from mail.kernel.org ([198.145.29.99]:59462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729213AbgAOSqN (ORCPT ); Wed, 15 Jan 2020 13:46:13 -0500 Received: from mail-qv1-f45.google.com (mail-qv1-f45.google.com [209.85.219.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 127D42467E; Wed, 15 Jan 2020 18:46:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579113972; bh=FOsge55tBvLYEwlzzKuLeN6gBOiH1dEahfHM7dijZEw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=LSGcEUXbSKsbd9ds0arTnLwToy4tfyimSrxa9soZRGtsja83+M8zMqmVeY0dOO2Rl 8lRECXd1A582Qnj3rIZnjFXyMcNjwq1Kj6aEaauB2B2V6oAkYIZkgjs9XjCCdCcFmq 5TXRoCz1Ic0gWbSk58JVZMj87o9dkCkGQm7/9txc= Received: by mail-qv1-f45.google.com with SMTP id u10so7864922qvi.2; Wed, 15 Jan 2020 10:46:12 -0800 (PST) X-Gm-Message-State: APjAAAVgXeigop/mkdmNQzEkUh6PbbA+HeSzwORBc9UVdCV0wdiK3eFP gNR2JEtG5bVZcOu+P9sDLo4u7tchFxAZq7LByw== X-Received: by 2002:a0c:f6cd:: with SMTP id d13mr26956612qvo.20.1579113971121; Wed, 15 Jan 2020 10:46:11 -0800 (PST) MIME-Version: 1.0 References: <20200114233857.25933-1-chris.packham@alliedtelesis.co.nz> <20200114233857.25933-2-chris.packham@alliedtelesis.co.nz> In-Reply-To: <20200114233857.25933-2-chris.packham@alliedtelesis.co.nz> From: Rob Herring Date: Wed, 15 Jan 2020 12:45:59 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: spi: Document binding for generic SPI multiplexer To: Chris Packham Cc: Mark Brown , Mark Rutland , anthony.derosa@syscall7.com, linux-spi , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 14, 2020 at 5:39 PM Chris Packham wrote: > > 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 > --- > .../devicetree/bindings/spi/spi-mux.yaml | 82 +++++++++++++++++++ > 1 file changed, 82 insertions(+) > create mode 100644 Documentation/devicetree/bindings/spi/spi-mux.yaml Be sure to run 'make dt_binding_check'. > > diff --git a/Documentation/devicetree/bindings/spi/spi-mux.yaml b/Documentation/devicetree/bindings/spi/spi-mux.yaml > new file mode 100644 > index 000000000000..1026d03a69c7 > --- /dev/null > +++ b/Documentation/devicetree/bindings/spi/spi-mux.yaml > @@ -0,0 +1,82 @@ > +# SPDX-License-Identifier: GPL-2.0 Dual license new bindings please: (GPL-2.0-only 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 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 | > + | | ? +-|----------/ \----------------------------------/ > + | +------+ | > + +------------+ > + > +allOf: > + - $ref: "/schemas/spi/spi-controller.yaml#" > + > +properties: > + compatible: > + const: spi-mux > + > + mux-control: > + $ref: "/schemas/mux/mux-controller.yaml#" That file doesn't exist. If it did, it would still be wrong as that would be the provider side and this is the client. The correct name is also 'mux-controls'. You can assume it has a schema already and you just need to define how many entries it has (maxItems: 1). > + > +required: > + - compatible > + - reg > + - spi-max-frequency > + - mux-control > + > +examples: > + - | > + mux: mux-controller { > + compatible = "gpio-mux"; > + #mux-control-cells = <0>; > + > + mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>; > + }; > + > + spi { > + spi-mux { spi-mux@0 > + compatible = "spi-mux"; > + #address-cells = <1>; > + #size-cells = <0>; > + reg = <0>; > + spi-max-frequency = <100000000>; I don't think this makes sense here. The mux doesn't really have any frequency given the clock and data lines aren't routed thru the mux (though maybe that's possible if some isolation is needed). > + > + mux-control = <&mux> > + mux-control-names = "spi"; Not documented. Drop it as it's not all that useful when there's only 1 entry. > + > + spi-flash@0 { > + compatible = "jedec,spi-nor"; > + #address-cells = <1>; > + #size-cells = <1>; > + reg = <0>; > + spi-max-frequency = <40000000>; > + }; > + > + spi-device@1 { > + compatible = "spidev"; Not a valid compatible. > + reg = <1>; > + spi-max-frequency = <10000000>; > + }; > + }; > + }; > -- > 2.25.0 >