From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796458251; b=WZCOvFT6PXp/KI1oXdS60uvtm9phqQsW0jRLK07meqmfyQQTk9COekpjh+fcunt4J6jr nHMFSZ6fFGhoiz3KJApST+bcCmLY19DOjiowo27sssR0mh1Qc61uTis/Y8YsIoVP0mbeI JAo5XccNRhBK7uNdCgHktBlQY9LePGzdpchsclApqY5aoQXMBdCGXVuC5UBG2jnMrWzOF /MAEUdq6bXr68J8jBWY/V6eiRSCZ89QCuKZ67RGjgRa6qRVGVoMyGGKgvodYkRBvQS9iD ph9yh8/X/QkZOBzEhhvTZlpyfe/K2wiGTMNefZzQj6lrEAmMNw+JCbksMMLaz5TG7Xg== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796458251; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=sgm1Zr2Cv4AwRTgTfFEgSo9Sv8t8/r5KDcluUm+e1Cw=; b=OeZPZRsXmnR9tEC7/8FkeEDjEUl1aidIST+LhOx6MMkhppr2jMPB6mLwqzoxmZRXhetU 6BoZRgLFpjxkPFgsZgUvF1phnxc37dAMP6J07URYDQU58ll6Ud5jEI0XLZ+moGTqbVZ14 5v2I4OeQUqSFmcla1FG+WmXeGP8taaYmemGWyFOLxtuJTTsqtuyJ7gumKsjl8XBuZ9GwY 1TtGDUpnzYbptNRFeUnGqdmtU9K9EK2cKVoMmJZxLyNr9R5urFdYHmnbWlG10ZsogJtZb +coIjgbjqGrlrDVYMd4PKTC0NwBwWrjd4dkoND21ek8SDjKk8B3F1KDrPSzEqOxLJWg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MasxfPmF; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB3F5606A336; Sat, 5 Dec 2026 08:10:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MasxfPmF Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1796458251; b=yCaW5zHTpXkNsCBwTDdsIWL2ESXy+g8iUX8FPiiF5uvGpolE1XGYj+Eqs1VqGFJ/7yfM oAFpkpJVmzKkAnx6Na2tppcfxjxeR7z1VgtyjG9yjWzIJW/fxHKRG/erAK/d0atiHzIyV AUXuEXogzGQck1tpIKWMW9xxA4o//ad9D/trEFSmCxo/c6uxbrjia0DKh1A17awR9aOGc XC/xEjqQfR+bNOoD240fkO9/SPEMNkoA2n8MlQKaMjdYsOP6EFFeF5B/+sCjvzBIurNIU JxlHkElvWGyYru4lWsYoLXTxaEzhfce5r35Tr7i1q+HgxFF7D0SH0t2im+wk6P5pvqQ== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1796458251; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=sgm1Zr2Cv4AwRTgTfFEgSo9Sv8t8/r5KDcluUm+e1Cw=; b=S4IBYpxdfdPSy8R425YT+623JO3a2OCoIKxJ9pIGtoUZMxgFKXmc9WjiTbDaWT8UBXTN qx1ej8ek6rd1hH2xoiGwZ8RaItArzM1G6VzmvQQE8FdaxF4vxcwIuAGlm5OZ9hmL34GRp kSYiUkOdI8KXT8FtS03Iez9aLZBngBVgHaRLqmUzJkUAIiVUh8Y1jyPqlEmtO4lyhIVwC fTlTE/hjqckBgOpITw1CLT9BjIgC+AltC8brnbzYm/jtHIBxPBxy/VfqGaIBWAi/VUaGI wQqB63Hw2aJg7ppiLlxMTPX+mvI80vnzy3fCnqM+6qPgVbTAnIUJM00V5YHTci/XovA== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 196311F00A11; Sat, 5 Dec 2026 08:10:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796458251; bh=sgm1Zr2Cv4AwRTgTfFEgSo9Sv8t8/r5KDcluUm+e1Cw=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=MasxfPmF24CoyzZ6Qgcoghj2I8ETzNO37TcQoq2kukW7gNyflM+uLohSvw3fPUMeh Cpz/DYell0I4gi4NkXxinVVj8zejgkejW86/X+olZL7wODUODVc2gRcF9GafMRVp6R /fjDA+48dcONL1251OwDK7crGFbBbEDDlCU2Xp99zoE/YCMXCE59Edti09yxuAFI28 zDN8huT/M/Jn11B84bdE51SJeFUQxKDF17TRTJ+43QpJ4AIh78l/gEXchq/9x3l/Pr QxOc6DZUb01AqhkHsMNfg6u/f1Kfaz+IwNGRmYgurGrjzU2ZUNZ7+Bvhvo5lz84V60 L4wOrDEUIapkQ== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 94E305022D; Sat, 5 Dec 2026 08:10:50 +0000 (UTC) From: Farhan via B4 Relay Date: Sat, 05 Dec 2026 13:10:51 +0500 Subject: [PATCH 3/3] platform/x86: uniwill-laptop: Notify userspace about Fn and super key lock changes X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261205-rp15-v1-3-ae8475100ed4@gmail.com> References: <20261205-rp15-v1-0-ae8475100ed4@gmail.com> In-Reply-To: <20261205-rp15-v1-0-ae8475100ed4@gmail.com> To: Armin Wolf , Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Farhan X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1796458248; l=2862; i=khan.10.0412@gmail.com; s=20261015; h=from:subject:message-id; bh=JxE2JexpMMI4eNBE4izpj3LT9efFceHeLvkZ0lnDFzk=; b=xwU2mzRuwAMipuYhHMMZojJDPgbBuBU3zcv8U47WrHPji8TFM2uFthaB99sUdwKwsbrRDVJl1 uzHcINC0MvICBVmqYNxlq+wI6bE86fuP9QwNNUncs3Gj5LeM3ecJiKc X-Developer-Key: i=khan.10.0412@gmail.com; a=ed25519; pk=RYXGxEnc8JS0U9o2+L5ep74H0QzCy/meWJdVhjgwcQE= X-Endpoint-Received: by B4 Relay for khan.10.0412@gmail.com/20261015 with auth_id=1749 X-Original-From: Farhan Reply-To: khan.10.0412@gmail.com Content-Transfer-Encoding: 7bit From: Farhan 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 --- 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