From 4cfc3631d4ca19199f7220c16b4a24204218e588 Mon Sep 17 00:00:00 2001 From: Armin Wolf Date: Sat, 5 Sep 2026 00:45:16 +0200 Subject: [PATCH] platform/x86: bitland-mifs-wmi: Treat WMI_FN_SYSTEM_AC_TYPE as optional MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Some systems only support USB-C but can still enter performance mode if connected to a charger. Such systems usually do not support WMI_FN_SYSTEM_AC_TYPE, so bitland_check_performance_capability() currently always fails on them. Fix this by treating WMI_FN_SYSTEM_AC_TYPE as optional and skip the AC type check if WMI_FN_SYSTEM_AC_TYPE is not supported. Tested-by: Martiya Aryan Mehr Signed-off-by: Armin Wolf Link: https://patch.msgid.link/20260904224516.8893-3-W_Armin@gmx.de Reviewed-by: Ilpo Järvinen Signed-off-by: Ilpo Järvinen --- Documentation/wmi/devices/bitland-mifs-wmi.rst | 3 ++- drivers/platform/x86/bitland-mifs-wmi.c | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/wmi/devices/bitland-mifs-wmi.rst b/Documentation/wmi/devices/bitland-mifs-wmi.rst index 314b3fbdda45..27c3fd248279 100644 --- a/Documentation/wmi/devices/bitland-mifs-wmi.rst +++ b/Documentation/wmi/devices/bitland-mifs-wmi.rst @@ -214,7 +214,8 @@ Performance Modes Changing the performance mode via Command ID 0x08 (SystemPerMode) affects the power limits (PL1/PL2) and fan curves managed by the Embedded Controller (EC). Note that the "Full-speed" and "Performance" mode (1, 3) is typically only -available when the system is connected to a DC power source (not USB-C/PD). +available when the system is connected to a DC power source (not USB-C/PD on +model with a dedicated DC connector). In the driver implementation, switch to performance/full-speed mode without DC power connected will throw the EOPNOTSUPP error. diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c index cdb930eb678d..dd1648b7de77 100644 --- a/drivers/platform/x86/bitland-mifs-wmi.c +++ b/drivers/platform/x86/bitland-mifs-wmi.c @@ -246,7 +246,11 @@ static int bitland_check_performance_capability(struct bitland_mifs_wmi_data *da return -EOPNOTSUPP; ret = bitland_mifs_wmi_call(data, &input, &output); - if (ret) + /* Not all systems support this function, do not perform further checks on them */ + if (ret == -EOPNOTSUPP) + return 0; + + if (ret < 0) return ret; if (output.data[0] != WMI_SYSTEM_AC_CIRCULARHOLE)