mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] pinctrl: mcp23s08: Enable gpio-line-names for multi-chip configurations
@ 2026-01-13 14:29 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
  0 siblings, 2 replies; 9+ messages in thread
From: Jean-Michel Hautbois via B4 Relay @ 2026-01-13 14:29 UTC (permalink / raw)
  To: Linus Walleij, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Himanshu Bhavani
  Cc: linux-gpio, linux-kernel, devicetree, Jean-Michel Hautbois

The MCP23S08/17/18 SPI driver supports multiple GPIO expander chips
sharing the same SPI chip select via hardware address pins (A0-A2).
However, the gpio-line-names device tree property could not be used in
these configurations because all gpio_chip instances tried to use names
starting at index 0.

This series enables gpio-line-names support by setting gpio_chip.offset
for each chip based on cumulative GPIO count.

Example device tree usage:
    gpio@0 {
        compatible = "microchip,mcp23s17";
        microchip,spi-present-mask = /bits/ 8 <0x03>;  /* chips 0 and 1 */
        gpio-line-names =
            /* Chip 0: 16 names */
            "EXP0_A0", "EXP0_A1", ..., "EXP0_B7",
            /* Chip 1: 16 names */
            "EXP1_A0", "EXP1_A1", ..., "EXP1_B7";
    };

Patch 1 implements the driver change (9 lines added).
Patch 2 adds documentation with a complete example.

Testing:
- Verified on AM64x hardware with 2 MCP23S17 chips at addresses 1 and 2
- Confirmed gpio-line-names appear correctly in gpioinfo output
- Each chip's 16 GPIOs receive the correct sequential names

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>
---
Jean-Michel Hautbois (2):
      pinctrl: mcp23s08: support gpio-line-names
      dt-bindings: pinctrl: mcp23s08: Add multi-chip example

 .../bindings/pinctrl/microchip,mcp23s08.yaml       | 33 ++++++++++++++++++++++
 drivers/pinctrl/pinctrl-mcp23s08_spi.c             |  4 +++
 2 files changed, 37 insertions(+)
---
base-commit: 0f61b1860cc3f52aef9036d7235ed1f017632193
change-id: 20260112-mcp23s17-multiple-addr-names-42314cda32b9

Best regards,
--  
Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>



^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-01-19  8:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2026-01-19  8:46           ` Linus Walleij

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®