diff options
author | Yangbo Lu <yangbo.lu@nxp.com> | 2020-09-01 16:57:59 +0800 |
---|---|---|
committer | Peng Fan <peng.fan@nxp.com> | 2020-10-12 15:45:39 +0800 |
commit | 390f9bddb9c84f75649024b41b8cf2a766379ce0 (patch) | |
tree | 53bf31a4cf9cbcb2cc76f8a444d699311dce3563 /drivers/mmc/mmc.c | |
parent | 726561a9412abe50875b7791feab94f411d76199 (diff) | |
download | u-boot-390f9bddb9c84f75649024b41b8cf2a766379ce0.tar.gz u-boot-390f9bddb9c84f75649024b41b8cf2a766379ce0.tar.xz u-boot-390f9bddb9c84f75649024b41b8cf2a766379ce0.zip |
mmc: add a reinit() API
For DM_MMC, the controller re-initialization is needed to
clear old configuration for mmc rescan.
Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r-- | drivers/mmc/mmc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index d79cdef62e..0727505304 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -2816,13 +2816,17 @@ int mmc_get_op_cond(struct mmc *mmc) return err; #if CONFIG_IS_ENABLED(DM_MMC) - /* The device has already been probed ready for use */ + /* + * Re-initialization is needed to clear old configuration for + * mmc rescan. + */ + err = mmc_reinit(mmc); #else /* made sure it's not NULL earlier */ err = mmc->cfg->ops->init(mmc); +#endif if (err) return err; -#endif mmc->ddr_mode = 0; retry: |