Huawei WMI included on last kernels ? Because battery protection is not working for me

Hi, I use a Huawei laptop Matebook D 2018 with AMD Ryzen.
Huawei on Windows has a battery protection mode and this tool is present on linux firmware too. I read that Huawei WMI version 3.3 is merged on kernel >= 5.5 so it wil be included but seems not working for me

System:
  Kernel: 5.17.6-1-MANJARO arch: x86_64 bits: 64 compiler: gcc v: 11.2.0
    parameters: BOOT_IMAGE=/boot/vmlinuz-5.17-x86_64
    root=UUID=ee6cbac7-ba22-4004-a228-4a0a18e05d5a rw quiet apparmor=1
    security=apparmor udev.log_priority=3
  Desktop: KDE Plasma v: 5.24.5 tk: Qt v: 5.15.3 wm: kwin_x11 vt: 1 dm: SDDM
    Distro: Manjaro Linux base: Arch Linux
Machine:
  Type: Laptop System: HUAWEI product: KPL-W0X v: M1D
    serial: <superuser required>
  Mobo: HUAWEI model: KPL-W0X-PCB v: M1D serial: <superuser required>
    UEFI: HUAWEI v: 1.23 date: 09/28/2021
Battery:
  ID-1: BAT1 charge: 54.9 Wh (100.0%) condition: 54.9/56.3 Wh (97.5%)
    volts: 8.1 min: 7.6 model: DYNAPACK HB4593R1ECW type: Li-ion
    serial: <filter> status: full cycles: 103
CPU:
  Info: model: AMD Ryzen 5 2500U with Radeon Vega Mobile Gfx bits: 64
    type: MT MCP arch: Zen family: 0x17 (23) model-id: 0x11 (17) stepping: 0
    microcode: 0x8101007
  Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
    L1: 384 KiB desc: d-4x32 KiB; i-4x64 KiB L2: 2 MiB desc: 4x512 KiB L3: 4 MiB
    desc: 1x4 MiB
  Speed (MHz): avg: 1407 high: 1527 min/max: 1600/2000 boost: enabled
    scaling: driver: acpi-cpufreq governor: schedutil cores: 1: 1474 2: 1394
    3: 1367 4: 1527 5: 1367 6: 1368 7: 1385 8: 1380 bogomips: 31949
  Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm
  Vulnerabilities:
  Type: itlb_multihit status: Not affected
  Type: l1tf status: Not affected
  Type: mds status: Not affected
  Type: meltdown status: Not affected
  Type: spec_store_bypass
    mitigation: Speculative Store Bypass disabled via prctl
  Type: spectre_v1
    mitigation: usercopy/swapgs barriers and __user pointer sanitization
  Type: spectre_v2
    mitigation: Retpolines, IBPB: conditional, STIBP: disabled, RSB filling
  Type: srbds status: Not affected
  Type: tsx_async_abort status: Not affected
Graphics:
  Device-1: AMD Raven Ridge [Radeon Vega Series / Radeon Mobile Series]
    vendor: Huawei driver: amdgpu v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    ports: active: eDP-1 empty: DP-1,DP-2,HDMI-A-1 bus-ID: 02:00.0
    chip-ID: 1002:15dd class-ID: 0300
  Device-2: Quanta hm1091_techfront type: USB driver: uvcvideo bus-ID: 3-1:2
    chip-ID: 0408:1020 class-ID: 0e02
  Display: x11 server: X.Org v: 21.1.3 compositor: kwin_x11 driver: X:
    loaded: amdgpu unloaded: modesetting alternate: fbdev,vesa gpu: amdgpu
    display-ID: :0 screens: 1
  Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
    s-diag: 582mm (22.93")
  Monitor-1: eDP-1 mapped: eDP model: ChiMei InnoLux 0x14d4 built: 2016
    res: 1920x1080 hz: 60 dpi: 158 gamma: 1.2 size: 309x173mm (12.17x6.81")
    diag: 354mm (13.9") ratio: 16:9 modes: max: 1920x1080 min: 640x480
  OpenGL: renderer: AMD Radeon Vega 8 Graphics (raven LLVM 13.0.1 DRM 3.44
  5.17.6-1-MANJARO)
    v: 4.6 Mesa 22.0.3 direct render: Yes
Audio:
  Device-1: AMD Raven/Raven2/Fenghuang HDMI/DP Audio vendor: Huawei
    driver: snd_hda_intel v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16
    bus-ID: 02:00.1 chip-ID: 1002:15de class-ID: 0403
  Device-2: AMD ACP/ACP3X/ACP6x Audio Coprocessor vendor: Huawei
    driver: snd_pci_acp3x v: kernel
    alternate: snd_rn_pci_acp3x,snd_pci_acp5x,snd_sof_amd_renoir pcie: gen: 3
    speed: 8 GT/s lanes: 16 bus-ID: 02:00.5 chip-ID: 1022:15e2 class-ID: 0480
  Device-3: AMD Family 17h/19h HD Audio vendor: Huawei driver: snd_hda_intel
    v: kernel pcie: gen: 3 speed: 8 GT/s lanes: 16 bus-ID: 02:00.6
    chip-ID: 1022:15e3 class-ID: 0403
  Sound Server-1: ALSA v: k5.17.6-1-MANJARO running: yes
  Sound Server-2: JACK v: 1.9.21 running: no
  Sound Server-3: PulseAudio v: 15.0 running: yes
  Sound Server-4: PipeWire v: 0.3.51 running: yes
Network:
  Device-1: Intel Wireless 8265 / 8275 driver: iwlwifi v: kernel pcie: gen: 1
    speed: 2.5 GT/s lanes: 1 bus-ID: 01:00.0 chip-ID: 8086:24fd class-ID: 0280
  IF: wlp1s0 state: up mac: <filter>
Bluetooth:
  Device-1: Intel Bluetooth wireless interface type: USB driver: btusb v: 0.8
    bus-ID: 1-2:2 chip-ID: 8087:0a2b class-ID: e001
  Report: rfkill ID: hci0 rfk-id: 0 state: down bt-service: enabled,running
    rfk-block: hardware: no software: yes address: see --recommends
Drives:
  Local Storage: total: 238.47 GiB used: 48.33 GiB (20.3%)
  SMART Message: Unable to run smartctl. Root privileges required.
  ID-1: /dev/sda maj-min: 8:0 vendor: LITE-ON model: CV8-8E256
    size: 238.47 GiB block-size: physical: 512 B logical: 512 B speed: 6.0 Gb/s
    type: SSD serial: <filter> rev: 402 scheme: GPT
Partition:
  ID-1: / raw-size: 15.5 GiB size: 15.15 GiB (97.77%) used: 10.04 GiB (66.2%)
    fs: ext4 dev: /dev/sda5 maj-min: 8:5
  ID-2: /boot/efi raw-size: 100 MiB size: 96 MiB (96.00%)
    used: 38.2 MiB (39.8%) fs: vfat dev: /dev/sda1 maj-min: 8:1
Swap:
  Alert: No swap data was found.
Sensors:
  System Temperatures: cpu: N/A mobo: N/A gpu: amdgpu temp: 54.0 C
  Fan Speeds (RPM): N/A
Info:
  Processes: 247 Uptime: 32m wakeups: 1 Memory: 6.74 GiB used: 1.9 GiB (28.2%)
  Init: systemd v: 250 tool: systemctl Compilers: gcc: 11.2.0 clang: 13.0.1
  Packages: pacman: 1197 lib: 327 flatpak: 0 Shell: Zsh v: 5.8.1 default: Bash
  v: 5.1.16 running-in: konsole inxi: 3.3.16

Just for clarification my situation is that:

sudo nano /sys/devices/platform/huawei-wmi/charge_control_thresholds
40   70

so it will act the same as I set on windows, it will charge only when battery is less than 70% and untill 70% and stop charging at this level
But is not working at all, it is charging battery full 100% and I don’t know why

any update of this sir? i’m on my matebook D15 2020 also having this kind of problem with the battery charge limit

Im not sure what OP was referring to … a link would be helpful.

But … in any case … there is huawei-wmi and huawei-wmi-dkms are in AUR.