mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Farhan via B4 Relay <devnull+khan.10.0412.gmail.com@kernel.org>
To: "Armin Wolf" <W_Armin@gmx.de>, "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,  Farhan <khan.10.0412@gmail.com>
Subject: [PATCH 3/3] platform/x86: uniwill-laptop: Notify userspace about Fn and super key lock changes
Date: Sat, 05 Dec 2026 13:10:51 +0500	[thread overview]
Message-ID: <20261205-rp15-v1-3-ae8475100ed4@gmail.com> (raw)
In-Reply-To: <20261205-rp15-v1-0-ae8475100ed4@gmail.com>

From: Farhan <khan.10.0412@gmail.com>

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@gmail.com>
---
 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



      parent reply	other threads:[~2026-12-05  8:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-05  8:10 [PATCH 0/3] platform/x86: uniwill-laptop: Support the Eluktronics RP-15 Farhan via B4 Relay
2026-12-05  8:10 ` [PATCH 1/3] platform/x86: uniwill-laptop: Optionally apply keyboard backlight levels Farhan via B4 Relay
2026-12-05  8:10 ` [PATCH 2/3] platform/x86: uniwill-laptop: Add support for the Eluktronics RP-15 Farhan via B4 Relay
2026-12-05  8:10 ` Farhan via B4 Relay [this message]

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=20261205-rp15-v1-3-ae8475100ed4@gmail.com \
    --to=devnull+khan.10.0412.gmail.com@kernel.org \
    --cc=W_Armin@gmx.de \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=khan.10.0412@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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®