Not sure if it is entirely relevant to this topic but I found something potentially interresting:
(in charger.c)
I think someone may have misunderstood something here (could very well be me). Using input current prochot would make some sense in standalone mode as it may throttle before crashing, with a battery you would probably not want that. However here it probably does nothing. It sets the prochot threshold to the advertised charger current rounded up to the next 128ma but sets the current limit to 90% of the advertised current so the charge controller will throttle the input current before hitting prochot and likely crashing before that triggers. Would make more sense to set the limit to 100% of advertised and set the prochot to 90-95% (in standalone mode only) and disable it when a battery is present.
Also kinda funny that there is a nice charger driver and the framework stuff just does naked i2c writes sometimes.