[PATCH V2 4/4] mmc: sdhci: Enable card clock instead of ->set_clock()

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

 



SDHCI has separate controls for the internal clock and enabling the
clock signal to the card.

The card clock signal was disabled via SDHCI_CLOCK_CARD_EN to avoid
glitches on the clock line. It is not necessary to reset the internal clock
to re-enable it. Instead re-enable by re-asserting SDHCI_CLOCK_CARD_EN.

Tested-by: Haibo Chen <haibo.chen@xxxxxxx>
Signed-off-by: Adrian Hunter <adrian.hunter@xxxxxxxxx>
---
 drivers/mmc/host/sdhci.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
index beb1fe643634..9a245d5c532b 100644
--- a/drivers/mmc/host/sdhci.c
+++ b/drivers/mmc/host/sdhci.c
@@ -2452,8 +2452,11 @@ void sdhci_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
 			host->drv_type = ios->drv_type;
 		}
 
-		/* Re-enable SD Clock */
-		host->ops->set_clock(host, host->clock);
+		if (ios->clock) {
+			clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
+			clk |= SDHCI_CLOCK_CARD_EN;
+			sdhci_writew(host, clk, SDHCI_CLOCK_CONTROL);
+		}
 	} else
 		sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
 }
-- 
2.34.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