twl4030_charger: distinguish between USB current and 'AC' current
authorNeilBrown <neil@brown.name>
Thu, 30 Jul 2015 00:11:24 +0000 (10:11 +1000)
committerSebastian Reichel <sre@kernel.org>
Wed, 5 Aug 2015 03:18:06 +0000 (05:18 +0200)
commite4ae537e0482e99eeaa5373d39932fe65a477c21
treec2614aea68397f9181e596916aa2f7d4b82e0f97
parent1098cb58aed8eb4e06302d947a38bbfb69c8b4ba
twl4030_charger: distinguish between USB current and 'AC' current

The twl4030 charger has two current sources, 'USB' and 'AC'
(presumably "Accessory Charger" because it isn't Alternating Current).

If 'AC' is providing current, we should set the current limit
differently to when it isn't (and so USB is used).
So split 'cur' into 'usb_cur' and 'ac_cur' and use accordingly.

Now we must review the current setting on any interrupt or USB
event which might indicate that the charger-source has changed.

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/twl4030_charger.c