aymanbagabas / Huawei-WMI

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

Cannot set charge_control_thresholds on Matebook 13 AMD #90

Open OllyFunkster opened 2 days ago

OllyFunkster commented 2 days ago

Describe the bug Attempting to change battery charge thresholds, either using TLP or by directly, has no effect, and /sys/devices/platform/huawei-wmi/charge_control_thresholds always reads "0 100"

To Reproduce Steps to reproduce the behavior:

  1. cat /sys/devices/platform/huawei-wmi/charge_control_thresholds 0 100

  2. echo "75 80" | sudo tee /sys/devices/platform/huawei-wmi/charge_control_thresholds 75 80

  3. cat /sys/devices/platform/huawei-wmi/charge_control_thresholds 0 100

Expected behavior

  1. cat /sys/devices/platform/huawei-wmi/charge_control_thresholds 0 100

  2. echo "75 80" | sudo tee /sys/devices/platform/huawei-wmi/charge_control_thresholds 75 80

  3. cat /sys/devices/platform/huawei-wmi/charge_control_thresholds 75 80

Screenshots If applicable, add screenshots to help explain your problem.

(please complete the following information):

output of sudo lshw:

matebook                    
    description: Notebook
    product: HN-WX9X (C100)
    vendor: HUAWEI
    version: M1060
    serial: 2EDBB20528800269
    width: 64 bits
    capabilities: smbios-3.1.1 dmi-3.1.1 smp vsyscall32
    configuration: chassis=notebook family=MateBook sku=C100 uuid=20200529-1cbf-c01c-f607-1cbfc01cf608
  *-core
       description: Motherboard
       product: HN-WX9X-PCB
       vendor: HUAWEI
       physical id: 0
       version: M1060
       serial: [REDACTED]
     *-firmware
          description: BIOS
          vendor: HUAWEI
          physical id: 0
          version: 1.17
          date: 03/10/2022
          size: 128KiB
          capacity: 8MiB
          capabilities: pci pnp upgrade shadowing cdboot bootselect edd acpi usb smartbattery biosbootspecification uefi

I see in some threads about other Huawei machines that "smart battery" may be interfering with this, and they give some commands that can be used to debug. I am assuming that these are very machine-specific, is there a set of commands available for this SKU?

Many thanks for your time and attention

OllyFunkster commented 2 days ago

One small update: I did try the commands in e.g. this guide anyway, and it did report being in mode 4. Using the example commands to set it to mode 1 and configure the start/stop thresholds does work - but n.b. that writing to charge_control_thresholds will set it back to mode 4 again (and charge_control_thresholds will contain "0 100" still).