diff mbox series

[1/3] mmc: sdhci: introduce start_tuning() hook

Message ID 20190917044631.3161-2-yangbo.lu@nxp.com (mailing list archive)
State New, archived
Headers show
Series mmc: sdhci-of-esdhc: fix up erratum A-008171 workaround | expand

Commit Message

Yangbo Lu Sept. 17, 2019, 4:46 a.m. UTC
The tuning start process may be different from standard SD controller
for some specific controllers, like eSDHC and F_SDH30 (which is using
SDHCI_QUIRK2_TUNING_WORK_AROUND now). So introduce a start_tuning() hook.

Signed-off-by: Yangbo Lu <yangbo.lu@nxp.com>
---
 drivers/mmc/host/sdhci.c | 5 ++++-
 drivers/mmc/host/sdhci.h | 1 +
 2 files changed, 5 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index a5dc5aa..2f40490 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2471,7 +2471,10 @@  int sdhci_execute_tuning(struct mmc_host *mmc, u32 opcode)
 	if (host->tuning_delay < 0)
 		host->tuning_delay = opcode == MMC_SEND_TUNING_BLOCK;
 
-	sdhci_start_tuning(host);
+	if (host->ops->start_tuning)
+		host->ops->start_tuning(host);
+	else
+		sdhci_start_tuning(host);
 
 	host->tuning_err = __sdhci_execute_tuning(host, opcode);
 
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
index 902f855..30c8349a 100644
--- a/drivers/mmc/host/sdhci.h
+++ b/drivers/mmc/host/sdhci.h
@@ -643,6 +643,7 @@  struct sdhci_ops {
 	void	(*voltage_switch)(struct sdhci_host *host);
 	void	(*adma_write_desc)(struct sdhci_host *host, void **desc,
 				   dma_addr_t addr, int len, unsigned int cmd);
+	void	(*start_tuning)(struct sdhci_host *host);
 };
 
 #ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS