Re: [PATCH v2 1/2] hwmon: (gpd-fan) Reset both fans to automatic on duo boards
From: Antheas Kapenekakis
Date: Sat Sep 26 2026 - 16:22:47 EST
On Sat, 26 Sept 2026 at 22:12, Alexei Solcanu via B4 Relay
<devnull+alexei.solcanu.pm.me@xxxxxxxxxx> wrote:
>
> From: Alexei Solcanu <alexei.solcanu@xxxxx>
>
> On boards using gpd_duo_drvdata (GPD Duo, GPD Win 5), writing
> pwm1_enable=2 only returns the first fan to EC control. The second fan
> keeps its last manual duty cycle, e.g. full speed after pwm1=255, so a
> fan control tool that exits leaves it running at that speed.
>
> gpd_duo_write_pwm() writes both fan registers (pwm_write and
> pwm_write + 1), but switching to automatic only clears pwm_write.
> Also clear pwm_write + 1, so both fans return to EC control.
>
> Tested on a GPD Win 5 (G1618-05). Not tested on the GPD Duo.
We expect the Win Max 3 to release with the same register layout. Can
you verify it has two fans? If yes this is good to go.
I will try to pull this patch for testing. Second one will take a bit
longer because it needs (my) userspace changes.
Thanks,
Antheas
Reviewed-by: Antheas Kapenekakis <lkml@xxxxxxxxxxx>
> Fixes: 0ab88e239439 ("hwmon: add GPD devices sensor driver")
> Assisted-by: LLM
> Signed-off-by: Alexei Solcanu <alexei.solcanu@xxxxx>
> ---
> drivers/hwmon/gpd-fan.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwmon/gpd-fan.c b/drivers/hwmon/gpd-fan.c
> index ed212615b2f..b3b75f99f58 100644
> --- a/drivers/hwmon/gpd-fan.c
> +++ b/drivers/hwmon/gpd-fan.c
> @@ -444,6 +444,7 @@ static void gpd_duo_set_pwm_enable(struct gpd_fan_data *data, enum FAN_PWM_ENABL
> break;
> case AUTOMATIC:
> gpd_ecram_write(data->drvdata, data->drvdata->pwm_write, 0);
> + gpd_ecram_write(data->drvdata, data->drvdata->pwm_write + 1, 0);
> break;
> }
> }
>
> --
> 2.55.0
>
>
>