+40
−0
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
During a hotswap, there will always be a first_soc interrupt when the
fuel gauge hardware detects a battery insertion. This completes the
first_soc_done completion that fg_do_restart() waits for, resulting in a
situation where the RESTART_GO bit is immediately cleared without
waiting for an actual fuel gauge restart.
Fix this by changing the semantics of the first_soc_done completion.
The function fg_do_restart() will now reinit the completion before it
restarts the fuel gauge, ensuring that the completion is not completed
when the driver is waiting for the hardware to restart. Also, complete
the first_soc_done completion at probe time if the first_soc_done
interrupt is high.
Change-Id: I970896869df2dfc2d4ad37a1c384915299a0cfb6
Signed-off-by:
Xiaozhe Shi <xiaozhes@codeaurora.org>