power: supply: ab8500: Move to componentized binding
authorLinus Walleij <linus.walleij@linaro.org>
Sat, 22 May 2021 22:50:39 +0000 (00:50 +0200)
committerSebastian Reichel <sre@kernel.org>
Thu, 3 Jun 2021 16:40:15 +0000 (18:40 +0200)
commit1c1f13a006ed0d71bb5664c8b7e3e77a28da3beb
tree2e1cc7e00fb9baff932c51571bda3b1f91521863
parent94233f11f8b6be9dd78f66cca162de66b7b66ae6
power: supply: ab8500: Move to componentized binding

The driver has problems with the different components of
the charging code racing with each other to probe().

This results in all four subdrivers populating battery
information to ascertain that it is populated for their
own needs for example.

Fix this by using component probing and thus expressing
to the kernel that these are dependent components.
The probes can happen in any order and will only acquire
resources such as state container, regulators and
interrupts and initialize the data structures, but no
execution happens until the .bind() callback is called.

The charging driver is the main component and binds
first, then bind in order the three subcomponents:
ab8500-fg, ab8500-btemp and ab8500-chargalg.

Do some housekeeping while we are moving the code around.
Like use devm_* for IRQs so as to cut down on some
boilerplate.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
drivers/power/supply/ab8500-bm.h
drivers/power/supply/ab8500_btemp.c
drivers/power/supply/ab8500_charger.c
drivers/power/supply/ab8500_fg.c
drivers/power/supply/abx500_chargalg.c