From: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
To: Linus Walleij <linusw@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Himanshu Bhavani <himanshu.bhavani@siliconsignals.io>,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
devicetree@vger.kernel.org
Subject: Re: [PATCH 2/2] dt-bindings: pinctrl: mcp23s08: Add multi-chip example
Date: Mon, 19 Jan 2026 07:15:54 +0100 [thread overview]
Message-ID: <2818765.mvXUDI8C0e@jeanmichel-ms7b89> (raw)
In-Reply-To: <CAD++jLmBegkZyKoo2cgtgJt0-8Pn-H2XaAoqipgPp0hTmro+sQ@mail.gmail.com>
Hi Linus,
Le lundi 19 janvier 2026, 00:12:05 heure normale d’Europe centrale Linus
Walleij a écrit :
> On Wed, Jan 14, 2026 at 6:29 PM Jean-Michel Hautbois
>
> <jeanmichel.hautbois@yoseli.org> wrote:
> > > Make some fancy - if: clauses to decide the maxItems from the
> > > compatible.
> > > Don't hesitate to ask for help if this gets complicated, I get a panic
> > > every time I have to deal with it because of the whitespacing business.
> >
> > Indeed, I was probably a bit optimistic :-).
> >
> > What about this:
> > allOf:
> > - $ref: /schemas/spi/spi-peripheral-props.yaml#
> >
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - microchip,mcp23s08
> > + - microchip,mcp23008
> > + then:
> > + properties:
> > + gpio-line-names:
> > + maxItems: 32
> > + pinmux:
> > + properties:
> > + pins:
> > + maxItems: 32
> > + - if:
> > + properties:
> > + compatible:
> > + contains:
> > + enum:
> > + - microchip,mcp23s17
> > + - microchip,mcp23s18
> > + - microchip,mcp23017
> > + - microchip,mcp23018
> > + then:
> > + properties:
> > + gpio-line-names:
> > + maxItems: 128
> > + pinmux:
> > + properties:
> > + pins:
> > + maxItems: 128
> > +
> >
> > This would allow up to 4 chips to be on the same CS.
>
> Hm I don't get it why everything is multiplied by 4 here?
>
> Doesn't each chip have its own instance? And the instance is
> limited to 8 or 16 lines/pins?
>
> > But in the
> > microchip,mcp23s17 datasheet, it says:
> > "Three Hardware Address Pins to Allow Up to Eight Devices On the Bus"
>
> Doesn't each device have its own entry?
As far as I get it, for I2C variants, each chip has its own device node,
so gpio-line-names would be limited to 8/16 per node.
However, for SPI variants (mcp23s08/s17/s18), multiple chips can share
the same SPI chipselect via the 'microchip,spi-present-mask' property.
In this case, a single DT node represents multiple physical chips,
and gpio-line-names needs to cover all of them:
- mcp23s08: up to 4 chips × 8 GPIOs = 32 lines
- mcp23s17: up to 8 chips × 16 GPIOs = 128 lines
Should I split the conditionals to apply different limits for I2C vs SPI?
Or did I miss something which is totally possible too -_-' ?
Thanks,
JM
> Yours,
> Linus Walleij
next prev parent reply other threads:[~2026-01-19 6:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-13 14:29 [PATCH 0/2] pinctrl: mcp23s08: Enable gpio-line-names for multi-chip configurations Jean-Michel Hautbois via B4 Relay
2026-01-13 14:29 ` [PATCH 1/2] pinctrl: mcp23s08: support gpio-line-names Jean-Michel Hautbois via B4 Relay
2026-01-13 14:29 ` [PATCH 2/2] dt-bindings: pinctrl: mcp23s08: Add multi-chip example Jean-Michel Hautbois via B4 Relay
2026-01-14 9:21 ` Krzysztof Kozlowski
2026-01-14 13:52 ` Linus Walleij
2026-01-14 17:29 ` Jean-Michel Hautbois
2026-01-18 23:12 ` Linus Walleij
2026-01-19 6:15 ` Jean-Michel Hautbois [this message]
2026-01-19 8:46 ` Linus Walleij
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=2818765.mvXUDI8C0e@jeanmichel-ms7b89 \
--to=jeanmichel.hautbois@yoseli.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=himanshu.bhavani@siliconsignals.io \
--cc=krzk+dt@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.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
all inboxes | Powered by JetHome®