acrn-kernel/drivers/acpi/pmic
Hans de Goede 5f96ba5655 ACPI: PMIC: xpower: Fix _TMP ACPI errors
On some devices with a X-Powers AXP288 PMIC the LPAT tables in the ACPI
node for the AXP288 PMIC for some reason only describe a small temperature
range, e.g. 27° - 37° Celcius (assuming the entries are in millidegrees).

When the tablet is idle in a room at 21° degrees this is causing values
outside the LPAT table to be read, causing e.g. the following 2 errors
to get spammed to the logs every 4 seconds! :

[ 7512.791316] ACPI Error: AE_ERROR, Returned by Handler for [UserDefinedRegion] (20210930/evregion-281)
[ 7512.791611] ACPI Error: Aborting method \_SB.SXP1._TMP due to previous error (AE_ERROR) (20210930/psparse-529)

Fix this by clamping the raw value to the LPAT table range before
passing it to acpi_lpat_raw_to_temp().

Note clamping has been chosen rather then extrapolating because it is
unknown how other parts of the ACPI tables will respond to temperature
values outside of the LPAT range.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2021-12-08 15:34:57 +01:00
..
Kconfig mfd: tps68470: Remove tps68470 MFD driver 2021-06-17 13:12:18 +02:00
Makefile ACPI / PMIC: Move TPS68470 OpRegion driver to drivers/acpi/pmic/ 2020-09-15 19:40:59 +02:00
intel_pmic.c ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic.h ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic_bxtwc.c ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic_bytcrc.c ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic_chtcrc.c ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic_chtdc_ti.c ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic_chtwc.c ACPI: PMIC: allow drivers to provide a custom lpat_raw_to_temp() function 2021-12-08 15:34:57 +01:00
intel_pmic_xpower.c ACPI: PMIC: xpower: Fix _TMP ACPI errors 2021-12-08 15:34:57 +01:00
tps68470_pmic.c