Re: [PATCH v4 1/2] platform/x86: asus-wmi: add TUF keyboard RGB readback support

From
Denis Benato <denis.benato@linux.dev>
Date
2026-11-17 02:24:29
Also in
lkml, platform-driver-x86
Reply to
bartu alev, 2026-11-17
On 11/17/26 01:07, bartu alev wrote:
On 11/17/26 2:53 AM, Denis Benato wrote:
quoted
Yes, it's absolutely reasonable. If the return either doesn't have the
presence bit set or is 0xFFF..... it is to be counted as "not implemented".

And also yes, we should respect ABIs whenever possible...

However... now that I think about it asus_wmi_evaluate_method_buf() can
be used on setters and those don't have the presence bit, do we have that
covered?
yes that wont break setters:

1. asus_wmi_evaluate_method_buf() is strictly a buffer-getter helper (its
   comment states it returns an error whenever the ACPI output is not a
   buffer).  Integer-returning DEVS setters use
asus_wmi_evaluate_method*() /
   asus_wmi_set_devstate() instead; even today, passing an integer `1`
   from DEVS through _buf() returns 1 as an error.
Yeah I checked: only one caller. Make it check for known -ENODEV:
0xff...fe.

The only reference (as far as I can tell) to ~0 being "absent" is this:
absent=(l==0xffffffff);
inside asus_rfkill_hotplug, maybe you can exclude checking for that,
albeit it's not going to harm.

Perhaps add proper kernel-doc to that function where possible
errors are documented as well as input parameters.
2. We wouldn't check ASUS_WMI_DSTS_PRESENCE_BIT in _buf() at all.  A
   buffer-returning call (getter or setter) still hits `case
   ACPI_TYPE_BUFFER` and returns 0 unchanged.  Only `case ACPI_TYPE_INTEGER`
   changes to decode via `u32 retval`:
   - 0xfffffffe or (u32)~0 (0xffffffff) -> -ENODEV
   - 0 or any other integer               -> -ENODATA (matching `default:`)
Sorry I am a bit spoiled by the past work of Marco where he reorganized
the whole thing.

We should really revive that, but it's a long work that touches quite a bit of
very old code...
Then only kbd_rgb_read_status() maps -ENODATA -> -ENODEV so FX505DT /
0-returning firmware matches the ABI without altering setter or legacy
buffer semantics.
Good. Very good.
Thread (10 messages) 10 messages, 3 authors, last reply 1d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help