[PATCH v2 0/5] mfd: ocelot: Support the LAN9645x switch family
From: Jens Emil Schulz Østergaard
Date: Fri Dec 04 2026 - 07:02:55 EST
The Microchip LAN9645x is a family of ethernet switch chips without an
internal CPU. Like the VSC7512, the chips are controlled externally over
SPI, and the register targets of the chip are distributed as named
regmaps to child devices. This series extends the ocelot MFD driver to
the LAN9645x family, with the pin controller, the two MDIO controllers
and the switch as child devices, served by the existing pinctrl-ocelot,
mdio-mscc-miim and lan9645x DSA drivers.
Patch 1 defines the VSC7512 cells with the MFD_CELL_* macros.
Patch 2 passes the chip through the match data and selects the VSC7512
specific SPI interface, reset and child device setup by it.
Patch 3 adds a binding for the LAN9645x family.
Patch 4 adds the LAN9645x support.
Patch 5 reads LAN9645x registers in a single SPI transfer on full duplex
controllers.
Dependencies:
This series is based on net-next which includes [1]. The binding in
patch 3 references the switch binding
net/dsa/microchip,lan96455s-switch.yaml, and patch 3 adds the new
binding to the MICROCHIP LAN9645X ETHERNET SWITCH DRIVER entry in
MAINTAINERS, both added by that series.
The series therefore does not apply to for-mfd-next yet, and
dt_binding_check of patch 3 fails on a base without the switch binding.
The DSA series is expected in v7.5-rc1. The series is posted now for
review, and will be resent rebased on v7.5-rc1.
[1] https://lore.kernel.org/r/20261111-dsa_lan9645x_switch_driver_base-v17-0-83a471c5bddb@xxxxxxxxxxxxx
Signed-off-by: Jens Emil Schulz Østergaard <jensemil.schulzostergaard@xxxxxxxxxxxxx>
---
Changes in v2:
- New patch 1, define the VSC7512 cells with the MFD_CELL_* macros (Lee)
- Pass the chip as an integer through the match data, and select the
per chip SPI setup, reset register and cells with switch statements
instead of struct ocelot_spi_data, struct ocelot_cells and the padding
bytes function pointer (Lee)
- Poll the soft reset with regmap_read_poll_timeout()
- Define the LAN9645x cells with the MFD_CELL_* macros (Lee)
- Compute the LAN9645x padding bytes from the bus clock in Hz instead of
kHz, so they are always rounded up
- Drop the regmap access tables of the switch gcb and chip_top regmaps
and struct ocelot_regmap_access (Lee)
- Single transfer read: separate transmit and receive buffers, memcpy()
for the address and the value, comments on the three transfer read
and the dummy buffer (Lee)
- Link to v1: https://lore.kernel.org/r/20261123-mfd-ocelot-add-lan9645x-support-v1-0-567d811fe1de@xxxxxxxxxxxxx
---
Jens Emil Schulz Østergaard (5):
mfd: ocelot: Define the VSC7512 cells with the MFD_CELL_* macros
mfd: ocelot: Select the chip through match data
dt-bindings: mfd: Add the Microchip LAN9645x switch family
mfd: ocelot: Add support for the LAN9645x switch family
mfd: ocelot: Read LAN9645x registers in a single SPI transfer
.../bindings/mfd/microchip,lan96455s.yaml | 132 ++++++++++++
MAINTAINERS | 1 +
drivers/mfd/Kconfig | 2 +-
drivers/mfd/ocelot-core.c | 224 +++++++++++++++------
drivers/mfd/ocelot-spi.c | 212 ++++++++++++++++---
drivers/mfd/ocelot.h | 33 ++-
6 files changed, 512 insertions(+), 92 deletions(-)
---
base-commit: 3b4d7f44a61b8217ed11c5df95bccfd256c52db3
change-id: 20261118-mfd-ocelot-add-lan9645x-support-9ac4042ba475
Best regards,
--
Jens Emil Schulz Østergaard <jensemil.schulzostergaard@xxxxxxxxxxxxx>