power: pm8921-charger: add adaptive current limiting
Adaptive current limiting is a method which tries to
maximize the available usb current by slowly stepping
up the allowed maximum usb current and verifying that
the connected wall-charger is collapsing.
If the USB driver determines that 1500 mA are available
the starting current on usb is 500 mA slowly stepping up
unless
* VIN_MIN is reached (charger is reaching its capacity)
* USBIN goes low for less than 50 ms (charger collapsed)
If one of the two conditions apply then reduce the target
maximum current to the current maximum usb current and
stop trying to stepping up. If the conditions occur again
decrease both the target and current usb maximum setting.
CRs-Fixed: 339022
Change-Id: Icdb46e6346b6b871d81bbacbffe70831dd62d93c
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
1 file changed