dm: core: Add late driver remove option
authorMarek Vasut <marek.vasut@gmail.com>
Sun, 24 Jan 2021 21:32:46 +0000 (14:32 -0700)
committerSimon Glass <sjg@chromium.org>
Wed, 3 Feb 2021 10:38:41 +0000 (03:38 -0700)
commitcc6f4c8f2574472e359cb915811f6f93efdfcad4
tree67b550a1af9bd00eb5fed3bc5d257eda641abcae
parentc51d2e704a1c89d504b379b133bd552c3387fa6c
dm: core: Add late driver remove option

Add another flag to the DM core which could be assigned to drivers and
which makes those drivers call their remove callbacks last, just before
booting OS and after all the other drivers finished with their remove
callbacks. This is necessary for things like clock drivers, where the
other drivers might depend on the clock driver in their remove callbacks.
Prime example is the mmc subsystem, which can reconfigure a card from HS
mode to slower modes in the remove callback and for that it needs to
reconfigure the controller clock.

Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
drivers/core/device-remove.c
drivers/core/root.c
include/dm/device-internal.h
include/dm/device.h
test/dm/core.c
test/dm/test-driver.c