Skip to content

Commit cc14eec

Browse files
Yinbo ZhuUlf Hansson
authored andcommitted
mmc: core: Add ->hs400_prepare_ddr() callback
Some eMMC controllers need specific settings for HS400 mode before the speed mode can be switched to DDR mode, during the HS400 initialization sequence. For that reason, let's introduce a new host callback, ->hs400_prepare_ddr() and invoked it just before switching to DDR mode. Signed-off-by: Yinbo Zhu <yinbo.zhu@nxp.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 52b5f5c commit cc14eec

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

‎drivers/mmc/core/mmc.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1181,6 +1181,9 @@ static int mmc_select_hs400(struct mmc_card *card)
11811181
if (err)
11821182
goto out_err;
11831183

1184+
if (host->ops->hs400_prepare_ddr)
1185+
host->ops->hs400_prepare_ddr(host);
1186+
11841187
/* Switch card to DDR */
11851188
err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
11861189
EXT_CSD_BUS_WIDTH,

‎include/linux/mmc/host.h‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ struct mmc_host_ops {
147147
/* Prepare HS400 target operating frequency depending host driver */
148148
int (*prepare_hs400_tuning)(struct mmc_host *host, struct mmc_ios *ios);
149149

150+
/* Prepare switch to DDR during the HS400 init sequence */
151+
int (*hs400_prepare_ddr)(struct mmc_host *host);
152+
150153
/* Prepare for switching from HS400 to HS200 */
151154
void (*hs400_downgrade)(struct mmc_host *host);
152155

0 commit comments

Comments
 (0)