VR-25 / acc

Advanced Charging Controller
https://github.com/Magisk-Modules-Repo/acc
GNU General Public License v3.0
1.71k stars 107 forks source link

How exactly does native battery idle mode work? #238

Closed androidtablet closed 5 months ago

androidtablet commented 7 months ago

I've read the README and searched online but don't seem to understand how the native battery idle mode works? I assume this is depedent on how the SOC was created? I thought all power must go through the battery first?

I've been looking at the charging IC of my device. If I set up a custom kernel and disabled CHG (the charging of the battery) but don't set HIZ mode, will this bypass the battery? It is a mediatek device

I noticed you commented out some mediatek changes: https://github.com/VR-25/acc/blob/3fb128827cbfbf2043f1d11c60d78e3d8c7a4f75/install/oem-custom.sh#L31 Did it not work?

VR-25 commented 6 months ago

Those changes in oem-custom.sh were suggested by a user. They later found out that idle mode also worked without them, with the right charging switch.

I often use the "Y" pipe analogy to describe how idle mode works. The lone end brings the power. The other two deliver it to the battery and phone, respectively (and simultaneously). Turns out, those two can be controlled individually. If we limit the charging current to zero, the battery can't charge (status="Not charging" or "Idle"). The other end of the pipe continues delivering power to the phone, as if the battery were physically disconnected.

If some [legacy] devices do really have just a "regular pipe" (like a straight line, no ramifications), then in order to achieve idle mode, the current would have to be dynamically adjusted to keep it in the range of "just enough" to keep the device running. If we use a 1A power supply, the battery does not get that much. Some of the current is inevitably "discounted" to feed the device, and that's precisely the value that has to be adjusted to keep the battery from charging.

I'm no kernel dev and don't know much about kernel development.