public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Wilken Gottwalt <wilken.gottwalt@posteo.net>
Cc: linux-kernel@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH] hwmon: fix corsair-psu fan rpm calculation
Date: Fri, 13 Nov 2020 06:39:21 -0800	[thread overview]
Message-ID: <20201113143921.GA26336@roeck-us.net> (raw)
In-Reply-To: <20201113121954.GA8488@monster.powergraphx.local>

On Fri, Nov 13, 2020 at 01:19:54PM +0100, Wilken Gottwalt wrote:
> The correct fan rpm value is also a LINEAR11 value but without a factor.
> Verified by using the fan test button on the psu to let the fan spin up
> to maximum for some seconds.
> 
> Fixes: 933222c98445 ("hwmon: (corsair-psu) fix unintentional sign extension issue")
> Signed-off-by: Wilken Gottwalt <wilken.gottwalt@posteo.net>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/corsair-psu.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/hwmon/corsair-psu.c b/drivers/hwmon/corsair-psu.c
> index 5d19a888231a..99494056f4bd 100644
> --- a/drivers/hwmon/corsair-psu.c
> +++ b/drivers/hwmon/corsair-psu.c
> @@ -252,12 +252,7 @@ static int corsairpsu_get_value(struct corsairpsu_data *priv, u8 cmd, u8 rail, l
>  		*val = corsairpsu_linear11_to_int(tmp & 0xFFFF) * 1000;
>  		break;
>  	case PSU_CMD_FAN:
> -		/*
> -		 * this value is best guess, so the calculated value could be wrong, it is hard
> -		 * to ge the fan to spin in these semi-passive power supplies, which need a
> -		 * quite high load to do so
> -		 */
> -		*val = ((tmp & 0xFF) << 8) + ((tmp >> 8) & 0xFF);
> +		*val = corsairpsu_linear11_to_int(tmp & 0xFFFF);
>  		break;
>  	case PSU_CMD_RAIL_WATTS:
>  	case PSU_CMD_TOTAL_WATTS:

      reply	other threads:[~2020-11-13 14:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-13 12:19 [PATCH] hwmon: fix corsair-psu fan rpm calculation Wilken Gottwalt
2020-11-13 14:39 ` 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=20201113143921.GA26336@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=corbet@lwn.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=wilken.gottwalt@posteo.net \
    /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