The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Marcus Grenängen" <marcus@grenangen.se>
To: platform-driver-x86@vger.kernel.org, denis.benato@linux.dev
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	luke@ljones.dev, hansg@kernel.org, ilpo.jarvinen@linux.intel.com,
	jikos@kernel.org, bentiss@kernel.org, corentin.chary@gmail.com,
	marcus@grenangen.se
Subject: [PATCH v3 0/3] platform/x86: fix fn-lock on ASUS ProArt P16 (WMI DEVS no-op)
Date: Thu,  7 May 2026 11:29:08 +0200	[thread overview]
Message-ID: <20260507092911.8855-1-marcus@grenangen.se> (raw)
In-Reply-To: <9b568ce0-93f7-4a7f-98e4-625e910f8a1d@linux.dev>

Changes since v2 (addressing Denis's and Randy's review):

Patch 1 (HID: asus):
 - Renamed asus_hid_fnlock_notify() to asus_hid_fnlock_set() (Denis)
 - Replaced "if (ret > 0) ret = 0" with "if (ret < 0) return ret; return 0;"
   pattern (Denis)
 - Fixed Returns tag format to "Returns:" (Randy)
 - Added #if IS_REACHABLE(CONFIG_HID_ASUS) guard for asus_hid_fnlock_set()
   declaration in asus-wmi.h so asus-wmi.c can call it without a missing
   prototype warning

Patch 2 (asus-nb-wmi):
 - Added asus_wmi_fnlock_use_hid() export so asus-armoury can query the
   quirk flag without reading the quirk struct directly, keeping DMI and
   quirk knowledge inside asus-wmi (Denis)
 - Fixed Returns tag format to "Returns:" (Randy)

Patch 3 (asus-armoury):
 - Replaced the stored fnlock_use_hid flag and dmi_match() call with
   asus_wmi_fnlock_use_hid(), routing the DMI/quirk check through asus-wmi
   as Denis suggested
 - Added fn_lock_registered bool to properly guard sysfs_remove_group in
   both the error unwind path and __exit, mirroring the gpu_mux/mini_led
   pattern (Denis)
 - NOTE/Question: Since we have proper fn+esc hardware key handling working 
   now we could eliminate this patch completely if we don't care about 
   being able to control the fn state from user space 
   eg. asusctl and/or rog control center?
   The nice thing of having it controllable via asusctl is the
   scripting possibilibilities like setting prefered mode when 
   starting a DE as one example.

Regarding the if/else dispatch in fn_lock_current_value_store: Denis
suggested routing everything through a single asus_wmi_fnlock_set()
exported from asus-wmi. This was implemented but had to be reverted: it
introduced a module dependency cycle (hid_asus -> asus_wmi -> hid_asus)
that depmod detects and rejects. asus-armoury therefore retains the
if/else, calling asus_hid_fnlock_set() on HID-path platforms and
armoury_set_devstate() on WMI-path platforms. The asus-armoury -> hid-asus
dependency is a soft one (the stub in asus-wmi.h returns -ENODEV when
CONFIG_HID_ASUS is not reachable). But since I'm new to this maybe I'm 
missing something critical here?

Marcus Grenängen (3):
  HID: asus: export asus_hid_fnlock_set() for direct fn-lock control
  platform/x86: asus-nb-wmi: add fnlock_use_hid quirk and asus_wmi_fnlock_use_hid()
  platform/x86: asus-armoury: add fn_lock firmware attribute

 drivers/hid/hid-asus.c                     | 44 ++++++++++++++++++-
 drivers/platform/x86/asus-armoury.c        | 70 ++++++++++++++++++++++++++++++
 drivers/platform/x86/asus-nb-wmi.c         | 13 ++++++
 drivers/platform/x86/asus-wmi.c            | 22 ++++++++++
 drivers/platform/x86/asus-wmi.h            |  5 +++
 include/linux/platform_data/x86/asus-wmi.h | 15 +++++++
 6 files changed, 168 insertions(+), 1 deletion(-)

-- 
2.54.0

  reply	other threads:[~2026-05-07  9:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <458d9e6c-8702-4cbc-9c4f-33cbd1175e67@linux.dev>
2026-05-06 19:33 ` [PATCH v2 0/3] platform/x86: fix fn-lock on ASUS ProArt P16 (WMI DEVS no-op) Marcus Grenängen
2026-05-06 19:33   ` [PATCH v2 1/3] HID: asus: export asus_hid_fnlock_notify() for direct fn-lock control Marcus Grenängen
2026-05-06 22:00     ` Randy Dunlap
2026-05-06 22:17     ` Denis Benato
2026-05-07  9:29       ` Marcus Grenängen [this message]
2026-05-07  9:29         ` [PATCH v3 1/3] HID: asus: export asus_hid_fnlock_set() " Marcus Grenängen
2026-05-07  9:29         ` [PATCH v3 2/3] platform/x86: asus-nb-wmi: add fnlock_use_hid quirk and asus_wmi_fnlock_use_hid() Marcus Grenängen
2026-05-07  9:29         ` [PATCH v3 3/3] platform/x86: asus-armoury: add fn_lock firmware attribute Marcus Grenängen
2026-05-06 19:33   ` [PATCH v2 2/3] platform/x86: asus-nb-wmi: add fnlock_use_hid quirk for ProArt P16 Marcus Grenängen
2026-05-06 19:33   ` [PATCH v2 3/3] platform/x86: asus-armoury: add fn_lock firmware attribute Marcus Grenängen
2026-05-06 22:10     ` Denis Benato

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=20260507092911.8855-1-marcus@grenangen.se \
    --to=marcus@grenangen.se \
    --cc=bentiss@kernel.org \
    --cc=corentin.chary@gmail.com \
    --cc=denis.benato@linux.dev \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --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