From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Vishnu Sankar <vishnuocv@gmail.com>
Cc: Hans de Goede <hdegoede@redhat.com>,
platform-driver-x86@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
Mark Pearson <mpearson-lenovo@squebb.ca>,
vsankar@lenovo.com
Subject: Re: [PATCH 2/2] platform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads
Date: Wed, 14 Feb 2024 12:22:57 +0200 (EET) [thread overview]
Message-ID: <97fb005c-92bc-790b-80b0-75149a799b4b@linux.intel.com> (raw)
In-Reply-To: <20240214052959.8550-2-vishnuocv@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 1470 bytes --]
On Wed, 14 Feb 2024, Vishnu Sankar wrote:
> Added non-standard thermal register support for some ThinkPads.
>
> Some of the Thinkpads use a non-standard ECFW which use different
> thermal register addresses.
> This is a fix to correct the wrong temperature reporting on
> those systems.
>
> Tested on Lenovo ThinkPad L13 Yoga Gen2
>
> Suggested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
> Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
> ---
> -Improvements as requested.
> -Improved the readability in case TPACPI_THERMAL_TPEC_12.
> -idx < 8 from idx idx <=7 to match idx = 8
> -KILO used from linux/units.h instead of 1000.
> static enum thermal_access_mode thermal_read_mode;
> static bool thermal_use_labels;
> +static bool thermal_with_ns_address; /*Non-standard thermal reg address*/
Comment is missing spaces.
> @@ -6239,6 +6267,20 @@ static int thermal_get_sensor(int idx, s32 *value)
> }
> break;
>
> + /* The Non-standard EC uses 12 Thermal areas */
> + case TPACPI_THERMAL_TPEC_12:
> + if (idx >= 12)
> + return -EINVAL;
> +
> + t = idx < 8 ? TP_EC_THERMAL_TMP0_NS + idx :
> + TP_EC_THERMAL_TMP8_NS + (idx - 8);
> +
> + if (!acpi_ec_read(t, &tmp))
> + return -EIO;
> +
> + *value = tmp * KILO;
Hmm, MILLI would be much more approriate here? But if this relates to
degrees, there is MILLIDEGREE_PER_DEGREE?
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
--
i.
next prev parent reply other threads:[~2024-02-14 10:23 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-14 5:29 [PATCH 1/2] platform/x86: thinkpad_acpi: Simplify thermal mode checking Vishnu Sankar
2024-02-14 5:29 ` [PATCH 2/2] platform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads Vishnu Sankar
2024-02-14 10:22 ` Ilpo Järvinen [this message]
2024-02-14 23:22 ` Vishnu Sankar
2024-02-14 9:52 ` [PATCH 1/2] platform/x86: thinkpad_acpi: Simplify thermal mode checking Ilpo Järvinen
2024-02-14 23:18 ` Vishnu Sankar
2024-02-14 10:16 ` Ilpo Järvinen
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=97fb005c-92bc-790b-80b0-75149a799b4b@linux.intel.com \
--to=ilpo.jarvinen@linux.intel.com \
--cc=hdegoede@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpearson-lenovo@squebb.ca \
--cc=platform-driver-x86@vger.kernel.org \
--cc=vishnuocv@gmail.com \
--cc=vsankar@lenovo.com \
/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®