mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: alexei.solcanu@pm.me
Cc: Cryolitia PukNgae <cryolitia@uniontech.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org,
	Antheas Kapenekakis <lkml@antheas.dev>
Subject: Re: [PATCH] hwmon: (gpd-fan) Reset both fans to automatic on duo boards
Date: Fri, 25 Sep 2026 18:46:38 -0700	[thread overview]
Message-ID: <78883f5d-e9b7-4fc4-a15a-d5ece6c9c8c3@roeck-us.net> (raw)
In-Reply-To: <20260925-gpd-fan-duo-auto-v1-1-29bb670b3331@pm.me>

On Fri, Sep 25, 2026 at 08:13:26PM -0400, Alexei Solcanu via B4 Relay wrote:
> From: Alexei Solcanu <alexei.solcanu@pm.me>
> 
> 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.
> 
> Fixes: 0ab88e239439 ("hwmon: add GPD devices sensor driver")
> Assisted-by: LLM
> Signed-off-by: Alexei Solcanu <alexei.solcanu@pm.me>
> ---
> Both fans were set to full speed (pwm1_enable=1, pwm1=255), then
> switched to automatic (pwm1_enable=2). Values read from the EC 15
> seconds later:
> 
>                  0x047A  0x047B  fan 1     fan 2
>   without patch  0x00    0xf4    2542 rpm  6379 rpm
>   with patch     0x00    0x00    2545 rpm  2560 rpm
> 
> Fan 2's RPM, found by probing, is at EC 0x0476/0x0477.

If this system has two fans, why does it register only one 
fan and pwm channel ? This seems conceptually wrong.

Guenter

> ---
>  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;
>  	}
>  }
> 
> ---
> base-commit: 3cbb5f15e464583e59c8501a7085ec12b53e23ac
> change-id: 20260925-gpd-fan-duo-auto-871de9e006dc
> 
> Best regards,
> --  
> Alexei Solcanu <alexei.solcanu@pm.me>
> 
> 
> 

      reply	other threads:[~2026-09-26  1:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-26  0:13 Alexei Solcanu via B4 Relay
2026-09-26  1:46 ` Guenter Roeck [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=78883f5d-e9b7-4fc4-a15a-d5ece6c9c8c3@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=alexei.solcanu@pm.me \
    --cc=cryolitia@uniontech.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkml@antheas.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®