[PATCH v2] mmc: mmc: add prepare_ddr_to_hs400 callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some SD controllers need specific settings for HS400 mode
before the speed mode is been switching from DDR mode to
HS400 mode. This patch is to add prepare_ddr_to_hs400 callback
for this.

Signed-off-by: Yinbo Zhu <yinbo.zhu@xxxxxxx>
---
Change in v2:
		Separate from "hs400 mode support" as a mmc patch. 

 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 4f4a627..a5a3b3b 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -1148,6 +1148,9 @@ static int mmc_select_hs400(struct mmc_card *card)
 		goto out_err;
 
 	/* Switch card to DDR */
+	if (host->ops->prepare_ddr_to_hs400)
+		host->ops->prepare_ddr_to_hs400(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 0b24394..c97ffd6 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	(*prepare_ddr_to_hs400)(struct mmc_host *host);
 	/* Prepare enhanced strobe depending host driver */
 	void	(*hs400_enhanced_strobe)(struct mmc_host *host,
 					 struct mmc_ios *ios);
-- 
1.7.1




[Index of Archives]     [Linux Memonry Technology]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux