Re: [PATCH v12 4/6] thermal: khadas-mcu-fan: Add fan config from platform data Add regulator support

From: Daniel Lezcano

Date: Fri Sep 18 2026 - 05:17:59 EST


On 9/17/26 09:59, Ronald Claveau via B4 Relay wrote:
From: Ronald Claveau <linux-kernel-dev@xxxxxxxx>

Introduce platform name, control register and duty-cycle
levels per variant.
VIM4 uses a different register and level set (0-100)
declared as a list (0, 30, 40, 55, 75, 100) compared
to previous boards (0-3).

MAX_LEVEL is kept and bumped from 3 to 5 to make
the speed change more gradual with the newer MCUs.

The cooling device's state is stored as an index into levels[],
and khadas_mcu_fan_set_level() writes levels[state] to fan_reg,
rather than writing the raw state value as before.

Optionally acquire and enable a "fan" regulator supply
at probe time and on resume,
so boards that gate fan power through a regulator are handled.
The regulator is released via a devm_add_action_or_reset()
callback.

Reviewed-by: Neil Armstrong <neil.armstrong@xxxxxxxxxx>
Signed-off-by: Ronald Claveau <linux-kernel-dev@xxxxxxxx>
---
Acked-by: Daniel Lezcano <daniel.lezcano@xxxxxxxxxxxxxxxx>