lkml.org 
[lkml]   [2023]   [Mar]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] hwmon: pwm-fan: set usage_power on PWM state
On Thu, Mar 09, 2023 at 02:10:08AM +0100, Lorenz Brun wrote:
> PWM fans are controlled solely by the duty cycle of the PWM signal, they
> do not care about the exact timing. Thus set usage_power to true to
> allow less flexible hardware to work as a PWM source for fan control.
>
> Signed-off-by: Lorenz Brun <lorenz@brun.one>

Applied to hwmon-next.

Thanks,
Guenter

> ---
> drivers/hwmon/pwm-fan.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/hwmon/pwm-fan.c b/drivers/hwmon/pwm-fan.c
> index 83a347ca35da..aa746c2bde39 100644
> --- a/drivers/hwmon/pwm-fan.c
> +++ b/drivers/hwmon/pwm-fan.c
> @@ -507,6 +507,14 @@ static int pwm_fan_probe(struct platform_device *pdev)
>
> pwm_init_state(ctx->pwm, &ctx->pwm_state);
>
> + /*
> + * PWM fans are controlled solely by the duty cycle of the PWM signal,
> + * they do not care about the exact timing. Thus set usage_power to true
> + * to allow less flexible hardware to work as a PWM source for fan
> + * control.
> + */
> + ctx->pwm_state.usage_power = true;
> +
> /*
> * set_pwm assumes that MAX_PWM * (period - 1) fits into an unsigned
> * long. Check this here to prevent the fan running at a too low

\
 
 \ /
  Last update: 2023-03-27 01:11    [W:0.077 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site