[Nexus One Android Development] theGanymedes:
Well, I did try to mod the driver and managed to compile it; however apparently I couldn't do it too well - the phone was complaining the battery is dead and was shutting away right away; whilst I could see in recovery that battery was 98 percent. Apparently, that needs some improvement :)

Today; I've lived something weird though, about calibration. Here's my story:

Yesterday, I've tried to calibrate my battery with CM7.1 installed with Tiamat kernel. After missing the learn-mode start and causing the phone to shut down a few times, I could manage to start the learning mode (charged a little bit, and then retried).

Charging took some time and after some point, charging stopped (min. charge current was 20mA) with the battery application shown CHGTF flag on with some other flags (0x87 seen, learn flag was off, so learning is finished). Weird is that, the capacity was at 1187 and yet learning was finished! It's only a year old phone, I was kinda shocked but well, I just thought that apparently my battery was worn off and this could be normal.

I restarted the phone, gone to the General tab of calibrator app and it was showing 84% battery age (which is consistent with 1187). I didn't mind this much, but the "Aged Capa" was still showing 1393. "OK" I said and reflashed my "usual" ROM, and it went as low as 2% - voila, my task is done!

And after that, I plugged in my device to charge it. After like 3 hours, the battery was still showing pink led - I was kinda concerned about that! Battery monitor widget was showing 99% (and it was about 1187 mA) and the drain was as low as +6mA - which was showing that the battery was actually full, so went to SLOW_CHARGE state, but yet it was still pink led!...

Then I plugged off and turned off my device. After it's turned off, I replugged it and then let it charge for like half an hour. When I returned back to my device, it was a green light!

I turned on my device, plugged in, and then saw at the Battery Monitor widget that it was showing 100% finally - and with a surprising mA value: 1390! Apparently, I could manage to charge it more than I could when I was at the learning phase!

Since this concerned me, I reflashed the CM ROM and then opened the Calibrator app back. CHGTF flag was still on - showing that the device was full, even though it was 95% now :S I replugged the device, and it was not charging (this was not so shocking as I've read somewhere that the charging doesn't start until batt. drops to 90%). CHGTF flag was off only when the battery dropped to 89% - about 1180 mA.

The interesting fact is, now the calibrator app shows that the battery age is 94% - apparently, I teached my DS2784 chip that the battery can actually store more that it thinks!

To test that learning is done correctly, I'm depleting my battery right now. If it dies at about 15% again, apparently my learning phase had become crappy and the device-off charging changed the learned values. If it goes to 2% or so, it will show that the battery is really calibrated.

My point is: apparently battery calibration is also done with the usage and device-off charging can teach the device the "full point". Real 0% teaching has to be done with the app AFAIK, though.

EDIT: Died at 13%.. Apparently I did fail..