nekr0z / linux-on-huawei-matebook-13-2019

MateBook 13 running Linux
293 stars 24 forks source link

Mic led #4

Closed aymanbagabas closed 5 years ago

aymanbagabas commented 5 years ago

Hi,

After looking at the DSDT table, I've come to these methods SMLS and PAFF which seem to turn something on and off, and also called from the AMW0 device (WMI device) in SSDT5. Using a tool like acpi_call could you provide the return values and observe any changes to your system using the following?

$ echo "\_SB.PCI0.LPCB.H_EC.ECCC 0x48 0xA0 Zero Zero" | sudo tee /proc/acpi/call
$ sudo cat /proc/acpi/call
$ echo "\_SB.PCI0.LPCB.H_EC.ECCC 0x48 0xA1 Zero Zero" | sudo tee /proc/acpi/call
$ sudo cat /proc/acpi/call
$ echo "\_SB.PCI0.LPCB.H_EC.ECCC 0x45 0xA0 Zero Zero" | sudo tee /proc/acpi/call
$ sudo cat /proc/acpi/call
$ echo "\_SB.PCI0.LPCB.H_EC.ECCC 0x45 0xA1 Zero Zero" | sudo tee /proc/acpi/call
$ sudo cat /proc/acpi/call

Thank you!

nekr0z commented 5 years ago

0x48 is mic mute led, great catch! 0xA0 turns it on, 0xA1 turns it off (both return 0x0called). However, I can't see it change any EC registers. 0x45 returns the same 0x0called but I fail to see what changes on the system.

aymanbagabas commented 5 years ago

This should also work too.

$ echo "\SMLS 0x00010000" | sudo tee /proc/acpi/call
$ echo "\SMLS 0x00000000" | sudo tee /proc/acpi/call

I've seen this method in your model MB13 2019, mine MBXP 2018, and MBD 2018. This is called from the WMI device in all of these models.

nekr0z commented 5 years ago

And indeed it does!

aymanbagabas commented 5 years ago

I will open up an issue in Huawei-WMI regarding this one. Right now, and since we've found how to get some of the other features to work, I feel this project, Huawei-WMI, should evolve to not only keyboard driver but also an nat/acpi driver. I'm closing this issue.

nekr0z commented 5 years ago

I've seen this method in your model MB13 2019, mine MBXP 2018, and MBD 2018. This is called from the WMI device in all of these models.

Does this mean your patch should work for enabling mic led on MB13 as is?

aymanbagabas commented 5 years ago

No, not right now. I'm working on updating the module to fix this issue and to implement the other features discussed.