[PATCH v22 0/5] Add support for NXP P3H2x4x I3C hub driver

From: Lakshay Piplani

Date: Thu Nov 19 2026 - 04:55:12 EST


This series adds the MFD parent, regulator and hub drivers for NXP's
four-port and eight-port P3H2x4x I3C hubs. With an I3C host, the hub
driver exposes I3C ports as virtual controllers. SMBus ports appear
as I2C adapters with either an I2C or an I3C host.

The I3C core helpers, DT binding and generic hub support from v20
(patches 1-3 and 6) are already in mainline. This revision adds a
generic I3C address-slot fix and addresses the Sashiko findings and
review feedback reported against v21. The series is rebased onto
v7.4-rc3.

The earlier v20 Sashiko reports concerning the location of p3h2840.h
in the MFD and regulator patches appear to be false positives.

Changes in v22:

Sashiko fixes and review feedback

- Factor the common I2C and I3C MFD probe initialization into a shared
helper, leaving transport-specific validation and regmap setup in
the respective probe functions.
- Replace the generic I2C device ID "nxp-i3c-hub" with "p3h2x4x".
- Use platform_device_set_of_node_from_dev() in the regulator driver
to avoid leaking the inherited Device Tree node reference.
- Initialize TP_NET_CON_CONF to a known disconnected state during
probe, preventing stale routing state from connecting unintended
target ports.
- Mark downstream DT-assigned addresses as I3C_ADDR_SLOT_EXT_DESIRED
instead of I3C_ADDR_SLOT_I3C_DEV on the parent bus. This prevents
DAA reconciliation from treating downstream devices as orphaned
parent-bus devices and probing them again.
- Connect each I3C target port before registering its virtual
controller, rather than connecting all ports after registration.
Keep the ports connected to prevent downstream device probes
and IBI operations from accessing disconnected targets.
- Advertise supported SMBus emulation operations and reject
I2C_M_RECV_LEN, avoiding unsupported variable-length block reads.
- Add combined write-then-read adapter quirks and reject transfers
exceeding the shared controller-agent payload capacity.
- Reject empty SMBus receive buffers before reading their address
or delivering slave callbacks.
- Clear pending SMBus receive and overflow flags before enabling
the slave IBI, without clearing the controller transaction-finish
flag.
- Reject unsupported 10-bit I2C slave address registration.

Additional changes

- Add managed cleanup to disconnect I3C target ports after virtual
controller teardown.
- Keep port routing updates serialized under the hub routing mutex,
marking ports permanently connected only after successful writes.
- Document SETDASA/ENTDAA handling and the shared parent dynamic
address space.

Changes in v21:

Sashiko fixes

- Keep I3C routing callbacks active during virtual controller
registration. Serialize routing updates under the hub mutex and
mark ports permanently connected only after successful routing.
- Filter both DT parsing passes to "i3c" and "smbus" target-port
nodes, preventing unrelated child nodes from claiming ports.
- Process pending SMBus receive buffers independently and clear
only the overflow flag after servicing them, preserving new
buffer-refill events.

Additional fixes

- Reject duplicate target-port indices in Device Tree.
- Reserve DT-assigned addresses for all I3C target ports before
the first virtual controller starts DAA.
- Clear only the SMBus controller transaction-finish flag before
starting a transfer, preserving pending RX and overflow flags.
- Initialize optional IBI support without holding the routing
mutex, avoiding an error path that could leave it locked.

Previous posting (v21)
https://lore.kernel.org/linux-i3c/20261112124437.3367252-1-lakshay.piplani@xxxxxxx/

Previously merged upstream patches from v20

[1/8] I3C core hub support
https://git.kernel.org/i3c/c/9d60a0eafae1

[2/8] I3C controller-only operations
https://git.kernel.org/i3c/c/8d0008260c32

[3/8] NXP P3H2x4x Device Tree binding
https://git.kernel.org/i3c/c/58c018414635

[6/8] Generic I3C hub support
https://git.kernel.org/i3c/c/b0cfe49a2e3b

Aman Kumar Pandey (3):
mfd: p3h2x4x: Add driver for NXP P3H2x4x i3c hub and on-die regulator
regulator: p3h2x4x: Add driver for on-die regulators in NXP P3H2x4x
i3c hub
i3c: hub: p3h2x4x: Add support for NXP P3H2x4x I3C hub functionality

Lakshay Piplani (2):
i3c: hub: Mark downstream DT addresses as desired on parent bus
i3c: hub: p3h2x4x: Add SMBus slave mode support

MAINTAINERS | 6 +
drivers/i3c/Kconfig | 1 +
drivers/i3c/Makefile | 1 +
drivers/i3c/hub.c | 18 +-
drivers/i3c/hub/Kconfig | 11 +
drivers/i3c/hub/Makefile | 4 +
drivers/i3c/hub/p3h2840_i3c_hub.h | 358 +++++++++
drivers/i3c/hub/p3h2840_i3c_hub_common.c | 437 +++++++++++
drivers/i3c/hub/p3h2840_i3c_hub_i3c.c | 247 +++++++
drivers/i3c/hub/p3h2840_i3c_hub_smbus.c | 685 ++++++++++++++++++
drivers/i3c/master.c | 20 +
drivers/mfd/Kconfig | 13 +
drivers/mfd/Makefile | 1 +
drivers/mfd/p3h2840.c | 156 ++++
drivers/regulator/Kconfig | 10 +
drivers/regulator/Makefile | 1 +
drivers/regulator/p3h2840_i3c_hub_regulator.c | 289 ++++++++
include/linux/i3c/device.h | 2 +
include/linux/i3c/master.h | 2 +
include/linux/mfd/p3h2840.h | 41 ++
20 files changed, 2296 insertions(+), 7 deletions(-)
create mode 100644 drivers/i3c/hub/Kconfig
create mode 100644 drivers/i3c/hub/Makefile
create mode 100644 drivers/i3c/hub/p3h2840_i3c_hub.h
create mode 100644 drivers/i3c/hub/p3h2840_i3c_hub_common.c
create mode 100644 drivers/i3c/hub/p3h2840_i3c_hub_i3c.c
create mode 100644 drivers/i3c/hub/p3h2840_i3c_hub_smbus.c
create mode 100644 drivers/mfd/p3h2840.c
create mode 100644 drivers/regulator/p3h2840_i3c_hub_regulator.c
create mode 100644 include/linux/mfd/p3h2840.h

--
2.25.1