]> git.baikalelectronics.ru Git - kernel.git/commit
power: supply: charger-manager: Make decisions focussed on battery status
authorJonghwa Lee <jonghwa3.lee@samsung.com>
Thu, 14 May 2020 23:04:31 +0000 (16:04 -0700)
committerSebastian Reichel <sre@kernel.org>
Fri, 28 Aug 2020 17:27:45 +0000 (19:27 +0200)
commitb73a71c1877e917f1738f82f861b676846a08be3
treeda60e52633eaf44c7011e85bfb426e17d4fc3069
parent747a38c828eae2d9f9437e5cb133ad53fc1c106e
power: supply: charger-manager: Make decisions focussed on battery status

cm_monitor(), where charging management starts, checks various charging
condition sequentially to decide next charging operation. However, as it
follows sequential process, cascaded if statements, it does some
jobs which have already done in the previous stage. This results in a
delay in decision making. Moreover, starting point of charging is spread
all around which makes maintain code and debugging difficult.

Both of the problems mentioned above become clean if it manages battery
charging focusing on battery status not following sequential condition
checking.  Now, cm_monitor() moves battery state diagram and does the
optimal operation for current state. As a result, it reduces whole
monitoring time almost in half.

Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Jonathan Bakker <xc-racer2@live.ca>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/charger-manager.c
include/linux/power/charger-manager.h