From: Srinivas Kandagatla Date: Mon, 2 Jun 2014 09:08:57 +0000 (+0100) Subject: mmc: mmci: Add enough delay between writes to CMD register. X-Git-Tag: firefly_0821_release~176^2~3398^2~64 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=6adb2a804a943a348eadfb09266571cd4557387c;p=firefly-linux-kernel-4.4.55.git mmc: mmci: Add enough delay between writes to CMD register. On Qcom SD Card controller POWER, CLKCTRL, DATACTRL and COMMAND registers should be updated in MCLK domain, and writes to these registers must be separated by three MCLK cycles. This resitriction is not applicable for other registers. Any subsequent writes to these register will be ignored until 3 MCLK have passed. One usec delay between two CMD register writes is not sufficient in the card identification phase where the CCLK is very low. This patch replaces a static 1 usec delay to use mmci_reg_delay function which can provide correct delay depending on the cclk frequency. Without this patch the card is not detected. Signed-off-by: Srinivas Kandagatla Reviewed-by: Linus Walleij Signed-off-by: Ulf Hansson --- diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c index c67120bf2e93..6409f31d328c 100644 --- a/drivers/mmc/host/mmci.c +++ b/drivers/mmc/host/mmci.c @@ -812,7 +812,7 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) if (readl(base + MMCICOMMAND) & MCI_CPSM_ENABLE) { writel(0, base + MMCICOMMAND); - udelay(1); + mmci_reg_delay(host); } c |= cmd->opcode | MCI_CPSM_ENABLE;