Linux MultiMedia Card development
 help / color / mirror / Atom feed
* [PATCH] mmc: rtsx: add 74 Clocks in power on flow
@ 2022-02-22  7:27 Ricky WU
  2022-02-22  7:42 ` gregkh
  2022-02-28 16:12 ` Ulf Hansson
  0 siblings, 2 replies; 13+ messages in thread
From: Ricky WU @ 2022-02-22  7:27 UTC (permalink / raw)
  To: ulf.hansson@linaro.org, Ricky WU, gregkh@linuxfoundation.org,
	kai.heng.feng@canonical.com, tommyhebb@gmail.com,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org

After 1ms stabilizing the voltage time
add "Host provides at least 74 Clocks
before issuing first command" that is
spec definition

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 2a3f14afe9f8..e016d720e453 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -940,10 +940,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host)
 	if (err < 0)
 		return err;
 
+	mdelay(1);
+
 	err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN);
 	if (err < 0)
 		return err;
 
+	/* send init 74 clocks */
+	rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN);
+	mdelay(5);
+	rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, 0);
+
 	if (PCI_PID(pcr) == PID_5261) {
 		/*
 		 * If test mode is set switch to SD Express mandatorily,
-- 
2.25.1

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-05-10 10:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-22  7:27 [PATCH] mmc: rtsx: add 74 Clocks in power on flow Ricky WU
2022-02-22  7:42 ` gregkh
2022-02-22  8:48   ` Ricky WU
2022-02-22  8:59     ` gregkh
2022-02-22 12:31       ` Ricky WU
2022-02-22 14:18         ` gregkh
2022-02-24  5:49           ` Ricky WU
2022-02-28 16:12 ` Ulf Hansson
2022-05-09  9:35   ` Christian Löhle
2022-05-09  9:47     ` gregkh
2022-05-09 10:12       ` Christian Löhle
2022-05-10  9:56         ` Ulf Hansson
2022-05-10 10:21           ` gregkh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox