[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260113-mcp23s17-multiple-addr-names-v1-0-f14b60f92c82@yoseli.org>
Date: Tue, 13 Jan 2026 15:29:46 +0100
From: Jean-Michel Hautbois via B4 Relay <devnull+jeanmichel.hautbois.yoseli.org@...nel.org>
To: Linus Walleij <linusw@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Himanshu Bhavani <himanshu.bhavani@...iconsignals.io>
Cc: linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
devicetree@...r.kernel.org,
Jean-Michel Hautbois <jeanmichel.hautbois@...eli.org>
Subject: [PATCH 0/2] pinctrl: mcp23s08: Enable gpio-line-names for
multi-chip configurations
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@...eli.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@...eli.org>
Powered by blists - more mailing lists