diff mbox series

[3/4] mmc: rtsx: make Realtek sdmmc to support SDUC

Message ID 20240719053314.1636649-4-ricky_wu@realtek.com
State New
Headers show
Series Add support SDUC for Realtek card readers | expand

Commit Message

Ricky WU July 19, 2024, 5:33 a.m. UTC
Add Realtek sdmmc host to support SDUC
Send CMD22 before normal read/write when the card is SDUC card
Add MMC_CAP2_SDUC to caps2

Signed-off-by: Ricky Wu <ricky_wu@realtek.com>
---
 drivers/mmc/host/rtsx_pci_sdmmc.c | 6 ++++++
 include/linux/rtsx_pci.h          | 1 +
 2 files changed, 7 insertions(+)
diff mbox series

Patch

diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c
index 7dfe7c4e0077..919aa0454345 100644
--- a/drivers/mmc/host/rtsx_pci_sdmmc.c
+++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
@@ -839,6 +839,8 @@  static void sd_request(struct work_struct *work)
 	if (!data_size) {
 		sd_send_cmd_get_rsp(host, cmd);
 	} else if (sd_rw_cmd(cmd) || sdio_extblock_cmd(cmd, data)) {
+		if (mrq->ae)
+			sd_send_cmd_get_rsp(host, mrq->ae);
 		cmd->error = sd_rw_multi(host, mrq);
 		if (!host->using_cookie)
 			sdmmc_post_req(host->mmc, host->mrq, 0);
@@ -846,6 +848,8 @@  static void sd_request(struct work_struct *work)
 		if (mmc_op_multi(cmd->opcode) && mrq->stop)
 			sd_send_cmd_get_rsp(host, mrq->stop);
 	} else {
+		if (mrq->ae)
+			sd_send_cmd_get_rsp(host, mrq->ae);
 		sd_normal_rw(host, mrq);
 	}
 
@@ -1445,6 +1449,8 @@  static void init_extra_caps(struct realtek_pci_sdmmc *host)
 		mmc->caps2 |= MMC_CAP2_NO_MMC;
 	if (pcr->extra_caps & EXTRA_CAPS_SD_EXPRESS)
 		mmc->caps2 |= MMC_CAP2_SD_EXP | MMC_CAP2_SD_EXP_1_2V;
+	if (pcr->extra_caps & EXTRA_CAPS_SDUC)
+		mmc->caps2 |= MMC_CAP2_SDUC;
 }
 
 static void realtek_init_host(struct realtek_pci_sdmmc *host)
diff --git a/include/linux/rtsx_pci.h b/include/linux/rtsx_pci.h
index 4612ef09a0c7..a36c87a52f39 100644
--- a/include/linux/rtsx_pci.h
+++ b/include/linux/rtsx_pci.h
@@ -1228,6 +1228,7 @@  struct rtsx_pcr {
 #define EXTRA_CAPS_MMC_8BIT		(1 << 5)
 #define EXTRA_CAPS_NO_MMC		(1 << 7)
 #define EXTRA_CAPS_SD_EXPRESS		(1 << 8)
+#define EXTRA_CAPS_SDUC				(1 << 9)
 	u32				extra_caps;
 
 #define IC_VER_A			0