[PATCH v2 0/2] mux: gpio: Add optional enable gpio
From: Tapio Reijonen
Date: Mon Aug 31 2026 - 06:32:23 EST
Analog multiplexers have an enable input that puts all channels in the
high-impedance off state independent of the address inputs - the E input
of a 74HC4051, for example. gpio-mux has no way to describe it, so it can
neither reach the idle state of disconnect that the mux-controller
binding defines, nor keep the mux disabled while the address gpios are
updated one gpio controller at a time.
Add enable-gpios for that input, and use it in the driver.
Tested on an i.MX6SX board where two SFP cages share one SMBus behind
DG9411 analog switches: the address input selects the cage and the
enable input gates the bus, both driven by a PCA9501 I2C gpio expander.
With enable-gpios and an idle state of disconnect, the parent bus scans
empty between transfers while each cage stays reachable through its own
child bus. A logic analyser on the enable, address and bus lines over a
full boot shows 97 enable windows and 82 address changes, with no bus
activity outside a window and no address change inside one. Dropping
enable-gpios while keeping the disconnect idle state makes the driver
refuse to probe, as intended.
Signed-off-by: Tapio Reijonen <tapio.reijonen@xxxxxxxxxxx>
---
Changes in v2:
- Describe the enable input in terms of real multiplexers (the E input of
a 74HC4051) instead of repeating the binding text, and say what needs
it, as requested by Krzysztof.
- Add the missing gpio-mux: prefix to the binding patch subject.
- Limit enable-gpios to one entry, and require it for an idle state of
disconnect in both the schema and the driver: without an enable gpio
mux_gpio_set() drove the address gpios to the bit pattern of
MUX_IDLE_DISCONNECT instead of disconnecting.
- Deassert the enable gpio while the mux gpios are updated, not only for
the disconnect idle state, since they are not updated atomically.
- Show enable-gpios in the binding example.
- Link to v1: https://lore.kernel.org/r/20251105-add-external-mux-enable-gpio-v1-0-e59cba6f9e47@xxxxxxxxxxx
---
Tapio Reijonen (2):
dt-bindings: mux: gpio-mux: Add enable-gpios
mux: gpio: Add optional enable gpio
.../devicetree/bindings/mux/gpio-mux.yaml | 22 ++++++++++++++
drivers/mux/gpio.c | 34 ++++++++++++++++++----
2 files changed, 50 insertions(+), 6 deletions(-)
---
base-commit: cee9395acd8043be0644b25c34bfa86623f2b935
change-id: 20250925-add-external-mux-enable-gpio-c9ba5beddd49
Best regards,
--
Tapio Reijonen <tapio.reijonen@xxxxxxxxxxx>