Skip to contentSkip to conversation

"asus_wmi: Unknown key code 0xcf" when plugging in charger to laptop

DISCUSSION Pau Espin Pedrol 3 participants 6 messages Oct 29, 2024 – Nov 2, 2024 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

Hi all,

I was using an Asus laptop today running Ubuntu 24.10 (kernel 6.11.5), and I noticed that every time I plug in the laptop charger I get the following message in dmesg:

"asus_wmi: Unknown key code 0xcf"

Having a quick look at current linux master drivers/platform/x86/asus-wmi.c, I couldn't find any reference to such code, so I guess specific handling for it is still missing in there.  I don't know how that code should be handled or ignored, so sharing here in case somebody familiar with it wants to make the message disappear.

Regards,

Pau

#1 lore raw

Am 30.10.24 um 00:37 schrieb Pau Espin Pedrol:

Quoted 15 lines

Hi all,

I was using an Asus laptop today running Ubuntu 24.10 (kernel 6.11.5), and I noticed that every time I plug in the laptop charger I get the following message in dmesg:

"asus_wmi: Unknown key code 0xcf"

Having a quick look at current linux master drivers/platform/x86/asus-wmi.c, I couldn't find any reference to such code, so I guess specific handling for it is still missing in there. I don't know how that code should be handled or ignored, so sharing here in case somebody familiar with it wants to make the message disappear.

Quoted 5 lines

Regards,

Pau

Hi,

can you share the output of "acpidump"?

Thanks,
Armin Wolf

#3 lore raw

Am 30.10.24 um 22:44 schrieb Pau Espin Pedrol:

Quoted 7 lines

Hi,

Quoted 2 lines · Armin Wolf

can you share the output of "acpidump"?

Quoted 9 lines

Find it here:
https://pespin.espeweb.net/~pespin/tmp/asus_wmi/acpidump.txt.bz2

regards,

Pau

Thank you. The event seems to be causes by this piece of AML code:

	If (ACPS ())
	{
		ACPF = One
		Local0 = 0x58
		If (ATKP)
		{
			^^^^ATKD.IANE (0xCF)
		}
	}
	Else
	{
		ACPF = Zero
		Local0 = 0x57
	}

	Notify (AC0, 0x80) // Status Change
	If (ATKP)
	{
		^^^^ATKD.IANE (Local0)
	}

	Sleep (0x64)
	PNOT ()
	Sleep (0x0A)
	NBAT (0x80)

Since the event codes 0x67/0x58 are used to signal battery/ac mode, i think that the 0xCF event might be an alias for event 0x58. Maybe we can just map it as KEY_IGNORE to silence the warning?

Thanks,
Armin Wolf

#4 lore raw
Quoted 46 lines · Armin Wolf

Am 30.10.24 um 22:44 schrieb Pau Espin Pedrol:

Quoted 7 lines

Hi,

Quoted 2 lines · Armin Wolf

can you share the output of "acpidump"?

Quoted 9 lines

Find it here:
https://pespin.espeweb.net/~pespin/tmp/asus_wmi/acpidump.txt.bz2

regards,

Pau

Thank you. The event seems to be causes by this piece of AML code:

	If (ACPS ())
	{
		ACPF = One
		Local0 = 0x58
		If (ATKP)
		{
			^^^^ATKD.IANE (0xCF)
		}
	}
	Else
	{
		ACPF = Zero
		Local0 = 0x57
	}

	Notify (AC0, 0x80) // Status Change
	If (ATKP)
	{
		^^^^ATKD.IANE (Local0)
	}

	Sleep (0x64)
	PNOT ()
	Sleep (0x0A)
	NBAT (0x80)
Quoted 4 lines

Since the event codes 0x67/0x58 are used to signal battery/ac mode, i think that the 0xCF event
might be an alias for event 0x58. Maybe we can just map it as KEY_IGNORE to silence the warning?

Do we know which laptop exactly? The "gamer" laptops along with I think the ProArt ones use an MCU on USB to do keyboard I/O. Others use I2C.

Not all that relevant if all we need to do is ignore the event but there might be something additional in code already that can be used.

Quoted 2 lines

Thanks,
Armin Wolf

#5 lore raw

Hi,

Quoted 1 line · Luke Jones

Do we know which laptop exactly? The "gamer" laptops along with I think the ProArt ones use an MCU on USB to do keyboard I/O. Others use I2C.

#dmidecode | grep -A3 "System Information"

Manufacturer:  ASUSTeK COMPUTER INC.

Product Name: X541UAK

Version: 1.0

Quoted 1 line

Not all that relevant if all we need to do is ignore the event but there might be something additional in code already that can be used.

Probably just ignore. I submitted a similar patch a long time ago for an eeepc I used to have:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=999ddbdf3c8354077660efbac9ab91c12187d6d2

I don't know which is the relevant file in the case here, since I see there are several asus files with keycodes. Hope it's clearer for you to make a patch.

Regards,

Pau