Skip to content

Commit a27a1e3

Browse files
committed
platform/x86: ideapad-laptop: Add allow_v4_dytc module parameter
Add an allow_v4_dytc module parameter to allow users to easily test if DYTC version 4 platform-profiles work on their laptop. Fixes: 599482c ("platform/x86: ideapad-laptop: Add platform support for Ideapad 5 Pro 16ACH6-82L5") Link: https://bugzilla.kernel.org/show_bug.cgi?id=213297 Signed-off-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent d2f33f0 commit a27a1e3

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

drivers/platform/x86/ideapad-laptop.c

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,10 @@ static bool no_bt_rfkill;
152152
module_param(no_bt_rfkill, bool, 0444);
153153
MODULE_PARM_DESC(no_bt_rfkill, "No rfkill for bluetooth.");
154154

155+
static bool allow_v4_dytc;
156+
module_param(allow_v4_dytc, bool, 0444);
157+
MODULE_PARM_DESC(allow_v4_dytc, "Enable DYTC version 4 platform-profile support.");
158+
155159
/*
156160
* ACPI Helpers
157161
*/
@@ -901,13 +905,16 @@ static int ideapad_dytc_profile_init(struct ideapad_private *priv)
901905

902906
dytc_version = (output >> DYTC_QUERY_REV_BIT) & 0xF;
903907

904-
if (dytc_version < 5) {
905-
if (dytc_version < 4 || !dmi_check_system(ideapad_dytc_v4_allow_table)) {
906-
dev_info(&priv->platform_device->dev,
907-
"DYTC_VERSION is less than 4 or is not allowed: %d\n",
908-
dytc_version);
909-
return -ENODEV;
910-
}
908+
if (dytc_version < 4) {
909+
dev_info(&priv->platform_device->dev, "DYTC_VERSION < 4 is not supported\n");
910+
return -ENODEV;
911+
}
912+
913+
if (dytc_version < 5 &&
914+
!(allow_v4_dytc || dmi_check_system(ideapad_dytc_v4_allow_table))) {
915+
dev_info(&priv->platform_device->dev,
916+
"DYTC_VERSION 4 support may not work. Pass ideapad_laptop.allow_v4_dytc=Y on the kernel commandline to enable\n");
917+
return -ENODEV;
911918
}
912919

913920
priv->dytc = kzalloc(sizeof(*priv->dytc), GFP_KERNEL);

0 commit comments

Comments
 (0)