[PATCH v3 0/2] Add NXP PCA9641 I2C bus master arbiter support
From: Shiv Prakash Gupta
Date: Fri Nov 27 2026 - 04:30:32 EST
This series adds a device tree binding and an I2C mux driver for the NXP
PCA9641 2-to-1 I2C bus master arbiter. The PCA9641 lets two upstream I2C
masters share a single downstream slave bus using a lock/grant protocol:
a master sets LOCK_REQ, waits for LOCK_GRANT, sets BUS_CONNECT to close
the switch, performs its transactions and then clears LOCK_REQ to release
the bus. The driver plugs into the i2c-mux core as an I2C_MUX_ARBITRATOR.
Ownership is awaited by polling or, when an interrupt is described and
its provider is suitable, with the INT0/INT1 output.
Changes in v3:
- Binding: unchanged, the Acked-by from Conor Dooley is retained.
- Driver: the interrupt is now an exclusive hard IRQ that is disabled
while idle and armed only during select. The handler does not access
the bus; it disables the line and wakes the waiter, which masks and
acknowledges the sticky status under the parent adapter lock.
- Driver: unmask only LOCK_GRANT and always verify LOCK_GRANT in CONTR,
so a spurious or missing interrupt only causes bounded polling.
- Driver: use polling when the interrupt provider needs bus locking, when
the trigger is neither level low nor falling edge, or when the request
fails.
- Driver: return -EOPNOTSUPP from select and deselect in atomic context;
atomic transfers are not supported.
- Driver: cancel pending lock requests on failed acquisition and retry
failed bus releases and interrupt cleanup from delayed work while the
device remains bound.
- Driver: set the Reserve Time register to 0.
- Kconfig: describe only the implemented functionality.
- MAINTAINERS: move the entry to its alphabetical position.
Changes in v2:
- Binding: add Acked-by from Conor Dooley; no functional changes.
- Driver: drop IRQF_SHARED from the IRQ request.
- Driver: clear the latched LOCK_REQ on every timeout path in
pca9641_select_chan() so a master that gives up does not block the
peer master.
- Driver: reorder probe interrupt setup: mask all sources and clear
stale INT_STATUS before requesting the IRQ.
- Driver: re-mask interrupts if i2c_mux_add_adapter() fails.
- Driver: unregister the child adapter before masking interrupts in
pca9641_remove().
- Driver: use a named initializer for the i2c_device_id table.
Shiv Prakash Gupta (2):
dt-bindings: i2c: Add NXP PCA9641 I2C bus master arbiter
i2c: mux: Add NXP PCA9641 I2C bus master arbiter driver
.../devicetree/bindings/i2c/nxp,pca9641.yaml | 109 ++++
MAINTAINERS | 7 +
drivers/i2c/muxes/Kconfig | 15 +
drivers/i2c/muxes/Makefile | 1 +
drivers/i2c/muxes/i2c-mux-pca9641.c | 476 ++++++++++++++++++
5 files changed, 608 insertions(+)
create mode 100644 Documentation/devicetree/bindings/i2c/nxp,pca9641.yaml
create mode 100644 drivers/i2c/muxes/i2c-mux-pca9641.c
--
2.34.1