twl4030_charger: allow fine control of charger 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:15:25 +0000 (05:15 +0200)
commit1098cb58aed8eb4e06302d947a38bbfb69c8b4ba
tree608d82f41ee74396b9689c665b195974e03ad262
parent3b542f089dcbdcf1c21a01927fbc6d5116af01f6
twl4030_charger: allow fine control of charger current.

The twl4030 allows control of the incoming current.
Part of this control is a 'CGAIN' setting which doubles
the range for half the precision.  This control affects
several different current setting, so all need to be updated
at once when CGAIN is changed.

With this patch, all of these current setting are managed
by the driver, but most are left at their default settings.

The current drawn is set to 500mA if the allow_usb module parameter is
set, and to 100mA otherwise.
More fine control will appear in later patches.

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