Like you guys, I was fed-up with the HTC battery charging policy. Picking-up my phone charged to 90% after an overnight was really annoying.
Basically, the Desire stops charging when the battery is fully charged and waits for the level to drop to 90% before recharging to 100% again.
I went for a deeper look at sources. I wanted to have a trickle charge on my phone, even at the cost of a battery wear (not even sure about that tho, because it's the way the battery is charging when the phone is turned OFF - not in standby).
With a very minor tweak in the HTC DS2784 driver, it is possible to change this behaviour in a way that the charge doesn't stop @ 100% but a very small current (close to 0mA) keeps your battery @ 4.2v. I have experimented my little hack on my own desire and I can tell you that it's working perfectly well! I monitored for hours the charging process and the current slowly dropped to very small numbers. HTC_BATT was reporting 0 to 2mA charge and was even letting the battery discharging (-2 to -4mA) to keep it at 4.2v
What you get with this is a normal charge, and when the battery is close to 4.2v, the charging current slowly drops to 0mA. I haven't changed anything else so the battery is still overtemp or overcharge protected.
The file involved is drivers/power/ds2784_battery.c
I attached a patched file below (for GB sense kernel)
Here is the diff (the magic bit ;-) ):
The full code now looks like this:
Cut& paste this thread to your favourite kernel developer
(For HTC SENSE ROMS / KERNELS ONLY. Others seems to be not affected)
I would like to thank RichardTrip for his kernel and his github.
I would like to thank Mekrel as well, as he showed me the path with his post.
I built a Froyo V5e kernel for you guys just here
Last updated kernel is also attached (GingerBread SENSE kernel) based on bananacakes's patches.
An APP to tweak SVS/HAVS settings: IncrediControl (Thanks to sebastiaan15 who mentioned it). The settings in the general tab are only functional in kernels that have implemented the simple sysfs interfaces for usb fast charging and audio boost.
If your phone is unstable with those kernels, try those stable kernels.
Basically, the Desire stops charging when the battery is fully charged and waits for the level to drop to 90% before recharging to 100% again.
I went for a deeper look at sources. I wanted to have a trickle charge on my phone, even at the cost of a battery wear (not even sure about that tho, because it's the way the battery is charging when the phone is turned OFF - not in standby).
With a very minor tweak in the HTC DS2784 driver, it is possible to change this behaviour in a way that the charge doesn't stop @ 100% but a very small current (close to 0mA) keeps your battery @ 4.2v. I have experimented my little hack on my own desire and I can tell you that it's working perfectly well! I monitored for hours the charging process and the current slowly dropped to very small numbers. HTC_BATT was reporting 0 to 2mA charge and was even letting the battery discharging (-2 to -4mA) to keep it at 4.2v
What you get with this is a normal charge, and when the battery is close to 4.2v, the charging current slowly drops to 0mA. I haven't changed anything else so the battery is still overtemp or overcharge protected.
The file involved is drivers/power/ds2784_battery.c
I attached a patched file below (for GB sense kernel)
Here is the diff (the magic bit ;-) ):
Code:
965c965
< charge_mode = CHARGE_OFF;
---
> charge_mode = CHARGE_SLOW;
972c972
< charge_mode = CHARGE_OFF;
---
> charge_mode = CHARGE_SLOW;
The full code now looks like this:
Code:
} else {
if (htc_batt_info.rep.level <= 99)
htc_batt_info.rep.battery_full = 0;
if (htc_batt_info.rep.battery_full) {
charge_mode = CHARGE_SLOW;
}
else if ((htc_batt_info.rep.guage_status_reg & 0x80) &&
(htc_batt_info.rep.batt_current <= 80) &&
(htc_batt_info.rep.level == 100)) {
if (More_Charge_Extend_Time()) {
htc_batt_info.rep.battery_full = 1;
charge_mode = CHARGE_SLOW;
}
}
Cut& paste this thread to your favourite kernel developer
I would like to thank RichardTrip for his kernel and his github.
I would like to thank Mekrel as well, as he showed me the path with his post.
I built a Froyo V5e kernel for you guys just here
Last updated kernel is also attached (GingerBread SENSE kernel) based on bananacakes's patches.
An APP to tweak SVS/HAVS settings: IncrediControl (Thanks to sebastiaan15 who mentioned it). The settings in the general tab are only functional in kernels that have implemented the simple sysfs interfaces for usb fast charging and audio boost.
If your phone is unstable with those kernels, try those stable kernels.
Attachments
Last edited: