* Pavel Machek <pavel@xxxxxx> [190919 09:35]: > On Tue 2019-09-17 14:52:53, Tony Lindgren wrote: > > When debugging why higher than 500 mA charge current does not work, I > > noticed that we start getting lots of chrgcurr1 interrupts if we attempt > > to charge at rates higher than the charger can provide. > > > > We can take advantage of the chrgcurr1 interrupts for charger detection, > > and retry charging at a lower rate if charging fails. When an acceptable > > charge rate is found, the chrgcurr1 interrupts stop. > > Do you still see these problems with "good" charger? (Wall one, > capable of providing 2A)? Yes, need to recheck again with the updated fix I posted. > Note that 1A charging will decrease battery lifetime, and that phone > definitely should not be charging with more than 500mA when charging > from computer. I actually prefer the way it charges slowly in mainline... It should still charge at 500mA when connected to a computer because of different charger detection bits. Needs to be checked again .though > We'll eventually need a library or something; we don't want every > driver to reinvent charging code.. Yeah currently implementing a charger takes weeks of work :) Regards, Tony