lkml.org 
[lkml]   [2024]   [Feb]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 2/2] platform/x86: thinkpad_acpi: Fix to correct wrong temp reporting on some ThinkPads
Ilpo,
Thanks for the review.

On Wed, Feb 14, 2024 at 7:23 PM Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> 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 uses 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.
Acked.
>
> > @@ -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?
Will Change to MILLIDEGREE_PER_DEGREE from KILO
>
> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
>
> --
> i.



--

Regards,

Vishnu Sankar
+817015150407 (Japan)

\
 
 \ /
  Last update: 2024-05-27 15:04    [W:0.067 / U:0.496 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site