mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 18:41:58 +09:00
platform/x86: thinkpad_acpi: Add profile force ability
commit 1684878952 upstream.
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 <mpearson-lenovo@squebb.ca>
Link: https://lore.kernel.org/r/20230505132523.214338-2-mpearson-lenovo@squebb.ca
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
66d4f7f327
commit
d759abeb27
@@ -10322,6 +10322,7 @@ static atomic_t dytc_ignore_event = ATOMIC_INIT(0);
|
|||||||
static DEFINE_MUTEX(dytc_mutex);
|
static DEFINE_MUTEX(dytc_mutex);
|
||||||
static int dytc_capabilities;
|
static int dytc_capabilities;
|
||||||
static bool dytc_mmc_get_available;
|
static bool dytc_mmc_get_available;
|
||||||
|
static int profile_force;
|
||||||
|
|
||||||
static int convert_dytc_to_profile(int funcmode, int dytcmode,
|
static int convert_dytc_to_profile(int funcmode, int dytcmode,
|
||||||
enum platform_profile_option *profile)
|
enum platform_profile_option *profile)
|
||||||
@@ -10584,6 +10585,21 @@ static int tpacpi_dytc_profile_init(struct ibm_init_struct *iibm)
|
|||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
/* Check if user wants to override the profile selection */
|
||||||
|
if (profile_force) {
|
||||||
|
switch (profile_force) {
|
||||||
|
case -1:
|
||||||
|
dytc_capabilities = 0;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
dytc_capabilities = BIT(DYTC_FC_MMC);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
dytc_capabilities = BIT(DYTC_FC_PSC);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
pr_debug("Profile selection forced: 0x%x\n", dytc_capabilities);
|
||||||
|
}
|
||||||
if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */
|
if (dytc_capabilities & BIT(DYTC_FC_MMC)) { /* MMC MODE */
|
||||||
pr_debug("MMC is supported\n");
|
pr_debug("MMC is supported\n");
|
||||||
/*
|
/*
|
||||||
@@ -11645,6 +11661,9 @@ MODULE_PARM_DESC(uwb_state,
|
|||||||
"Initial state of the emulated UWB switch");
|
"Initial state of the emulated UWB switch");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
module_param(profile_force, int, 0444);
|
||||||
|
MODULE_PARM_DESC(profile_force, "Force profile mode. -1=off, 1=MMC, 2=PSC");
|
||||||
|
|
||||||
static void thinkpad_acpi_module_exit(void)
|
static void thinkpad_acpi_module_exit(void)
|
||||||
{
|
{
|
||||||
struct ibm_struct *ibm, *itmp;
|
struct ibm_struct *ibm, *itmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user