power: supply: qcom_battmgr: Register the power supplies after PDR is up
authorKonrad Dybcio <konrad.dybcio@linaro.org>
Mon, 18 Dec 2023 14:41:52 +0000 (15:41 +0100)
committerSebastian Reichel <sebastian.reichel@collabora.com>
Sun, 24 Dec 2023 23:02:03 +0000 (00:02 +0100)
commitb43f7ddc2b7a5a90447d96cb4d3c6d142dd4a810
tree89e3b194cf29a8a606b6b34643eeb546899857ba
parent523100208bd22e3eee7b76025ee4584b5d1ea0ee
power: supply: qcom_battmgr: Register the power supplies after PDR is up

Currently, a not-yet-entirely-initialized battmgr (e.g. with pd-mapper
not having yet started or ADSP not being up etc.) results in a couple of
zombie power supply devices hanging around.

This is particularly noticeable when trying to suspend the device (even
s2idle): the PSY-internal thermal zone is inaccessible and returns
-ENODEV, which causes log spam.

Register the power supplies only after we received some notification
indicating battmgr is ready to take off.

Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Tested-by: Luca Weiss <luca.weiss@fairphone.com>
Link: https://lore.kernel.org/r/20231218-topic-battmgr_fixture_attempt-v1-1-6145745f34fe@linaro.org
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/qcom_battmgr.c