aymanbagabas / Huawei-WMI

Huawei WMI laptop extras linux driver
GNU General Public License v2.0
229 stars 15 forks source link

fix micmute led, init smart charge #64

Closed sermart1234 closed 2 years ago

sermart1234 commented 2 years ago

experimental support smart charge

sermart1234 commented 2 years ago

Smart charge [mode] [unknow] [start] [stop] mode: 1 - home 2 - office 3 - travel 4 - smart charge - disable user-settable thresholds unknow - maybe a timer start stop like charge_control_thresholes

Smart charge param unknow. You can set 1 or 2. I think it disables smart charging for one time https://consumer.huawei.com/en/support/content/en-us15784067/

mpi3d commented 2 years ago

I can confirm that it works on HUAWEI MateBook D 15 AMD. Mic led is still working too. Thanks for your work @sermart1234. @aymanbagabas Thanks to you too. Any idea when this could be merged in the kernel?

sermart1234 commented 2 years ago

@mpi3d @aymanbagabas 1) smart charging test (this is not the final implementation. there may be conflicts with thresholds) 2) finish the LEDs and hwmon 3) I don't like quirks 4) wq branch 5) there are still unrealized WMI methods

aymanbagabas commented 2 years ago

I can confirm that it works on HUAWEI MateBook D 15 AMD. Mic led is still working too. Thanks for your work @sermart1234. @aymanbagabas Thanks to you too. Any idea when this could be merged in the kernel?

We could start merging that into kernel once we thoroughly test these changes and confirm their backward compatibility and coverage across different Huawei models

sermart1234 commented 2 years ago

@mpi3d Do you have any ideas to improve the smart charging interface?

mpi3d commented 2 years ago

Ok, thanks a lot.

sermart1234 commented 2 years ago

@aymanbagabas ec_micmute only for Matebook X? FN lock work on Matebook X? I see the method in dsdt Method (FNLK, 1, NotSerialized) Is the handle_kbdlight quirk necessary? On which devices does it work?

sermart1234 commented 2 years ago

@aymanbagabas Can I hook atkbd events? Or do I need to patch atkbd to remove these messages in dmesg? It would be nice to get events from hotkeys (keyboard backlight key, display backlight button, power unlock (FN + P)) изображение изображение

aymanbagabas commented 2 years ago

@mpi3d @aymanbagabas

  1. smart charging test (this is not the final implementation. there may be conflicts with thresholds)
  2. finish the LEDs and hwmon
  3. I don't like quirks
  4. wq branch
  5. there are still unrealized WMI methods

using Ghidra to reverse engineer Huawei PC Manger will definitely help. You can decompile the DLLs that come with PC Manager and try to understand how it works.

aymanbagabas commented 2 years ago

@aymanbagabas Can I hook atkbd events? Or do I need to patch atkbd to remove these messages in dmesg? It would be nice to get events from hotkeys (keyboard backlight key, display backlight button, power unlock (FN + P)) изображение изображение

The atkbd driver emits these keys. And since huawei-wmi handles key inputs using linux/input/sparse-keymap, we can ignore atkbd events and rely on huawei-wmi registered input device to do the right action.

You can ignore atkbd events using SystemdD keyboard hwdb

mpi3d commented 2 years ago

@sermart1234

@mpi3d Do you have any ideas to improve the smart charging interface?

Sorry, I did not see your message. I don't know, really, what smart charging does. When I activate it, just charge to 100%. Even on Windows. Is it supposed to do something else?

@aymanbagabas

using Ghidra to reverse engineer Huawei PC Manger will definitely help. You can decompile the DLLs that come with PC Manager and try to understand how it works.

I wish I could help. But I'm already busy with making the fingerprint sensor work.  Also, I don't know how this work for now. Of course, I can learn, but since you are already working on it, I prefer working on the fingerprint sensor.