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

From: bartu alev

Date: Mon Nov 16 2026 - 19:07:54 EST


On 11/17/26 2:53 AM, Denis Benato wrote:

> 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.

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:`)

Then only kbd_rgb_read_status() maps -ENODATA -> -ENODEV so FX505DT /
0-returning firmware matches the ABI without altering setter or legacy
buffer semantics.