* [PATCH v4 1/4] platform/x86: bitland-mifs-wmi: Allow per-model hwmon configuration
2026-12-02 4:00 [PATCH v4 0/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
@ 2026-12-02 4:01 ` Bozhen Peng
2026-12-02 4:02 ` [PATCH v4 2/4] platform/x86: bitland-mifs-wmi: Allow quirks to override the power check Bozhen Peng
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Bozhen Peng @ 2026-12-02 4:01 UTC (permalink / raw)
To: Ilpo Jarvinen, Mingyou Chen, Ilya Gladyshev
Cc: Hans de Goede, Armin Wolf, platform-driver-x86, linux-kernel
The WUJIE15 PRO HPT has two fans and no CPU temperature reading.
Move the hwmon chip info and fan labels into a per-model configuration
so its sensor layout can be added separately. Keep the current layout
as the default.
No functional change intended.
Signed-off-by: Bozhen Peng <bozhenpeng93@gmail.com>
---
drivers/platform/x86/bitland-mifs-wmi.c | 43 +++++++++++++++++++------
1 file changed, 34 insertions(+), 9 deletions(-)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 7bad8942249d43bd378d7adf8da26261fd684df7..04125c602f3bde13426fa463415cdafe0b0d07fe 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -94,9 +94,18 @@ struct bitland_profile_entry {
bool battery; /* Set in place of the AC entry while on battery */
};
+struct bitland_hwmon_config {
+ const struct hwmon_chip_info *chip_info;
+ const char * const *fan_labels;
+ size_t num_fans;
+};
+
+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;
+ const struct bitland_hwmon_config *hwmon;
bool return_code_at_end;
bool skip_ac_type_check;
@@ -552,12 +561,18 @@ static const struct platform_profile_ops laptop_profile_ops = {
.profile_set = laptop_profile_set,
};
-static const char *const fan_labels[] = {
+static const char * const default_fan_labels[] = {
"CPU", /* 0 */
"GPU", /* 1 */
"SYS", /* 2 */
};
+static const struct bitland_hwmon_config *
+bitland_hwmon_config(const struct bitland_mifs_wmi_data *data)
+{
+ return data->quirks->hwmon ?: &default_hwmon_config;
+}
+
static int laptop_hwmon_read(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, long *val)
{
@@ -603,13 +618,15 @@ static int laptop_hwmon_read_string(struct device *dev,
enum hwmon_sensor_types type, u32 attr,
int channel, const char **str)
{
- if (type == hwmon_fan && attr == hwmon_fan_label) {
- if (channel >= 0 && channel < ARRAY_SIZE(fan_labels)) {
- *str = fan_labels[channel];
- return 0;
- }
- }
- return -EINVAL;
+ struct bitland_mifs_wmi_data *data = dev_get_drvdata(dev);
+ const struct bitland_hwmon_config *config = bitland_hwmon_config(data);
+
+ if (type != hwmon_fan || attr != hwmon_fan_label ||
+ channel < 0 || channel >= config->num_fans)
+ return -EINVAL;
+
+ *str = config->fan_labels[channel];
+ return 0;
}
static const struct hwmon_channel_info *laptop_hwmon_info[] = {
@@ -631,6 +648,12 @@ static const struct hwmon_chip_info laptop_chip_info = {
.info = laptop_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 int laptop_kbd_led_set(struct led_classdev *led_cdev,
enum led_brightness value)
{
@@ -900,6 +923,7 @@ static int bitland_notifier_callback(struct notifier_block *nb,
static int bitland_mifs_wmi_probe(struct wmi_device *wdev, const void *context)
{
+ const struct bitland_hwmon_config *hwmon;
struct bitland_mifs_wmi_data *drv_data;
enum bitland_wmi_device_type dev_type =
(enum bitland_wmi_device_type)(unsigned long)context;
@@ -971,10 +995,11 @@ static int bitland_mifs_wmi_probe(struct wmi_device *wdev, const void *context)
}
/* Register hwmon */
+ hwmon = bitland_hwmon_config(drv_data);
drv_data->hwmon_dev = devm_hwmon_device_register_with_info(&wdev->dev,
"bitland_mifs",
drv_data,
- &laptop_chip_info,
+ hwmon->chip_info,
NULL);
if (IS_ERR(drv_data->hwmon_dev))
return PTR_ERR(drv_data->hwmon_dev);
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v4 2/4] platform/x86: bitland-mifs-wmi: Allow quirks to override the power check
2026-12-02 4:00 [PATCH v4 0/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
2026-12-02 4:01 ` [PATCH v4 1/4] platform/x86: bitland-mifs-wmi: Allow per-model hwmon configuration Bozhen Peng
@ 2026-12-02 4:02 ` Bozhen Peng
2026-12-02 4:03 ` [PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls Bozhen Peng
2026-12-02 4:04 ` [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
3 siblings, 0 replies; 7+ messages in thread
From: Bozhen Peng @ 2026-12-02 4:02 UTC (permalink / raw)
To: Ilpo Jarvinen, Mingyou Chen, Ilya Gladyshev
Cc: Hans de Goede, Armin Wolf, platform-driver-x86, linux-kernel
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@gmail.com>
---
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;
^ permalink raw reply [flat|nested] 7+ messages in thread* [PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls
2026-12-02 4:00 [PATCH v4 0/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
2026-12-02 4:01 ` [PATCH v4 1/4] platform/x86: bitland-mifs-wmi: Allow per-model hwmon configuration Bozhen Peng
2026-12-02 4:02 ` [PATCH v4 2/4] platform/x86: bitland-mifs-wmi: Allow quirks to override the power check Bozhen Peng
@ 2026-12-02 4:03 ` Bozhen Peng
2026-12-02 5:40 ` Mingyou Chen
2026-12-02 4:04 ` [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
3 siblings, 1 reply; 7+ messages in thread
From: Bozhen Peng @ 2026-12-02 4:03 UTC (permalink / raw)
To: Ilpo Jarvinen, Mingyou Chen, Ilya Gladyshev
Cc: Hans de Goede, Armin Wolf, platform-driver-x86, linux-kernel
The WUJIE15 PRO HPT does not support the GPU mode, keyboard RGB mode
or fan-boost controls. Add a quirk to hide their sysfs attributes.
Existing models keep the same attributes and permissions.
No functional change intended.
Signed-off-by: Bozhen Peng <bozhenpeng93@gmail.com>
---
drivers/platform/x86/bitland-mifs-wmi.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index 43f709714edac3d731378349f9fb5cbf6b1fc09b..9fa77e667a1a8ec7e152555fd47a56711e484095 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -108,6 +108,7 @@ struct bitland_mifs_quirks {
int (*check_performance_capability)(void);
const struct bitland_hwmon_config *hwmon;
+ bool disable_extra_controls;
bool return_code_at_end;
bool skip_ac_type_check;
};
@@ -836,7 +837,27 @@ static const struct attribute *const laptop_attrs[] = {
&dev_attr_fan_boost.attr,
NULL,
};
-ATTRIBUTE_GROUPS(laptop);
+
+static umode_t laptop_attr_is_visible(struct kobject *kobj,
+ const struct attribute *attr, int n)
+{
+ struct bitland_mifs_wmi_data *data = dev_get_drvdata(kobj_to_dev(kobj));
+
+ if (data->quirks->disable_extra_controls)
+ return 0;
+
+ return attr->mode;
+}
+
+static const struct attribute_group laptop_group = {
+ .attrs_const = laptop_attrs,
+ .is_visible_const = laptop_attr_is_visible,
+};
+
+static const struct attribute_group *laptop_groups[] = {
+ &laptop_group,
+ NULL
+};
static const struct key_entry bitland_mifs_wmi_keymap[] = {
{ KE_KEY, BI_HOTKEY_CODE(WMI_EVENT_OPEN_APP, 1, 0), { KEY_PROG1 } },
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls
2026-12-02 4:03 ` [PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls Bozhen Peng
@ 2026-12-02 5:40 ` Mingyou Chen
0 siblings, 0 replies; 7+ messages in thread
From: Mingyou Chen @ 2026-12-02 5:40 UTC (permalink / raw)
To: Bozhen Peng
Cc: Ilpo Jarvinen, Ilya Gladyshev, Hans de Goede, Armin Wolf,
platform-driver-x86, linux-kernel
On 26/12/01 08:03PM, Bozhen Peng wrote:
> The WUJIE15 PRO HPT does not support the GPU mode, keyboard RGB mode
> or fan-boost controls. Add a quirk to hide their sysfs attributes.
> Existing models keep the same attributes and permissions.
>
> No functional change intended.
>
> Signed-off-by: Bozhen Peng <bozhenpeng93@gmail.com>
> ---
> drivers/platform/x86/bitland-mifs-wmi.c | 23 ++++++++++++++++++++++-
> 1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
> index 43f709714edac3d731378349f9fb5cbf6b1fc09b..9fa77e667a1a8ec7e152555fd47a56711e484095 100644
> --- a/drivers/platform/x86/bitland-mifs-wmi.c
> +++ b/drivers/platform/x86/bitland-mifs-wmi.c
> @@ -108,6 +108,7 @@ struct bitland_mifs_quirks {
> int (*check_performance_capability)(void);
> const struct bitland_hwmon_config *hwmon;
>
> + bool disable_extra_controls;
I'd suggest adding bitflags like the uniwill driver.
Then we can control what sysfs attrs to enable with the bitflag.
> bool return_code_at_end;
> bool skip_ac_type_check;
> };
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT
2026-12-02 4:00 [PATCH v4 0/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
` (2 preceding siblings ...)
2026-12-02 4:03 ` [PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls Bozhen Peng
@ 2026-12-02 4:04 ` Bozhen Peng
2026-12-02 5:33 ` Mingyou Chen
3 siblings, 1 reply; 7+ messages in thread
From: Bozhen Peng @ 2026-12-02 4:04 UTC (permalink / raw)
To: Ilpo Jarvinen, Mingyou Chen, Ilya Gladyshev
Cc: Hans de Goede, Armin Wolf, platform-driver-x86, linux-kernel
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@gmail.com>
---
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)
{
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT
2026-12-02 4:04 ` [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
@ 2026-12-02 5:33 ` Mingyou Chen
0 siblings, 0 replies; 7+ messages in thread
From: Mingyou Chen @ 2026-12-02 5:33 UTC (permalink / raw)
To: Bozhen Peng
Cc: Ilpo Jarvinen, Ilya Gladyshev, Hans de Goede, Armin Wolf,
platform-driver-x86, linux-kernel
On 26/12/01 08:04PM, Bozhen Peng wrote:
> 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.
I don't agree with this method, here's why:
I think this is just a temporary workaround, it doesn't solve the actual
stale state problem in the power_supply subsystem.
Is there a reason this can't be fixed in the underlying USB-C driver's
resume path instead (likely under drivers/usb/typec/ucsi/)?
>
> 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@gmail.com>
> ---
> 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)
> {
^ permalink raw reply [flat|nested] 7+ messages in thread