diff options
author | NeilBrown <neil@brown.name> | 2015-07-30 03:11:24 +0300 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2015-08-05 06:23:04 +0300 |
commit | 21ae40404f3ca66fb37dd26e7b67eb109f2453ab (patch) | |
tree | c5d80b5c98e80479ee0a4647d0b2a66d7168b063 /mm/mmu_notifier.c | |
parent | b04b908d8a2901c2cc59db87defd9c08bd4293cc (diff) | |
download | linux-21ae40404f3ca66fb37dd26e7b67eb109f2453ab.tar.xz |
twl4030_charger: Increase current carefully while watching voltage.
The USB Battery Charging spec (BC1.2) suggests a dedicated
charging port can deliver from 0.5 to 5.0A at between 4.75 and 5.25
volts.
To choose the "correct" current voltage setting requires a trial
and error approach: try to draw current and see if the voltage drops
too low.
Even with a configured Standard Downstream Port, it may not be possible
to reliably pull 500mA - depending on cable quality and source
quality I have reports of charging failure due to the voltage dropping
too low.
To address both these concerns, this patch introduce incremental
current setting.
The current pull from VBUS is increased in steps of 20mA every 100ms
until the target is reached or until the measure voltage drops below
4.75V. If the voltage does go too low, the target current is reduced
by 20mA and kept there.
This applies to currents selected automatically, or to values
set via sysfs. So setting a large value will cause the maximum
available to be used - up to the limit of 1.7A imposed by the
hardware.
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Diffstat (limited to 'mm/mmu_notifier.c')
0 files changed, 0 insertions, 0 deletions