alienware-wmi: added force module parameters

Added force_platform_profile and force_gmode unsafe module parameters,
allowing users to force `thermal` and `gmode` quirks respectively.

Signed-off-by: Kurt Borja <kuurtb@gmail.com>
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Link: https://lore.kernel.org/r/20241030001148.7623-2-kuurtb@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
pull/1083/head
Kurt Borja 2024-10-29 21:11:49 -03:00 committed by Ilpo Järvinen
parent 9f6c430415
commit 18eec62ee0
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
1 changed files with 18 additions and 0 deletions

View File

@ -42,6 +42,14 @@ MODULE_LICENSE("GPL");
MODULE_ALIAS("wmi:" LEGACY_CONTROL_GUID);
MODULE_ALIAS("wmi:" WMAX_CONTROL_GUID);
static bool force_platform_profile;
module_param_unsafe(force_platform_profile, bool, 0);
MODULE_PARM_DESC(force_platform_profile, "Forces auto-detecting thermal profiles without checking if WMI thermal backend is available");
static bool force_gmode;
module_param_unsafe(force_gmode, bool, 0);
MODULE_PARM_DESC(force_gmode, "Forces G-Mode when performance profile is selected");
enum INTERFACE_FLAGS {
LEGACY,
WMAX,
@ -1075,6 +1083,16 @@ static int __init alienware_wmi_init(void)
if (quirks == NULL)
quirks = &quirk_unknown;
if (force_platform_profile)
quirks->thermal = true;
if (force_gmode) {
if (quirks->thermal)
quirks->gmode = true;
else
pr_warn("force_gmode requieres platform profile support\n");
}
ret = platform_driver_register(&platform_driver);
if (ret)
goto fail_platform_driver;