[PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls

From: Bozhen Peng

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


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@xxxxxxxxx>
---
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 } },