Skip to content

Commit 836f35f

Browse files
mrhpearsonjwrdegoede
authored andcommitted
platform/x86: thinkpad_acpi: Fix incorrect use of platform profile on AMD platforms
Lenovo AMD based platforms have been offering platform_profiles but they are not working correctly. This is because the mode we are using on the Intel platforms (MMC) is not available on the AMD platforms. This commit adds checking of the functional capabilities returned by the BIOS to confirm if MMC is supported or not. Profiles will not be available if the platform is not MMC capable. I'm investigating and working on an alternative for AMD platforms but that is still work-in-progress. Signed-off-by: Mark Pearson <markpearson@lenovo.com> Link: https://lore.kernel.org/r/20220127190358.4078-1-markpearson@lenovo.com Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
1 parent b8fb0d9 commit 836f35f

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10119,6 +10119,9 @@ static struct ibm_struct proxsensor_driver_data = {
1011910119
#define DYTC_CMD_MMC_GET 8 /* To get current MMC function and mode */
1012010120
#define DYTC_CMD_RESET 0x1ff /* To reset back to default */
1012110121

10122+
#define DYTC_CMD_FUNC_CAP 3 /* To get DYTC capabilities */
10123+
#define DYTC_FC_MMC 27 /* MMC Mode supported */
10124+
1012210125
#define DYTC_GET_FUNCTION_BIT 8 /* Bits 8-11 - function setting */
1012310126
#define DYTC_GET_MODE_BIT 12 /* Bits 12-15 - mode setting */
1012410127

@@ -10331,6 +10334,15 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
1033110334
if (dytc_version < 5)
1033210335
return -ENODEV;
1033310336

10337+
/* Check what capabilities are supported. Currently MMC is needed */
10338+
err = dytc_command(DYTC_CMD_FUNC_CAP, &output);
10339+
if (err)
10340+
return err;
10341+
if (!(output & BIT(DYTC_FC_MMC))) {
10342+
dbg_printk(TPACPI_DBG_INIT, " DYTC MMC mode not supported\n");
10343+
return -ENODEV;
10344+
}
10345+
1033410346
dbg_printk(TPACPI_DBG_INIT,
1033510347
"DYTC version %d: thermal mode available\n", dytc_version);
1033610348
/*

0 commit comments

Comments
 (0)