[PATCH v5 0/7] mfd: nct6694: Refactor transport layer and add HIF (eSPI) support
From: a0282524688
Date: Mon May 25 2026 - 04:22:51 EST
From: Ming Yu <a0282524688@xxxxxxxxx>
The Nuvoton NCT6694 is a peripheral expander that provides GPIO, I2C,
CAN-FD, Watchdog, HWMON, PWM, and RTC sub-devices. Currently, the
driver only supports USB as the host transport interface.
This series refactors the NCT6694 MFD core to support multiple transport
backends and adds a new Host Interface (HIF) transport driver that
communicates over eSPI using Super-I/O shared memory.
Changes since version 4:
- Split the monolithic refactoring and HIF support patch into a series of
smaller, logical commits to improve reviewability and adhere to the
single logical change principle.
- Decoupled USB-specific data into a dedicated 'nct6694_usb_data'
structure.
- Abstracted device I/O operations by introducing 'read_msg' and
'write_msg' function pointers in the core structure.
- Renamed the existing driver to 'nct6694-usb.c' to strictly identify its
transport boundary, alongside Kconfig/Makefile updates.
- Extracted transport-agnostic device management (IRQ domain setup, IDA
initialization, and MFD cell registration) into a standalone
'nct6694-core.c' module.
- Added the 'nct6694-hif' eSPI transport driver clean on top of the new
core abstraction.
Changes since version 3:
- Remove redundant module type macro definitions from sub-device drivers
that are now provided by the shared header <linux/mfd/nct6694.h>,
fixing -Wmacro-redefined warnings.
Changes since version 2:
- Restore per-device IDA and mfd_add_hotplug_devices()/PLATFORM_DEVID_AUTO
to avoid child device ID conflicts with multiple NCT6694 chips.
- Validate irq_find_mapping() return value before dispatching IRQs.
- Check superio_enter() return value in nct6694_irq_init().
Changes since version 1:
- Reworked the Super-I/O access helpers.
Ming Yu (7):
mfd: nct6694: Move module type macros to shared header
mfd: nct6694: Refactor USB-specific data into nct6694_usb_data
mfd: nct6694: Introduce transport abstraction with function pointers
mfd: nct6694: Rename static I/O functions with _usb_ prefix
mfd: nct6694: Rename driver to nct6694-usb and update Kconfig
mfd: nct6694: Extract core device management into a separate module
mfd: nct6694: Add Host Interface (HIF) eSPI transport driver
MAINTAINERS | 2 +-
drivers/gpio/gpio-nct6694.c | 7 -
drivers/hwmon/nct6694-hwmon.c | 21 -
drivers/i2c/busses/i2c-nct6694.c | 7 -
drivers/mfd/Kconfig | 38 +-
drivers/mfd/Makefile | 4 +-
drivers/mfd/nct6694-core.c | 136 ++++++
drivers/mfd/nct6694-hif.c | 529 +++++++++++++++++++++++
drivers/mfd/{nct6694.c => nct6694-usb.c} | 185 +++-----
drivers/net/can/usb/nct6694_canfd.c | 6 -
drivers/rtc/rtc-nct6694.c | 7 -
drivers/watchdog/nct6694_wdt.c | 7 -
include/linux/mfd/nct6694.h | 63 ++-
13 files changed, 821 insertions(+), 191 deletions(-)
create mode 100644 drivers/mfd/nct6694-core.c
create mode 100644 drivers/mfd/nct6694-hif.c
rename drivers/mfd/{nct6694.c => nct6694-usb.c} (62%)
--
2.34.1