[PATCH 3/3] platform/x86: uniwill-laptop: Notify userspace about Fn and super key lock changes

From: Farhan via B4 Relay

Date: Sat Dec 05 2026 - 03:11:00 EST


From: Farhan <khan.10.0412@xxxxxxxxx>

Userspace (for example an on-screen display) can poll fn_lock and
super_key_enable to follow the lock states, but only Fn lock changes made
with the Fn lock key are currently signalled.

Writing fn_lock does not cause the EC to send an event, so notify from
the store function as well. The EC does send events when the super key
lock changes, both from the keyboard and through super_key_enable, so
notify super_key_enable when one of them arrives instead of passing it to
the (ignoring) keymap.

Document that both files can be polled.

Assisted-by: LLM
Signed-off-by: Farhan <khan.10.0412@xxxxxxxxx>
---
Documentation/ABI/testing/sysfs-driver-uniwill-laptop | 6 ++++++
drivers/platform/x86/uniwill/uniwill-acpi.c | 12 ++++++++++++
2 files changed, 18 insertions(+)

diff --git a/Documentation/ABI/testing/sysfs-driver-uniwill-laptop b/Documentation/ABI/testing/sysfs-driver-uniwill-laptop
index 5f7eccb2d..e9bc275ea 100644
--- a/Documentation/ABI/testing/sysfs-driver-uniwill-laptop
+++ b/Documentation/ABI/testing/sysfs-driver-uniwill-laptop
@@ -8,6 +8,9 @@ Description:

Reading this file returns the current enable status of the FN lock functionality.

+ The file can be polled for changes, including those made with the
+ Fn lock key.
+
What: /sys/bus/platform/devices/INOU0000:XX/super_key_enable
Date: November 2025
KernelVersion: 6.19
@@ -18,6 +21,9 @@ Description:

Reading this file returns the current enable status of the super key.

+ The file can be polled for changes, including those made with the
+ super key lock key.
+
What: /sys/bus/platform/devices/INOU0000:XX/touchpad_toggle_enable
Date: November 2025
KernelVersion: 6.19
diff --git a/drivers/platform/x86/uniwill/uniwill-acpi.c b/drivers/platform/x86/uniwill/uniwill-acpi.c
index 18190a8a8..a0f4f5b5a 100644
--- a/drivers/platform/x86/uniwill/uniwill-acpi.c
+++ b/drivers/platform/x86/uniwill/uniwill-acpi.c
@@ -762,6 +762,9 @@ static ssize_t fn_lock_store(struct device *dev, const struct device_attribute *
if (ret < 0)
return ret;

+ /* Unlike Fn+Esc, this does not cause the EC to send an event */
+ sysfs_notify(&dev->kobj, NULL, "fn_lock");
+
return count;
}

@@ -2330,6 +2333,15 @@ static int uniwill_notifier_call(struct notifier_block *nb, unsigned long action

sysfs_notify(&data->dev->kobj, NULL, "fn_lock");

+ return NOTIFY_OK;
+ case UNIWILL_OSD_SUPER_KEY_DISABLE:
+ case UNIWILL_OSD_SUPER_KEY_ENABLE:
+ case UNIWILL_OSD_SUPER_KEY_STATE_CHANGED:
+ if (!uniwill_device_supports(data, UNIWILL_FEATURE_SUPER_KEY))
+ return NOTIFY_DONE;
+
+ sysfs_notify(&data->dev->kobj, NULL, "super_key_enable");
+
return NOTIFY_OK;
case UNIWILL_OSD_KB_LED_LEVEL0:
if (!uniwill_device_supports(data, UNIWILL_FEATURE_KEYBOARD_BACKLIGHT))

--
2.53.0