[PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT

From: Bozhen Peng

Date: Tue Dec 01 2026 - 23:04:21 EST


My WUJIE15 PRO HPT uses performance (0), balanced (1) and low-power (2),
which differ from the default mapping.

USB-C is its only external power input. I use the ACPI adapter's _PSR to
check power because the USB-C supply's cached ONLINE value can be stale
after unplugging during suspend. Failed or invalid queries return an error.

HPT reports two fans, in Fan 2/Fan 1 order, and no CPU temperature. I hide
the unsupported GPU mode, keyboard RGB mode and fan-boost controls, while
keeping keyboard backlight brightness available.

Signed-off-by: Bozhen Peng <bozhenpeng93@xxxxxxxxx>
---
drivers/platform/x86/bitland-mifs-wmi.c | 64 +++++++++++++++++++++++++
1 file changed, 64 insertions(+)

diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 9fa77e667a1a8ec7e152555fd47a56711e484095..88b35afe02a3ce65d53433387e23b848e4e64d29 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -101,6 +101,9 @@ struct bitland_hwmon_config {
};

static const struct bitland_hwmon_config default_hwmon_config;
+static const struct bitland_hwmon_config hpt_hwmon_config;
+
+static int bitland_hpt_check_performance_capability(void);

struct bitland_mifs_quirks {
const struct bitland_profile_entry *profile_entries;
@@ -151,6 +154,20 @@ static const struct bitland_mifs_quirks tm2424_quirks = {
.skip_ac_type_check = true,
};

+static const struct bitland_profile_entry hpt_profile_entries[] = {
+ { PLATFORM_PROFILE_LOW_POWER, 0x02 },
+ { PLATFORM_PROFILE_BALANCED, 0x01 },
+ { PLATFORM_PROFILE_PERFORMANCE, 0x00 },
+};
+
+static const struct bitland_mifs_quirks hpt_quirks = {
+ .profile_entries = hpt_profile_entries,
+ .num_profile_entries = ARRAY_SIZE(hpt_profile_entries),
+ .check_performance_capability = bitland_hpt_check_performance_capability,
+ .hwmon = &hpt_hwmon_config,
+ .disable_extra_controls = true,
+};
+
static const struct dmi_system_id bitland_mifs_dmi_table[] = {
{
.matches = {
@@ -166,6 +183,14 @@ static const struct dmi_system_id bitland_mifs_dmi_table[] = {
},
.driver_data = (void *)&tm2424_quirks,
},
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "MECHREVO"),
+ DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "WUJIE15 PRO"),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "WUJIE15 Series-HPT"),
+ },
+ .driver_data = (void *)&hpt_quirks,
+ },
{}
};

@@ -355,6 +380,25 @@ static int laptop_profile_get(struct device *dev,
return -EINVAL;
}

+static int bitland_hpt_check_performance_capability(void)
+{
+ struct acpi_device *adapter;
+ unsigned long long online;
+ acpi_status status;
+
+ adapter = acpi_dev_get_first_match_dev("ACPI0003", NULL, -1);
+ if (!adapter)
+ return -ENODEV;
+
+ /* USB-C ONLINE may be stale on resume; _PSR reads current EC state. */
+ status = acpi_evaluate_integer(adapter->handle, "_PSR", NULL, &online);
+ acpi_dev_put(adapter);
+ if (ACPI_FAILURE(status) || online > 1)
+ return -EIO;
+
+ return online ? 0 : -EOPNOTSUPP;
+}
+
static int bitland_pp_check_capability(struct bitland_mifs_wmi_data *data)
{
struct bitland_mifs_input input = {
@@ -572,6 +616,9 @@ static const char * const default_fan_labels[] = {
"SYS", /* 2 */
};

+/* The HPT firmware returns Fan 2 before Fan 1. */
+static const char * const hpt_fan_labels[] = { "Fan 2", "Fan 1" };
+
static const struct bitland_hwmon_config *
bitland_hwmon_config(const struct bitland_mifs_wmi_data *data)
{
@@ -642,6 +689,12 @@ static const struct hwmon_channel_info *laptop_hwmon_info[] = {
NULL
};

+static const struct hwmon_channel_info *hpt_hwmon_info[] = {
+ HWMON_CHANNEL_INFO(fan, HWMON_F_INPUT | HWMON_F_LABEL,
+ HWMON_F_INPUT | HWMON_F_LABEL),
+ NULL
+};
+
static const struct hwmon_ops laptop_hwmon_ops = {
.visible = 0444,
.read = laptop_hwmon_read,
@@ -653,12 +706,23 @@ static const struct hwmon_chip_info laptop_chip_info = {
.info = laptop_hwmon_info,
};

+static const struct hwmon_chip_info hpt_chip_info = {
+ .ops = &laptop_hwmon_ops,
+ .info = hpt_hwmon_info,
+};
+
static const struct bitland_hwmon_config default_hwmon_config = {
.chip_info = &laptop_chip_info,
.fan_labels = default_fan_labels,
.num_fans = ARRAY_SIZE(default_fan_labels),
};

+static const struct bitland_hwmon_config hpt_hwmon_config = {
+ .chip_info = &hpt_chip_info,
+ .fan_labels = hpt_fan_labels,
+ .num_fans = ARRAY_SIZE(hpt_fan_labels),
+};
+
static int laptop_kbd_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{