]> git.karo-electronics.de Git - linux-beck.git/commit
power: bq24257: Streamline input current limit setup
authorAndreas Dannenberg <dannenberg@ti.com>
Fri, 25 Sep 2015 15:54:08 +0000 (10:54 -0500)
committerSebastian Reichel <sre@kernel.org>
Mon, 28 Sep 2015 16:47:50 +0000 (18:47 +0200)
commit9b1cf1e44d91e80b17a315d04193b1764ca82a15
tree2f25ef266206567eae15c02953dff6debd6c90c2
parent5ff8c89d112cbeb5776d5ba40a224b70f67e41bb
power: bq24257: Streamline input current limit setup

The maximum amount of input current the charger should draw is dependent
on the power supply and should only be (re-)configured when the power
supply gets connected and disconnected. However the driver was also
lowering the bq24257's input current limit setting to 500mA when the
battery was removed and restored the previous setting according to the
power supply capabilities when the battery was reconnected although
these events are not impacting the amount of power that can be drawn
from the supply. Furthermore, a re-configuration of the input current
limit to 500mA when the battery gets disconnected is actually dangerous
if the limit was set higher previously and the system draws more than
500mA in which case the system voltage would be reduced in order to
maintain 500mA which could result in the system getting too low of a
supply to maintain operation. Last but not least the mechanism itself
used for battery re-connection detection did not work in corner cases
such as when the device's input current loop becomes active and the
bq24257 device clears its battery fault error resulting in incorrectly
reporting that the battery got reconnected.

This patches removes the impact the battery removal/insertion has on the
input current limit configured for the bq24257 and simplifies the
associated handler routine.

Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/bq24257_charger.c