Skip to content

Instantly share code, notes, and snippets.

@klausenbusk
Created February 18, 2020 23:16
Show Gist options
  • Save klausenbusk/643f15320ae8997427155c38be13e445 to your computer and use it in GitHub Desktop.
Save klausenbusk/643f15320ae8997427155c38be13e445 to your computer and use it in GitHub Desktop.
See https://github.com/linrunner/TLP/issues/321#issuecomment-587184825 for context..
@surajrv6
Copy link

I have been also checking the source code to see if changes have been added for the past couple of weeks :)

Here..
https://github.com/torvalds/linux/blob/master/drivers/platform/x86/asus-wmi.c

@userofryzen
Copy link

@klausenbusk are you here?
Is there any news about this? or can't you do it now?
May be this thread have been missed by you for lost time or Idk.

@klausenbusk
Copy link
Author

Hi @userofryzen. I haven't got time to look at it and I don't like just adding every "battery name" (it is a "temporary" solution, we need a permanent solution).

@userofryzen
Copy link

okey, have you something on mind?
I think a recursive function that looks in every BAT x being x letters and numbers?
I don't know if it's efficient or not etc.. I hope someone can solves it

@klausenbusk
Copy link
Author

Someone beat me to it: torvalds/linux@9a33e37

@surajrv6
Copy link

Glad to hear it's implemented finally :)

@egnappahz
Copy link

It's going to become a loooong list if they keep those batterynames coming..

@linrunner
Copy link

linrunner commented Sep 3, 2020

Hi,

for a proper implementation in TLP i need answers to the following questions:

  1. What are the valid values / the range for charge_control_end_threshold?
  2. May i assume that the threshold works exactly the same way – values, range, charge behaviour – for all ASUS laptops that expose /sys/class/power_supply/BAT0/charge_control_end_threshold?
    2a. If not, how do I distinguish the variants e.g. in /sys/class/dmi/id/*
  3. How do i check that asus_wmi is loaded – does /sys/module/asus_wmi exist?
  4. Is the battery always named BATx or else?

@klausenbusk
Copy link
Author

klausenbusk commented Sep 3, 2020

Hi

for a proper implementation in TLP i need answers to the following questions:

Is there any issue I can track?

What are the valid values / the range for charge_control_end_threshold?

0-100, but there is one report of it only supporting 60, 80 and 100.

May i assume that the threshold works exactly the same way – values, range, charge behaviour – for all ASUS laptops that expose /sys/class/power_supply/BAT0/charge_control_end_threshold?

I don't know, but probably (if you ignore that one report).

How do i check that asus_wmi is loaded – does /sys/module/asus_wmi exist?

/sys/module/asus_wmi does indeed exists.

Is the battery always named BATx or else?

The code is currently hard-coded to only create charge_control_end_threshold if the battery name is BAT0, BAT1 or BATT.

@linrunner
Copy link

Is there any issue I can track?

Well, yes ... here you are. I added another question there.

@linrunner
Copy link

The wait is over: the stop charge threshold is implemented for TLP 1.4.

Please participate in the alpha test. All necessary information is here.

Have fun.

@therealak12
Copy link

therealak12 commented Aug 10, 2024

Asus UX3404VA supports only 60, 80, and 100 in the /sys/class/power_supply/BAT0/charge_control_end_threshold file (as reported above).

Does anyone know that this is a hardware or software limitation? Do you have any workarounds to bypass it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment