Some SD controllers need specific settings for HS400 mode before the speed mode is been switching from DDR mode to HS400 mode. and Prepare switch to DDR during the HS400 init sequence This patch is to add hs400_prepare_ddr callback for this. Signed-off-by: Yinbo Zhu <yinbo.zhu@xxxxxxx> --- Change in v6: rename the callback to "hs400_prepare_ddr" in code drivers/mmc/core/mmc.c | 3 +++ include/linux/mmc/host.h | 1 + 2 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index bc1bd2c..f3f0f64 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c @@ -1182,6 +1182,9 @@ static int mmc_select_hs400(struct mmc_card *card) goto out_err; /* Switch card to DDR */ + if (host->ops->hs400_prepare_ddr) + host->ops->hs400_prepare_ddr(host); + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL, EXT_CSD_BUS_WIDTH, EXT_CSD_DDR_BUS_WIDTH_8, diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index 2a5fe75..1077147 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h @@ -146,6 +146,7 @@ struct mmc_host_ops { /* Prepare HS400 target operating frequency depending host driver */ int (*prepare_hs400_tuning)(struct mmc_host *host, struct mmc_ios *ios); + int (*hs400_prepare_ddr)(struct mmc_host *host); /* Prepare for switching from HS400 to HS200 */ void (*hs400_downgrade)(struct mmc_host *host); -- 1.7.1