* [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & kbd backlight not remembered among boots
@ 2025-07-07 16:38 Rong Zhang
2025-07-07 16:38 ` [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock " Rong Zhang
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Rong Zhang @ 2025-07-07 16:38 UTC (permalink / raw)
To: Ike Panhc, Hans de Goede, Ilpo Järvinen
Cc: Rong Zhang, platform-driver-x86, linux-kernel, Gergo Koteles,
Barnabás Pőcze
I had disabled ideapad-laptop for a long time until a critical bug was
fixed[1], and I soon noticed some behavior changes after reenabling
ideapad-laptop.
The behavior changes are about FnLock and keyboard backlight. The HW/FW
can remember their states among boots[2]. After enabling ideapad-laptop,
I noticed that their states were always reset to off after a reboot or a
power cycle.
Historically, FnLock was only exposed under the VPC2004 sysfs node, and
its state was remembered well. Things have changed since the
introduction of its LED class device. As a side effect of the LED class
device unregistering sequence, it is always turned off while shutting
down, making the HW/FW feature meaningless.
The story is similar but a bit different for keyboard backlight. Since
the first introduction of support for it, it has suffered from the same
issue.
Fix the issue by setting LED_RETAIN_AT_SHUTDOWN on their LED class
devices so that their states get remembered, which also aligns with the
behavior of manufacturer utilities on Windows.
[1]: commit 5808c3421695 ("platform/x86: ideapad-laptop: use
usleep_range() for EC polling")
[2]: For FnLock, most (if not all) models should support this; for
keyboard backlight, at least some recent models support this (I am not
sure about old models).
Rong Zhang (2):
platform/x86: ideapad-laptop: Fix FnLock not remembered among boots
platform/x86: ideapad-laptop: Fix kbd backlight not remembered among
boots
drivers/platform/x86/ideapad-laptop.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
base-commit: d7b8f8e20813f0179d8ef519541a3527e7661d3a
--
2.50.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock not remembered among boots
2025-07-07 16:38 [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & kbd backlight not remembered among boots Rong Zhang
@ 2025-07-07 16:38 ` Rong Zhang
2025-07-07 17:23 ` Hans de Goede
2025-07-07 16:38 ` [PATCH 2/2] platform/x86: ideapad-laptop: Fix kbd backlight " Rong Zhang
2025-07-08 10:24 ` [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & " Ilpo Järvinen
2 siblings, 1 reply; 6+ messages in thread
From: Rong Zhang @ 2025-07-07 16:38 UTC (permalink / raw)
To: Ike Panhc, Hans de Goede, Ilpo Järvinen
Cc: Rong Zhang, platform-driver-x86, linux-kernel, Gergo Koteles,
Barnabás Pőcze, stable
On devices supported by ideapad-laptop, the HW/FW can remember the
FnLock state among boots. However, since the introduction of the FnLock
LED class device, it is turned off while shutting down, as a side effect
of the LED class device unregistering sequence.
Many users always turn on FnLock because they use function keys much
more frequently than multimedia keys. The behavior change is
inconvenient for them. Thus, set LED_RETAIN_AT_SHUTDOWN on the LED class
device so that the FnLock state gets remembered, which also aligns with
the behavior of manufacturer utilities on Windows.
Fixes: 07f48f668fac ("platform/x86: ideapad-laptop: add FnLock LED class device")
Cc: stable@vger.kernel.org
Signed-off-by: Rong Zhang <i@rong.moe>
---
drivers/platform/x86/ideapad-laptop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index b5e4da6a6779..62a72b09fc3a 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1728,7 +1728,7 @@ static int ideapad_fn_lock_led_init(struct ideapad_private *priv)
priv->fn_lock.led.name = "platform::" LED_FUNCTION_FNLOCK;
priv->fn_lock.led.brightness_get = ideapad_fn_lock_led_cdev_get;
priv->fn_lock.led.brightness_set_blocking = ideapad_fn_lock_led_cdev_set;
- priv->fn_lock.led.flags = LED_BRIGHT_HW_CHANGED;
+ priv->fn_lock.led.flags = LED_BRIGHT_HW_CHANGED | LED_RETAIN_AT_SHUTDOWN;
err = led_classdev_register(&priv->platform_device->dev, &priv->fn_lock.led);
if (err)
--
2.50.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] platform/x86: ideapad-laptop: Fix kbd backlight not remembered among boots
2025-07-07 16:38 [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & kbd backlight not remembered among boots Rong Zhang
2025-07-07 16:38 ` [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock " Rong Zhang
@ 2025-07-07 16:38 ` Rong Zhang
2025-07-07 17:24 ` Hans de Goede
2025-07-08 10:24 ` [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & " Ilpo Järvinen
2 siblings, 1 reply; 6+ messages in thread
From: Rong Zhang @ 2025-07-07 16:38 UTC (permalink / raw)
To: Ike Panhc, Hans de Goede, Ilpo Järvinen
Cc: Rong Zhang, platform-driver-x86, linux-kernel, Gergo Koteles,
Barnabás Pőcze, stable
On some models supported by ideapad-laptop, the HW/FW can remember the
state of keyboard backlight among boots. However, it is always turned
off while shutting down, as a side effect of the LED class device
unregistering sequence.
This is inconvenient for users who always prefer turning on the
keyboard backlight. Thus, set LED_RETAIN_AT_SHUTDOWN on the LED class
device so that the state of keyboard backlight gets remembered, which
also aligns with the behavior of manufacturer utilities on Windows.
Fixes: 503325f84bc0 ("platform/x86: ideapad-laptop: add keyboard backlight control support")
Cc: stable@vger.kernel.org
Signed-off-by: Rong Zhang <i@rong.moe>
---
drivers/platform/x86/ideapad-laptop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 62a72b09fc3a..edb9d2fb02ec 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -1669,7 +1669,7 @@ static int ideapad_kbd_bl_init(struct ideapad_private *priv)
priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT;
priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get;
priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set;
- priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED;
+ priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED | LED_RETAIN_AT_SHUTDOWN;
err = led_classdev_register(&priv->platform_device->dev, &priv->kbd_bl.led);
if (err)
--
2.50.0
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock not remembered among boots
2025-07-07 16:38 ` [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock " Rong Zhang
@ 2025-07-07 17:23 ` Hans de Goede
0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2025-07-07 17:23 UTC (permalink / raw)
To: Rong Zhang, Ike Panhc, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Gergo Koteles,
Barnabás Pőcze, stable
Hi,
On 7-Jul-25 6:38 PM, Rong Zhang wrote:
> On devices supported by ideapad-laptop, the HW/FW can remember the
> FnLock state among boots. However, since the introduction of the FnLock
> LED class device, it is turned off while shutting down, as a side effect
> of the LED class device unregistering sequence.
>
> Many users always turn on FnLock because they use function keys much
> more frequently than multimedia keys. The behavior change is
> inconvenient for them. Thus, set LED_RETAIN_AT_SHUTDOWN on the LED class
> device so that the FnLock state gets remembered, which also aligns with
> the behavior of manufacturer utilities on Windows.
>
> Fixes: 07f48f668fac ("platform/x86: ideapad-laptop: add FnLock LED class device")
> Cc: stable@vger.kernel.org
> Signed-off-by: Rong Zhang <i@rong.moe>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hansg@kernel.org>
Regards,
Hans
> ---
> drivers/platform/x86/ideapad-laptop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index b5e4da6a6779..62a72b09fc3a 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1728,7 +1728,7 @@ static int ideapad_fn_lock_led_init(struct ideapad_private *priv)
> priv->fn_lock.led.name = "platform::" LED_FUNCTION_FNLOCK;
> priv->fn_lock.led.brightness_get = ideapad_fn_lock_led_cdev_get;
> priv->fn_lock.led.brightness_set_blocking = ideapad_fn_lock_led_cdev_set;
> - priv->fn_lock.led.flags = LED_BRIGHT_HW_CHANGED;
> + priv->fn_lock.led.flags = LED_BRIGHT_HW_CHANGED | LED_RETAIN_AT_SHUTDOWN;
>
> err = led_classdev_register(&priv->platform_device->dev, &priv->fn_lock.led);
> if (err)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 2/2] platform/x86: ideapad-laptop: Fix kbd backlight not remembered among boots
2025-07-07 16:38 ` [PATCH 2/2] platform/x86: ideapad-laptop: Fix kbd backlight " Rong Zhang
@ 2025-07-07 17:24 ` Hans de Goede
0 siblings, 0 replies; 6+ messages in thread
From: Hans de Goede @ 2025-07-07 17:24 UTC (permalink / raw)
To: Rong Zhang, Ike Panhc, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Gergo Koteles,
Barnabás Pőcze, stable
Hi,
On 7-Jul-25 6:38 PM, Rong Zhang wrote:
> On some models supported by ideapad-laptop, the HW/FW can remember the
> state of keyboard backlight among boots. However, it is always turned
> off while shutting down, as a side effect of the LED class device
> unregistering sequence.
>
> This is inconvenient for users who always prefer turning on the
> keyboard backlight. Thus, set LED_RETAIN_AT_SHUTDOWN on the LED class
> device so that the state of keyboard backlight gets remembered, which
> also aligns with the behavior of manufacturer utilities on Windows.
>
> Fixes: 503325f84bc0 ("platform/x86: ideapad-laptop: add keyboard backlight control support")
> Cc: stable@vger.kernel.org
> Signed-off-by: Rong Zhang <i@rong.moe>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hansg@kernel.org>
Regards,
Hans
> ---
> drivers/platform/x86/ideapad-laptop.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 62a72b09fc3a..edb9d2fb02ec 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -1669,7 +1669,7 @@ static int ideapad_kbd_bl_init(struct ideapad_private *priv)
> priv->kbd_bl.led.name = "platform::" LED_FUNCTION_KBD_BACKLIGHT;
> priv->kbd_bl.led.brightness_get = ideapad_kbd_bl_led_cdev_brightness_get;
> priv->kbd_bl.led.brightness_set_blocking = ideapad_kbd_bl_led_cdev_brightness_set;
> - priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED;
> + priv->kbd_bl.led.flags = LED_BRIGHT_HW_CHANGED | LED_RETAIN_AT_SHUTDOWN;
>
> err = led_classdev_register(&priv->platform_device->dev, &priv->kbd_bl.led);
> if (err)
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & kbd backlight not remembered among boots
2025-07-07 16:38 [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & kbd backlight not remembered among boots Rong Zhang
2025-07-07 16:38 ` [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock " Rong Zhang
2025-07-07 16:38 ` [PATCH 2/2] platform/x86: ideapad-laptop: Fix kbd backlight " Rong Zhang
@ 2025-07-08 10:24 ` Ilpo Järvinen
2 siblings, 0 replies; 6+ messages in thread
From: Ilpo Järvinen @ 2025-07-08 10:24 UTC (permalink / raw)
To: Ike Panhc, Hans de Goede, Rong Zhang
Cc: platform-driver-x86, linux-kernel, Gergo Koteles,
Barnabás Pőcze
On Tue, 08 Jul 2025 00:38:05 +0800, Rong Zhang wrote:
> I had disabled ideapad-laptop for a long time until a critical bug was
> fixed[1], and I soon noticed some behavior changes after reenabling
> ideapad-laptop.
>
> The behavior changes are about FnLock and keyboard backlight. The HW/FW
> can remember their states among boots[2]. After enabling ideapad-laptop,
> I noticed that their states were always reset to off after a reboot or a
> power cycle.
>
> [...]
Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.
The list of commits applied:
[1/2] platform/x86: ideapad-laptop: Fix FnLock not remembered among boots
commit: 9533b789df7e8d273543a5991aec92447be043d7
[2/2] platform/x86: ideapad-laptop: Fix kbd backlight not remembered among boots
commit: e10981075adce203eac0be866389309eeb8ef11e
--
i.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-07-08 10:24 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-07 16:38 [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & kbd backlight not remembered among boots Rong Zhang
2025-07-07 16:38 ` [PATCH 1/2] platform/x86: ideapad-laptop: Fix FnLock " Rong Zhang
2025-07-07 17:23 ` Hans de Goede
2025-07-07 16:38 ` [PATCH 2/2] platform/x86: ideapad-laptop: Fix kbd backlight " Rong Zhang
2025-07-07 17:24 ` Hans de Goede
2025-07-08 10:24 ` [PATCH 0/2] platform/x86: ideapad-laptop: Fix FnLock & " Ilpo Järvinen
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®