mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricky Wu <ricky_wu@realtek.com>
To: <ricky_wu@realtek.com>, <ulf.hansson@linaro.org>,
	<linux-mmc@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<ricardo@marliere.net>, <gregkh@linuxfoundation.org>,
	<arnd@arndb.de>
Subject: [PATCH 3/4] mmc: rtsx: make Realtek sdmmc to support SDUC
Date: Fri, 19 Jul 2024 13:33:13 +0800	[thread overview]
Message-ID: <20240719053314.1636649-4-ricky_wu@realtek.com> (raw)
In-Reply-To: <20240719053314.1636649-1-ricky_wu@realtek.com>

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 --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
-- 
2.25.1


  parent reply	other threads:[~2024-07-19  5:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-19  5:33 [PATCH 0/4] Add support SDUC for Realtek card readers Ricky Wu
2024-07-19  5:33 ` [PATCH 1/4] mmc: core: some definitions and type modifications for SDUC Ricky Wu
2024-07-19  5:33 ` [PATCH 2/4] mmc: core: add SDUC init rw erase flow to mmc Ricky Wu
2024-07-19  5:33 ` Ricky Wu [this message]
2024-07-19  5:33 ` [PATCH 4/4] misc: rtsx: add Realtek card readers to support SDUC Ricky Wu
2024-07-26  6:13 ` [PATCH 0/4] Add support SDUC for Realtek card readers Avri Altman
2024-07-26 13:15   ` Ricky WU

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240719053314.1636649-4-ricky_wu@realtek.com \
    --to=ricky_wu@realtek.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=ricardo@marliere.net \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®