TLP icon indicating copy to clipboard operation
TLP copied to clipboard

[Intel LAPQC71X] Support stop threshold (new kernel driver)

Open pobrn opened this issue 5 years ago • 14 comments

Describe the solution you'd like

Allowing just one of the battery charge thresholds to be specified would make TLP's battery features compatible with more laptops. For example, the asus-wmi kernel driver provides only the charge_control_end_threshold attribute, which means that TLP completely ignores it (disregarding the issue laid out in #513).

Are there any technical obstacles why this limitation exists?

(I apologize if this has been asked/answered before.)


I see this has been briefly mentioned in #321.

pobrn avatar Jul 26 '20 14:07 pobrn

10 years experience with ThinkPads shows that charge thresholds are a very support intensive topic.

This is due to many technical peculiarities or firmware bugs of the different model series and on the other hand due to users who have difficulties in understanding the concept.

If contributor(s) possessing the necessary range of hardware – let's say for the ASUS brand – step up to:

  • provide well tested pull requests (that don't break TP functionality); and
  • volunteer to shoulder mainentance and support of the code here in the issue tracker

then I'll consider merging.

And yes, the hurdle is deliberately high. I don't have time to do this myself.

One reference for ASUS' pecularities:

  • https://gist.github.com/klausenbusk/643f15320ae8997427155c38be13e445

linrunner avatar Jul 27 '20 14:07 linrunner

I apologize because I have not been 100% explicit in my original text. What I'd like to see is the ability to set only one of the charge limits if only one of them is available.

Furthermore, in my understanding the semantics of these attributes are documented, and it is the responsibility of the driver to handle hardware/firmware peculiarities if it chooses to provide this interface.

pobrn avatar Jul 27 '20 14:07 pobrn

and it is the responsibility of the driver to handle hardware/firmware peculiarities if it chooses to provide this interface.

In theory yes, in practice the user space tool has to deal with them. Believe me, I'm doing this for 10 years now.

linrunner avatar Jul 27 '20 14:07 linrunner

I see. So it isn't probable that this will be implemented for all drivers that support these attributes, correct? The reason why I would like to see this feature is that I'm writing a platform driver for my current laptop, and it only supports the "stop threshold", and I would like to see TLP support for it.

pobrn avatar Jul 27 '20 15:07 pobrn

If you write the driver yourself, you can also provide detailed information for whitelisting models and I suppose you would help with debugging and support here. That's a different situation. Go ahead with your driver, please.

ps. may I ask which laptop? If you don't want to say this in public, drop me an email.

linrunner avatar Jul 27 '20 15:07 linrunner

It's an Intel LAPQC71X based laptop. This design is sold under different names: XMG Fusion 15, Eluktronics MAG 15, Aftershock Vapor 15 - the ones I know of. It's probably not a mainstream laptop, less so among Linux users, but hey, at least it'll work for me.

pobrn avatar Jul 27 '20 15:07 pobrn

That'll be difficult to whitelist properly. Let's see.

linrunner avatar Jul 27 '20 15:07 linrunner

/sys/devices/virtual/dmi/id/board_name provides - as far as I see - a reliable way to identify the board.

pobrn avatar Jul 27 '20 15:07 pobrn

What's the state of your driver?

linrunner avatar Oct 25 '20 13:10 linrunner

The battery charge threshold controlling parts are and have been done for some time as you can see in the repository. However, there are some things which need to be sorted out before I attempt to submit it.

pobrn avatar Oct 25 '20 13:10 pobrn

I see. I have not yet come to implement because it requires some basic changes. But it is still on my list.

linrunner avatar Oct 25 '20 16:10 linrunner

@pobrn : with TLP 1.4 all the infrastructure to support new drivers is in place. What's your status?

linrunner avatar Aug 04 '21 11:08 linrunner

The driver is not yet in the kernel, there are some problematic points which need to be reworked, but I don't know when I'll have time to do that. As I've mentioned in October, the functionality is there and working.

pobrn avatar Aug 04 '21 14:08 pobrn

@pobrn : Any news on this?

linrunner avatar Dec 07 '21 13:12 linrunner