From ccd0977c2393771f801a208e91773f2bdd77e032 Mon Sep 17 00:00:00 2001 From: Siva Durga Prasad Paladugu Date: Thu, 2 Feb 2017 01:10:44 +0530 Subject: [PATCH] mmc: sdhci: Add support for platform specific delay Add support for any platform/board specific delays requirement while setting clocks. Some boards needs to program tapdelay for setting certain high frequencies and this patch adds hook for supporting the same. Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/mmc/sdhci.c | 3 +++ include/sdhci.h | 1 + 2 files changed, 4 insertions(+) diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c index 20cfdb3e454..2f8c033ccc8 100644 --- a/drivers/mmc/sdhci.c +++ b/drivers/mmc/sdhci.c @@ -407,6 +407,9 @@ static int sdhci_set_clock(struct mmc *mmc, unsigned int clock) if (clock == 0) return 0; + if (mmc->is_uhs && host->set_delay) + host->set_delay(host, mmc->uhsmode); + if (SDHCI_GET_VERSION(host) >= SDHCI_SPEC_300) { /* * Check if the Host Controller supports Programmable Clock diff --git a/include/sdhci.h b/include/sdhci.h index a8b52571988..4dc50eec210 100644 --- a/include/sdhci.h +++ b/include/sdhci.h @@ -270,6 +270,7 @@ struct sdhci_host { void (*set_control_reg)(struct sdhci_host *host); void (*set_clock)(int dev_index, unsigned int div); int (*platform_execute_tuning)(struct mmc *host, u8 opcode); + void (*set_delay)(struct sdhci_host *host, u8 uhsmode); uint voltages; struct mmc_config cfg; -- 2.47.3