platform/x86: ideapad-laptop: don't warn about keyboard backlight type 0
Subsystems (3)
PATCH 1/1 platform/x86: ideapad-laptop: don't warn about keyboard backlight type 0
On the Lenovo V14 G2 ITL (82KA), which has no keyboard backlight, every boot logs:
ideapad_acpi VPC2004:00: Unknown keyboard type: 0
followed by "Keyboard backlight control not available". The KBLC type query (Arg0 == 1) in this machine's DSDT reads KBGC from the EC but always returns Zero, and KBLC also returns Zero whenever the EC is not available or LFCM cannot be acquired. So 0 is not an unknown backlight type but the value for "no KBLC keyboard backlight", which the driver already handles by leaving features.kbd_bl unset.
Only warn for non-zero values, and add the missing newline to the message.
---
Tested on a V14 G2 ITL (BIOS GGCN55WW) with the 7.0.14-based
kernel: reloading the stock ideapad-laptop logs the warning, the same module with this patch applied doesn't, and the rest of the probe output and the sysfs state (platform profiles, fn_lock, camera_power, usb_charging, charge_types) are unchanged. Build-tested (W=1) on pdx86 for-next.
drivers/platform/x86/lenovo/ideapad-laptop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/x86/lenovo/ideapad-laptop.c +2 -2
@@ -2627,9 +2627,9 @@ static int ideapad_check_features(struct ideapad_private *priv) }else if (val ==KBD_BL_TRISTATE_AUTO_TYPE ) { priv->features.kbd_bl = true; priv->kbd_bl.type =KBD_BL_TRISTATE_AUTO ; - }else { + }else if (val) {dev_warn (&priv->platform_device->dev, -"Unknown keyboard type: %lu" , +"Unknown keyboard type: %lu\n" , val); } }
base-commit: 61c0dac952b9308884936d05cce97565a5c89af4
Signature · 1 line
2.53.0
Hi Arnav,
Quoted 12 lines · Arnav Kapoor
On the Lenovo V14 G2 ITL (82KA), which has no keyboard backlight, every boot logs:
ideapad_acpiVPC2004:00: Unknown keyboard type: 0followed by "Keyboard backlight control not available". The KBLC type query (Arg0 == 1) in this machine's DSDT reads KBGC from the EC but always returns Zero, and KBLC also returns Zero whenever the EC is not available or LFCM cannot be acquired. So 0 is not an unknown backlight type but the value for "no KBLC keyboard backlight", which the driver already handles by leaving features.kbd_bl unset.
Quoted 2 lines
Only warn for non-zero values, and add the missing newline to the message.
See https://msgid.link/[email protected]
Thanks,
Rong
Quoted 32 lines
Fixes ecaa1867b524 ("platform/x86: ideapad-laptop: Add support for keyboard backlights using KBLC ACPI symbol")Signed-off-by Arnav Kapoor <[email protected]>---
Tested on a V14 G2 ITL (BIOS GGCN55WW) with the 7.0.14-based
kernel: reloading the stock ideapad-laptop logs the warning, the same module with this patch applied doesn't, and the rest of the probe output and the sysfs state (platform profiles,fn_lock,camera_power,usb_charging,charge_types) are unchanged. Build-tested (W=1) on pdx86 for-next.drivers/platform/x86/lenovo/ideapad-laptop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/platform/x86/lenovo/ideapad-laptop.c +2
-2@@ -2627,9 +2627,9 @@ static int ideapad_check_features(struct ideapad_private *priv) }else if (val ==KBD_BL_TRISTATE_AUTO_TYPE ) { priv->features.kbd_bl = true; priv->kbd_bl.type =KBD_BL_TRISTATE_AUTO ; - }else { + }else if (val) {dev_warn (&priv->platform_device->dev, -"Unknown keyboard type: %lu" , +"Unknown keyboard type: %lu\n" , val); } }base-commit:
61c0dac952b9308884936d05cce97565a5c89af4
Quoted 1 line · Rong Zhang
Thanks for the pointer, Rong. Punnay's patch fixes the same warning and was posted first. I missed it because I only checked pdx86 for-next, where it hasn't landed yet, and didn't search the list archive before sending. Sorry for the noise.
Hans, Ilpo: please drop this one in favour of Punnay's patch. I'll test it on the V14 G2 ITL and reply on that thread.
Thanks,
Arnav
Correction, sorry: I replied before reading Punnay's patch closely. It only skips the warning for type 1 (KBD_BL_NONE_TYPE); this V14 G2 ITL returns 0, so the warning stays with it applied.
Type 0 is a separate case: no bits set, and KBLC also returns 0 when the EC or LFCM is unavailable, so it can't mean any backlight type.
Hans, Ilpo, please ignore my earlier request to drop this patch. I'm happy to rebase it on top of Punnay's patch, or to fold both cases into a single check, whichever you prefer.
Thanks,
Arnav
Hi Arnav,
Quoted 10 lines · Arnav Kapoor
Correction, sorry: I replied before reading Punnay's patch closely. It only skips the warning for type 1 (
KBD_BL_NONE_TYPE); this V14 G2 ITL returns 0, so the warning stays with it applied.Type 0 is a separate case: no bits set, and KBLC also returns 0 when the EC or LFCM is unavailable, so it can't mean any backlight type.
Hans, Ilpo, please ignore my earlier request to drop this patch. I'm happy to rebase it on top of Punnay's patch, or to fold both cases into a single check, whichever you prefer.
IIRC the KBLC methods of devices I've seen always return (whatever | 1).
So I guess it should be safe to assume 0 as stubbed. I'd still like to defer to Mark's opinion, though.
Thanks,
Rong
Quoted 3 lines
Thanks,
Arnav