Subject: Re: [PATCH v6 0/8] Add VIM4 MCU/FAN support

From: Neil Armstrong <[email-masked]>
Date: Mon, 18 May 2026 16:17:47 +0200

Hi,

On 5/16/26 19:17, Ronald Claveau via B4 Relay wrote:
> The Khadas VIM4 board features a different MCU variant compared to
> previous VIM boards.
> While it shares the same I2C-based communication model,
> it differs in some ways:
> 
>    - A distinct register map with its own volatile/writeable register set
>    - A fan control with 0–100 levels instead of the 0–3 levels previously
>    - A fan power supply gated through a regulator
> 
> This series adds support for this new variant by:
> 
>    1. Refactoring the khadas-mcu MFD driver to use per-variant data
>       structures (regmap config, cells, fan platform data),
>       and adding the khadas,vim4-mcu compatible string.
> 
>    2. Extending the fan thermal driver to retrieve the fan register
>       and maximum level from platform_data,
>       and to optionally manage a power regulator for the fan supply.
> 
>    3. Adding the corresponding DTS node for the VIM4, wiring the MCU to
>       the I2C AO_A bus and exposing it as a thermal cooling device.

I will directly pick patch 6 now, and patch 7 & 8 later when patches 1,2,3,4 are picked
by the i2c & mfd maintainers.

Patch 5 should not be applied without path 4.

Neil

> 
> Signed-off-by: Ronald Claveau <[email-masked]>
> ---
> Changes in v6:
> - PATCH 4: Address Lee's review comments:
>    - Use an enum to discriminate between MCU types instead of passing
>      MFD data through the DT match table
>    - Fix error code from -EINVAL to -ENODEV when no MCU type is matched
>    - Make khadas_mcu_fan_cells and khadas_mcu_cells const
>    - Use dev_err_probe() for regmap initialization error
>    - Document fan speed levels for max_level
> - Link to v5: https://lore.kernel.org/r/[email-masked]
> 
> Changes in v5:
> - PATCH 5: Replace devm_regulator_get_optional() with devm_regulator_get()
>             to simplify error handling and remove NULL checks, also
>             ordering as reverse christmas according to Neil's feedback.
> - Link to v4: https://lore.kernel.org/r/[email-masked]
> 
> Changes in v4:
> - PATCH 1: limit fan-supply property by compatible according to Conor's feedback.
> - Link to v3: https://lore.kernel.org/r/[email-masked]
> 
> Changes in v3:
> - PATCH 1: adding comment on vim4 compatible saying it is not discoverable,
>             thanks to Rob's and Neil's feedback.
> - Link to v2: https://lore.kernel.org/r/[email-masked]
> 
> Changes in v2:
> - PATCH 5: Add regulator_disable on suspend thanks to Neil's feedback.
> - Link to v1: https://lore.kernel.org/r/[email-masked]
> 
> ---
> Ronald Claveau (8):
>        dt-bindings: mfd: khadas: Add new compatible for Khadas VIM4 MCU
>        dt-bindings: i2c: amlogic: Add compatible for T7 SOC
>        mfd: khadas-mcu: Add per-variant configuration infrastructure and VIM4 support
>        mfd: khadas-mcu: Add support for VIM4 MCU variant
>        thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support
>        arm64: dts: amlogic: t7: Add i2c pinctrl node
>        arm64: dts: amlogic: t7: Add i2c controller node
>        arm64: dts: amlogic: t7: khadas-vim4: Add i2c MCU fan node
> 
>   .../bindings/i2c/amlogic,meson6-i2c.yaml           |  13 ++-
>   .../devicetree/bindings/mfd/khadas,mcu.yaml        |  18 ++++
>   .../dts/amlogic/amlogic-t7-a311d2-khadas-vim4.dts  |  13 +++
>   arch/arm64/boot/dts/amlogic/amlogic-t7.dtsi        |  20 ++++
>   drivers/mfd/khadas-mcu.c                           | 119 ++++++++++++++++++---
>   drivers/thermal/khadas_mcu_fan.c                   |  37 +++++--
>   include/linux/mfd/khadas-mcu.h                     |  44 +++++++-
>   7 files changed, 236 insertions(+), 28 deletions(-)
> ---
> base-commit: f7b64ed948718290209074a50bb0df17e5944873
> change-id: 20260402-add-mcu-fan-khadas-vim4-ac1cbe553c9b
> prerequisite-message-id: <[email-masked]>
> prerequisite-patch-id: f03a086b4137158412b2d47b3de793b858de8dde
> prerequisite-patch-id: 123970c9b29c2090440f2fd71c85d3c6fd8e36de
> prerequisite-patch-id: 3e2e56b0926ba327b520f935df4ced5089bbe503
> prerequisite-patch-id: 65a5d76ffdbc9b3aab3385bb65cb027004c30e7e
> prerequisite-patch-id: 237269801826dd3ad7fb16eb4d7d6d4eab504278
> prerequisite-patch-id: 57e9b08a968aedf543d3d0d56cf1ca4db20b2a16
> prerequisite-change-id: 20260326-add-bcm43752-compatible-e264a4f7973a:v2
> prerequisite-patch-id: cd98b74fa56af72af2553f391c400981d83cd4f4
> prerequisite-patch-id: b730f5e42be1d89d193e63a0265495cdbf2c7d7b
> prerequisite-change-id: 20260330-fix-invalid-property-bbe54d933f71:v2
> prerequisite-patch-id: 8d675e7a239985c762843515b241f0a2f45f9c92
> prerequisite-change-id: 20260331-fix-aml-t7-null-reset-2b608ebf9da4:v1
> prerequisite-patch-id: 5b5de77af11747ce964404fb827d2ee2bff47ea5
> prerequisite-patch-id: 1e37fc75fed1e533adee0f3e7e6ead1f8ff3c55c
> prerequisite-patch-id: 65a5d76ffdbc9b3aab3385bb65cb027004c30e7e
> prerequisite-patch-id: 2daf583fb5e7449a02bd217d8aca330171b598aa
> prerequisite-patch-id: 237269801826dd3ad7fb16eb4d7d6d4eab504278
> prerequisite-patch-id: d1ddf9b7710e91f8062de83bd7ba55afb2c4c112
> prerequisite-patch-id: 57e9b08a968aedf543d3d0d56cf1ca4db20b2a16
> prerequisite-patch-id: cd98b74fa56af72af2553f391c400981d83cd4f4
> prerequisite-patch-id: b730f5e42be1d89d193e63a0265495cdbf2c7d7b
> prerequisite-patch-id: 9debd88fa60febed9cd7208f86603b4c2d270520
> prerequisite-patch-id: 314ef9ff0c4d1d15dab1dea9d92aa065f1eac3e9
> 
> Best regards,