[RFC PATCH 0/7] i3c: hub: p3h2x4x: add debugfs, i2c-tools, bus rate and GPIO mode support
From: Lakshay Piplani
Date: Fri Oct 16 2026 - 12:54:10 EST
This patchset adds a debugfs interface for hub inspection and register
access, SMBus transfer support enabling standard i2c-tools on SMBus target
ports, per-port bus rate configuration through the standard
'clock-frequency' property for ports operating in SMBus mode, and GPIO mode
support for target ports whose pins are used as general-purpose I/O.
This RFC is being posted for early feedback, particularly on the DT
representation and GPIO interface. It is not standalone and is not
intended to be applied before its base-series dependencies are available.
This series was developed on top of the complete v20 P3H2x4x I3C hub
series:
https://lore.kernel.org/linux-i3c/20260922103551.2754613-1-lakshay.piplani@xxxxxxx/T/#u
At the time of posting, v20 patches 1/8, 2/8, 3/8 and 6/8 have been applied
to the I3C maintainer tree. The remaining device-specific patches 4/8, 5/8,
7/8 and 8/8 are still pending.
The implementation in this series builds on the MFD core from v20 patch
4/8 and the target-port and SMBus support from v20 patches 7/8 and 8/8.
The binding extensions build on v20 patch 3/8.
The series should therefore be reviewed against the complete v20 series.
A subsequent non-RFC version will be rebased onto the upstream base once
the remaining dependencies have landed.
The dependency order within this patchset is:
- Patch 1 adds a debugfs interface exposing the hub, control port and
target port configuration, and raw register read/write access
- Patch 2 implements .smbus_xfer for the I2C adapters created for the SMBus
target ports, so i2cdetect, i2cget and i2cset can be used
- Patch 3 describes the standard 'clock-frequency' property for the smbus@
target port nodes, restricted to the four rates the hardware implements
- Patch 4 programs the port rate from that property and derives the status
poll interval from it, and depends on patch 3
- Patch 5 describes the new "gpio@N" target port node and marks the hub as
a gpio-controller
- Patch 6 programs the target port GPIO mode register from that node and
depends on patch 5
- Patch 7 exposes the pins of those ports as a gpio_chip and depends on
patch 6
Lakshay Piplani (7):
i3c: hub: p3h2x4x: Add support for debugfs
i3c: hub: add i2c-tools support for SMBus-configured target ports
dt-bindings: i3c: nxp,p3h2840: add clock-frequency for SMBus target
ports
i3c: hub: p3h2x4x: add clock-frequency DTS support
dt-bindings: i3c: nxp,p3h2840: add GPIO mode target ports
i3c: hub: p3h2x4x: configure target ports placed in GPIO mode
gpio: p3h2x4x: add GPIO expander for the NXP P3H2x4x I3C hub
.../devicetree/bindings/i3c/nxp,p3h2840.yaml | 72 +++++
MAINTAINERS | 1 +
drivers/gpio/Kconfig | 11 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-p3h2x4x.c | 294 ++++++++++++++++++
drivers/i3c/hub/p3h2840_i3c_hub.h | 48 ++-
drivers/i3c/hub/p3h2840_i3c_hub_common.c | 218 ++++++++++++-
drivers/i3c/hub/p3h2840_i3c_hub_smbus.c | 272 +++++++++++++++-
drivers/mfd/p3h2840.c | 5 +
include/linux/mfd/p3h2840.h | 8 +
10 files changed, 905 insertions(+), 25 deletions(-)
create mode 100644 drivers/gpio/gpio-p3h2x4x.c
--
2.25.1