linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Packham <Chris.Packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
To: "robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: "linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"mark.rutland-5wv7dgnIgG8@public.gmane.org"
	<mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org"
	<broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v2 1/2] dt-bindings: spi: Document binding for generic SPI multiplexer
Date: Sun, 26 Jan 2020 20:23:58 +0000	[thread overview]
Message-ID: <651803fbdea412ecde7cd352b080d41d9f0a2a33.camel@alliedtelesis.co.nz> (raw)
In-Reply-To: <CAL_JsqLvM34WSBE29beBgJj0jLA6P_UwQUbTuEQcYJgrkg3v1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Thu, 2020-01-23 at 07:51 -0600, Rob Herring wrote:
> On Wed, Jan 22, 2020 at 7:24 PM Chris Packham
> <chris.packham@alliedtelesis.co.nz> 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 <chris.packham@alliedtelesis.co.nz>
> > ---
> > 
> > Notes:
> >     Changes in v2:
> >     - update license
> >     - make dt_binding_check clean
> 
> Sure about that?
> 

I was when I wrote that, but now I think I need to consult my spell
book.

It appears the incantation I should be using is

  make ARCH=arm defconfig
  make ARCH=arm dt_binding_check \
     DT_SCHEMA_FILES=Documentation/devicetree/bindings/spi/spi-mux.yaml

I can see the simple failures (not sure how I missed them). But one
that remains is:

Warning (spi_bus_bridge): /example-0/spi/spi-mux@0: node name for SPI
buses should be 'spi'

I could fix that by having

 spi {
    spi@0 {
       compatible = "spi-mux";
    };
 };

Is that what we want? Or should I be adding awareness of spi-muxes to
dtc?

> > 
> >  .../devicetree/bindings/spi/spi-mux.yaml      | 84 +++++++++++++++++++
> >  1 file changed, 84 insertions(+)
> >  create mode 100644 Documentation/devicetree/bindings/spi/spi-mux.yaml
> > 
> > diff --git a/Documentation/devicetree/bindings/spi/spi-mux.yaml b/Documentation/devicetree/bindings/spi/spi-mux.yaml
> > new file mode 100644
> > index 000000000000..4bdb31e2257e
> > --- /dev/null
> > +++ b/Documentation/devicetree/bindings/spi/spi-mux.yaml
> > @@ -0,0 +1,84 @@
> > +# 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 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#"
> > +
> > +maintainers:
> > +  - Chris Packham <chris.packham@alliedtelesis.co.nz>
> > +
> > +properties:
> > +  compatible:
> > +    const: spi-mux
> > +
> > +  mux-controls:
> > +    maxItems: 1
> > +
> > +required:
> > +   - compatible
> > +   - reg
> > +   - spi-max-frequency
> > +   - mux-controls
> > +
> > +examples:
> > +   - |
> > +     mux: mux-controller {
> > +       compatible = "gpio-mux";
> > +       #mux-control-cells = <0>;
> > +
> > +       mux-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
> > +     };
> > +
> > +     spi {
> > +       spi-mux@0 {
> > +         compatible = "spi-mux";
> > +         #address-cells = <1>;
> > +         #size-cells = <0>;
> > +         reg = <0>;
> > +         spi-max-frequency = <100000000>;
> > +
> > +         mux-controls = <&mux>
> 
> Missing semicolon.
> 
> > +
> > +         spi-flash@0 {
> > +           compatible = "jedec,spi-nor";
> > +           #address-cells = <1>;
> > +           #size-cells = <1>;
> > +           reg = <0>;
> > +           spi-max-frequency = <40000000>;
> > +         };
> > +
> > +         spi-device@1 {
> > +           compatible = "lineartechnology,ltc2488";
> > +           reg = <1>;
> > +           spi-max-frequency = <10000000>;
> > +         };
> > +       };
> > +     };
> > --
> > 2.25.0
> > 

  parent reply	other threads:[~2020-01-26 20:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  1:23 [PATCH v2 0/2] SPI bus multiplexing Chris Packham
     [not found] ` <20200123012317.14808-1-chris.packham-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2020-01-23  1:23   ` [PATCH v2 1/2] dt-bindings: spi: Document binding for generic SPI multiplexer Chris Packham
2020-01-23 13:51     ` Rob Herring
     [not found]       ` <CAL_JsqLvM34WSBE29beBgJj0jLA6P_UwQUbTuEQcYJgrkg3v1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-01-26 20:23         ` Chris Packham [this message]
2020-01-27 13:56           ` Rob Herring
2020-01-23  1:23   ` [PATCH v2 2/2] spi: Add " Chris Packham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=651803fbdea412ecde7cd352b080d41d9f0a2a33.camel@alliedtelesis.co.nz \
    --to=chris.packham-6g8wrflrtwxfdca3tkvle6u/zskkhjvu@public.gmane.org \
    --cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).