[PATCH 2/2] platform/x86: bitland-mifs-wmi: Treat WMI_FN_SYSTEM_AC_TYPE as optional
From: Armin Wolf
Date: Fri Sep 04 2026 - 18:51:20 EST
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 <martiya.ar@xxxxxxxxx>
Signed-off-by: Armin Wolf <W_Armin@xxxxxx>
---
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)
--
2.39.5