[PATCH v4 2/4] platform/x86: bitland-mifs-wmi: Allow quirks to override the power check
From: Bozhen Peng
Date: Tue Dec 01 2026 - 23:02:20 EST
The WUJIE15 PRO HPT needs a different power check before allowing the
performance profile. Add an optional callback to the quirks and keep
the existing check when no callback is provided.
No functional change intended.
Signed-off-by: Bozhen Peng <bozhenpeng93@xxxxxxxxx>
---
drivers/platform/x86/bitland-mifs-wmi.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 04125c602f3bde13426fa463415cdafe0b0d07fe..43f709714edac3d731378349f9fb5cbf6b1fc09b 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -105,6 +105,7 @@ static const struct bitland_hwmon_config default_hwmon_config;
struct bitland_mifs_quirks {
const struct bitland_profile_entry *profile_entries;
size_t num_profile_entries;
+ int (*check_performance_capability)(void);
const struct bitland_hwmon_config *hwmon;
bool return_code_at_end;
@@ -362,6 +363,9 @@ static int bitland_pp_check_capability(struct bitland_mifs_wmi_data *data)
struct bitland_mifs_output_head_rc output;
int ret;
+ if (data->quirks->check_performance_capability)
+ return data->quirks->check_performance_capability();
+
if (data->quirks->skip_ac_type_check)
return power_supply_is_system_supplied() > 0 ? 0 : -EOPNOTSUPP;