Badcaps Forums

Badcaps Forums (https://www.badcaps.net/forum/index.php)
-   General Computer & Tech Discussion (https://www.badcaps.net/forum/forumdisplay.php?f=16)
-   -   Limit battery charging percentage through EC registers (https://www.badcaps.net/forum/showthread.php?t=101255)

Jacotsu 11-28-2021 08:26 AM

Limit battery charging percentage through EC registers
 
Hello everyone,
this is my first thread so i don't know if this is the appropriate section so excuse me if i'm wrong.

Recently i've bought an hp 15s-eq2004nl which has been a good laptop overall but it lacks a few important features like:
- HP Battery care (Limits the maximum charging percentage)
- S3 suspend (Which i've fixed by patching the DSDT).

While monitoring the embedded controller registers i've discovered that by writing 0x00 into the register 0x40 the charging stops. but there are the following issues:
- The embedded controller firmware resets the register periodically and tries to charge the battery, so i have to rewrite the register every 2s
- There is still a slight amount of charging going on while the script is running (around 1 W).
- The limiter only works while the laptop is in S0 mode, so if i leave it plugged while in standby or powered off, the battery will fully charge
- If i increase the register writing frequency, there is a significant performance drop (probably due to ACPI detecting a frequent AC/BAT power supply change)

Since the computer is brand new, invasive modding or opening it is out of discussion.
Bios modding is also not really possible both due to HP Sure start and warranty issues.

Did anyone else try to do this? Maybe someone who has an hp laptop with Battery Care available in the bios.

Here's a link to my current "working" script, this is made for void linux but you can easily make your windows equivalent
https://gist.github.com/Jacotsu/0d5f...6a84fb11819566

stj 11-28-2021 08:48 AM

Re: Limit battery charging percentage through EC registers
 
i hope you dont kill the battery,
modern packs have a microcontroller in them that has a charge-counter among other things.

Jacotsu 11-28-2021 09:00 AM

Re: Limit battery charging percentage through EC registers
 
Quote:

Originally Posted by stj (Post 1087692)
i hope you dont kill the battery,
modern packs have a microcontroller in them that has a charge-counter among other things.

I know, but i'm not messing with the battery charge chip. i'm messing with the EC which communicates with the battery chip through SMBus. The register i'm using seems to be the one that controls the charge rate, i don't think that any problem will arise if i set it to 0


All times are GMT -6. The time now is 03:01 AM.

Powered by vBulletin ®
Copyright ©2000 - 2022, Jelsoft Enterprises Ltd.