mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Stanislav Aleksandrov <lightofmysoul@gmail.com>
Cc: Nurettin Bolucu <Nurettin.Bolucu@analog.com>,
	linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] hwmon: (max31760) Fix the local temperature limit registers
Date: Sun, 8 Nov 2026 07:53:12 -0800	[thread overview]
Message-ID: <5c7880c8-8b2a-4558-b89e-9d41e8a391b9@roeck-us.net> (raw)
In-Reply-To: <20261108-max31760-fixes-v1-1-a61450463059@gmail.com>

On Sun, Nov 08, 2026 at 03:59:53AM +0000, Stanislav Aleksandrov wrote:
> temp2_max and temp2_crit use each other's registers, so reading them
> shows the local limits swapped and writing temp2_max changes the
> overtemperature (SHDN) threshold.
> 
> Use the high limit (0x0C) for temp2_max and the overtemperature limit
> (0x08) for temp2_crit.
> 
> Fixes: 38b04ad02d0d ("drivers: hwmon: Add max31760 fan speed controller driver")
> Signed-off-by: Stanislav Aleksandrov <lightofmysoul@gmail.com>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/max31760.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hwmon/max31760.c b/drivers/hwmon/max31760.c
> index 8d3be064b025..e3d86dc4257e 100644
> --- a/drivers/hwmon/max31760.c
> +++ b/drivers/hwmon/max31760.c
> @@ -27,8 +27,8 @@
>  
>  #define REG_TACH(ch)		(0x52 + (ch) * 2)
>  #define REG_TEMP_INPUT(ch)	(0x56 + (ch) * 2)
> -#define REG_TEMP_MAX(ch)	(0x06 + (ch) * 2)
> -#define REG_TEMP_CRIT(ch)	(0x0A + (ch) * 2)
> +#define REG_TEMP_MAX(ch)	((ch) ? 0x0C : 0x06)
> +#define REG_TEMP_CRIT(ch)	((ch) ? 0x08 : 0x0A)
>  
>  #define TEMP11_FROM_REG(reg)	((reg) / 32 * 125)
>  #define TEMP11_TO_REG(val)	(DIV_ROUND_CLOSEST(clamp_val((val), -128000, \

  reply	other threads:[~2026-11-08 15:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-08  3:59 [PATCH 0/3] hwmon: (max31760) Fix local limits, standby and the initial fan speed Stanislav Aleksandrov
2026-11-08  3:59 ` [PATCH 1/3] hwmon: (max31760) Fix the local temperature limit registers Stanislav Aleksandrov
2026-11-08 15:53   ` Guenter Roeck [this message]
2026-11-08  3:59 ` [PATCH 2/3] hwmon: (max31760) Leave standby mode at probe Stanislav Aleksandrov
2026-11-08 15:54   ` Guenter Roeck
2026-11-08  3:59 ` [PATCH 3/3] hwmon: (max31760) Report 0 RPM before the first fan speed measurement Stanislav Aleksandrov
2026-11-08 15:55   ` Guenter Roeck

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=5c7880c8-8b2a-4558-b89e-9d41e8a391b9@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Nurettin.Bolucu@analog.com \
    --cc=lightofmysoul@gmail.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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®