Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 1684878

Browse files
mrhpearsonjwrdegoede
authored andcommitted
platform/x86: thinkpad_acpi: Add profile force ability
There has been a lot of confusion around which platform profiles are supported on various platforms and it would be useful to have a debug method to be able to override the profile mode that is selected. I don't expect this to be used in anything other than debugging in conjunction with Lenovo engineers - but it does give a way to get a system working whilst we wait for either FW fixes, or a driver fix to land upstream, if something is wonky in the mode detection logic Signed-off-by: Mark Pearson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Cc: [email protected] Reviewed-by: Hans de Goede <[email protected]> Signed-off-by: Hans de Goede <[email protected]>
1 parent 0c0cd3e commit 1684878

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10318,6 +10318,7 @@ static atomic_t dytc_ignore_event = ATOMIC_INIT(0);
1031810318
static DEFINE_MUTEX(dytc_mutex);
1031910319
static int dytc_capabilities;
1032010320
static bool dytc_mmc_get_available;
10321+
static int profile_force;
1032110322

1032210323
static int convert_dytc_to_profile(int funcmode, int dytcmode,
1032310324
enum platform_profile_option *profile)
@@ -10580,6 +10581,21 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
1058010581
if (err)
1058110582
return err;
1058210583

10584+
/* Check if user wants to override the profile selection */
10585+
if (profile_force) {
10586+
switch (profile_force) {
10587+
case -1:
10588+
dytc_capabilities = 0;
10589+
break;
10590+
case 1:
10591+
dytc_capabilities = BIT(DYTC_FC_MMC);
10592+
break;
10593+
case 2:
10594+
dytc_capabilities = BIT(DYTC_FC_PSC);
10595+
break;
10596+
}
10597+
pr_debug("Profile selection forced: 0x%x\n", dytc_capabilities);
10598+
}
1058310599
if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */
1058410600
pr_debug("MMC is supported\n");
1058510601
/*
@@ -11641,6 +11657,9 @@ MODULE_PARM_DESC(uwb_state,
1164111657
"Initial state of the emulated UWB switch");
1164211658
#endif
1164311659

11660+
module_param(profile_force, int, 0444);
11661+
MODULE_PARM_DESC(profile_force, "Force profile mode. -1=off, 1=MMC, 2=PSC");
11662+
1164411663
static void thinkpad_acpi_module_exit(void)
1164511664
{
1164611665
struct ibm_struct *ibm, *itmp;

0 commit comments

Comments
 (0)