From: Bozhen Peng <bozhenpeng93@gmail.com>
To: Ilpo Jarvinen <ilpo.jarvinen@linux.intel.com>,
Mingyou Chen <qby140326@gmail.com>,
Ilya Gladyshev <ilya.gladyshev@linux.dev>
Cc: Hans de Goede <hansg@kernel.org>, Armin Wolf <W_Armin@gmx.de>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 3/4] platform/x86: bitland-mifs-wmi: Add a quirk to hide extra controls
Date: Tue, 1 Dec 2026 20:03:14 -0800 [thread overview]
Message-ID: <e4264510-501c-4d27-a60a-f37b5e23f3d7@gmail.com> (raw)
In-Reply-To: <90c6fa9e-6f3a-4618-af97-e39d8daf18ed@gmail.com>
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 } },
next prev parent reply other threads:[~2026-12-02 4:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2026-12-02 4:04 ` [PATCH v4 4/4] platform/x86: bitland-mifs-wmi: Support WUJIE15 PRO HPT Bozhen Peng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=e4264510-501c-4d27-a60a-f37b5e23f3d7@gmail.com \
--to=bozhenpeng93@gmail.com \
--cc=W_Armin@gmx.de \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=ilya.gladyshev@linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=qby140326@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®