mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: Sercan GOKMEN <gokmensercan@gmail.com>
Cc: Corentin Chary <corentin.chary@gmail.com>,
	 "Luke D. Jones" <luke@ljones.dev>,
	Denis Benato <denis.benato@linux.dev>,
	 Hans de Goede <hansg@kernel.org>,
	Moad Tarrih <tarrihmoad@proton.me>,
	 Burak Goncu <burakgon12@gmail.com>,
	platform-driver-x86@vger.kernel.org,
	 LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3] platform/asus: asus-wmi: Skip keyboard backlight read-back on B9406CAA
Date: Thu, 26 Nov 2026 01:48:15 +0200 (EET)	[thread overview]
Message-ID: <f5b550c4-e20a-c1e8-5f9a-0fabe0e2803f@linux.intel.com> (raw)
In-Reply-To: <20261123-b4-asus-wmi-b9406caa-kbd-readback-v3-1-1e6875af3703@gmail.com>

On Mon, 23 Nov 2026, Sercan GOKMEN wrote:

> On the ASUS ExpertBook Ultra B9406CAA (BIOS 312), DSTS(0x00050021)
> always returns 0x550000: the presence bit is set and the level is 0,
> whatever level the EC is driving. The DSDT builds this reply from
> constants and never reads the EC. Writes work.
> 
> kbd_led_get() stores every read in asus->kbd_led_wk, so each sysfs read
> resets the cached level to 0. sysfs, UPower and brightnessctl then
> report 0, systemd-backlight restores a dark keyboard at boot, and the
> next Fn backlight key press always gives level 1.
> 
> Add a kbd_led_no_readback quirk that makes kbd_led_get() return the
> cached level, as the !kbd_led_avail path already does, and set it for
> this board. Every path that changes the level keeps kbd_led_wk current.
> Until the first write after probe, the driver still reports the 0 it
> read at probe time.
> 
> Signed-off-by: Sercan GOKMEN <gokmensercan@gmail.com>
> ---
> Tested on the B9406CAA (BIOS 312) on Linux 7.2.3: brightness reads back
> the level written to it, UPower reports the same value, and the Fn
> backlight key steps 2 -> 3 -> 0 -> 1 from level 2. On 7.3.0 and 7.3.5,
> with the same change built as a DKMS module, writes of 3/1/0/2 read back
> unchanged.
> Build-tested on review-ilpo-next (2268d837dea1) with W=1 (clang).
> 
> This conflicts trivially with Moad Tarrih's G814FP patch, which adds a
> quirk_entry field and a DMI entry at the same places:
> https://lore.kernel.org/r/20261116-asus-wmi-kbd-readback-v5-1-f2f170836bf4@proton.me
> Applied after it, only asus-nb-wmi.c needs the two entries merged.

Hi,

I applied to other patch to the review-ilpo-next branch (will eventually 
propagate into for-next once LKP's build test given green light).

The naming seems different, so can you please do v4 on top of the 
review-ilpo-next branch.

--
 i.

> The patch was prepared with the help of an AI coding assistant (Claude
> Code). I reviewed it and tested it on the hardware.
> ---
> Changes in v3:
> - Rebase onto review-ilpo-next, after the move to drivers/platform/asus/,
>   and use the platform/asus prefix.
> - Trim the commit message.
> - Drop the comment on the quirk_entry field and shorten the one on the
>   quirk.
> - Link to v2: https://patch.msgid.link/20261030-b4-asus-wmi-b9406caa-kbd-readback-v2-1-ca93bb9039f6@gmail.com
> 
> Changes in v2:
> - Shorten the subject (Burak Goncu).
> - Say that kbd_led_wk keeps the 0 read at probe until the first write
>   (Burak Goncu).
> - Move the test details below the cut (Burak Goncu).
> - Rebase on current for-next.
> - Link to v1: https://patch.msgid.link/20261022-b4-asus-wmi-b9406caa-kbd-readback-v1-1-fb33ed98dd16@gmail.com
> ---
>  drivers/platform/asus/asus-nb-wmi.c | 15 +++++++++++++++
>  drivers/platform/asus/asus-wmi.c    |  3 ++-
>  drivers/platform/asus/asus-wmi.h    |  1 +
>  3 files changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/asus/asus-nb-wmi.c b/drivers/platform/asus/asus-nb-wmi.c
> index 3b0f3346dc..420fdced34 100644
> --- a/drivers/platform/asus/asus-nb-wmi.c
> +++ b/drivers/platform/asus/asus-nb-wmi.c
> @@ -93,6 +93,12 @@ static struct quirk_entry quirk_asus_unknown = {
>  	.wmi_backlight_set_devstate = true,
>  };
>  
> +/* B9406CAA: DSTS(0x00050021) always reports level 0 */
> +static struct quirk_entry quirk_asus_b9406caa = {
> +	.wmi_backlight_set_devstate = true,
> +	.kbd_led_no_readback = true,
> +};
> +
>  static struct quirk_entry quirk_asus_q500a = {
>  	.filter_i8042_e1_extended_codes = true,
>  	.wmi_backlight_set_devstate = true,
> @@ -167,6 +173,15 @@ static int dmi_matched(const struct dmi_system_id *dmi)
>  }
>  
>  static const struct dmi_system_id asus_quirks[] = {
> +	{
> +		.callback = dmi_matched,
> +		.ident = "ASUS ExpertBook Ultra B9406CAA",
> +		.matches = {
> +			DMI_MATCH(DMI_SYS_VENDOR, "ASUS"),
> +			DMI_MATCH(DMI_BOARD_NAME, "B9406CAA"),
> +		},
> +		.driver_data = &quirk_asus_b9406caa,
> +	},
>  	{
>  		.callback = dmi_matched,
>  		.ident = "ASUSTeK COMPUTER INC. Q500A",
> diff --git a/drivers/platform/asus/asus-wmi.c b/drivers/platform/asus/asus-wmi.c
> index b33ebdb21a..725f827a17 100644
> --- a/drivers/platform/asus/asus-wmi.c
> +++ b/drivers/platform/asus/asus-wmi.c
> @@ -1975,7 +1975,8 @@ static enum led_brightness kbd_led_get(struct led_classdev *led_cdev)
>  	asus = container_of(led_cdev, struct asus_wmi, kbd_led);
>  
>  	scoped_guard(spinlock_irqsave, &asus_ref.lock) {
> -		if (!asus->kbd_led_avail)
> +		if (!asus->kbd_led_avail ||
> +		    asus->driver->quirks->kbd_led_no_readback)
>  			return asus->kbd_led_wk;
>  	}
>  
> diff --git a/drivers/platform/asus/asus-wmi.h b/drivers/platform/asus/asus-wmi.h
> index b45f81b38a..72a43586ff 100644
> --- a/drivers/platform/asus/asus-wmi.h
> +++ b/drivers/platform/asus/asus-wmi.h
> @@ -52,6 +52,7 @@ struct quirk_entry {
>  	 */
>  	int no_display_toggle;
>  	u32 xusb2pr;
> +	bool kbd_led_no_readback;
>  };
>  
>  struct asus_wmi_driver {
> 
> ---
> base-commit: 2268d837dea13a78639fa3dad60472bb67478709
> change-id: 20261022-b4-asus-wmi-b9406caa-kbd-readback-aed82953d839
> 
> Best regards,
> --  
> Sercan GOKMEN <gokmensercan@gmail.com>
> 


      reply	other threads:[~2026-11-25 23:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23  9:42 Sercan GOKMEN
2026-11-25 23:48 ` Ilpo Järvinen [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=f5b550c4-e20a-c1e8-5f9a-0fabe0e2803f@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=burakgon12@gmail.com \
    --cc=corentin.chary@gmail.com \
    --cc=denis.benato@linux.dev \
    --cc=gokmensercan@gmail.com \
    --cc=hansg@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=tarrihmoad@proton.me \
    /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®