mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
	Ulf Hansson <ulf.hansson@linaro.org>
Cc: Jassi Brar <jaswinder.singh@linaro.org>,
	Ard Biesheuvel <ard.biesheuvel@linaro.org>,
	linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
Subject: [PATCH 2/4] mmc: f-sdh30: Add support for non-removable media
Date: Tue,  8 Nov 2022 17:25:31 +0900	[thread overview]
Message-ID: <20221108082533.21384-3-hayashi.kunihiko@socionext.com> (raw)
In-Reply-To: <20221108082533.21384-1-hayashi.kunihiko@socionext.com>

To use F_SDH30 for non-removable meda like eMMC,
need to enable FORCE_CARD_INSERT bit to skip the delay for detection.

Signed-off-by: Kunihiko Hayashi <hayashi.kunihiko@socionext.com>
---
 drivers/mmc/host/sdhci_f_sdh30.c | 7 +++++++
 drivers/mmc/host/sdhci_f_sdh30.h | 3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c
index 7f4553b28180..e7617a08276d 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.c
+++ b/drivers/mmc/host/sdhci_f_sdh30.c
@@ -76,6 +76,13 @@ static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask)
 		ctl |= F_SDH30_CMD_DAT_DELAY;
 		sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL);
 	}
+
+	if ((host->mmc->caps & MMC_CAP_NONREMOVABLE) &&
+	    !(sdhci_readl(host, SDHCI_PRESENT_STATE) & SDHCI_CARD_PRESENT)) {
+		ctl = sdhci_readl(host, F_SDH30_TEST);
+		ctl |= F_SDH30_FORCE_CARD_INSERT;
+		sdhci_writel(host, ctl, F_SDH30_TEST);
+	}
 }
 
 static const struct sdhci_ops sdhci_f_sdh30_ops = {
diff --git a/drivers/mmc/host/sdhci_f_sdh30.h b/drivers/mmc/host/sdhci_f_sdh30.h
index fc1ad28f7ca9..7c3c66291d42 100644
--- a/drivers/mmc/host/sdhci_f_sdh30.h
+++ b/drivers/mmc/host/sdhci_f_sdh30.h
@@ -29,4 +29,7 @@
 #define  F_SDH30_CMD_DAT_DELAY	BIT(9)
 #define	 F_SDH30_EMMC_HS200		BIT(24)
 
+#define F_SDH30_TEST		0x158
+#define F_SDH30_FORCE_CARD_INSERT	BIT(6)
+
 #define F_SDH30_MIN_CLOCK		400000
-- 
2.25.1


  parent reply	other threads:[~2022-11-08  8:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-08  8:25 [PATCH 0/4] mmc: Add support for F_SDH30_E51 Kunihiko Hayashi
2022-11-08  8:25 ` [PATCH 1/4] mmc: f-sdh30: Add reset control support Kunihiko Hayashi
2022-11-09 12:15   ` Ulf Hansson
2022-11-11  6:15     ` Kunihiko Hayashi
2022-11-11 12:13       ` Ulf Hansson
2022-11-11 12:39         ` Kunihiko Hayashi
2022-11-08  8:25 ` Kunihiko Hayashi [this message]
2022-11-08  8:25 ` [PATCH 3/4] mmc: f-sdh30: Add quirks for broken timeout clock capability Kunihiko Hayashi
2022-11-08  8:25 ` [PATCH 4/4] mmc: f-sdh30: Add compatible string for Socionext F_SDH30_E51 Kunihiko Hayashi
2022-11-08 16:03   ` Jassi Brar
2022-11-09  8:23     ` Kunihiko Hayashi
2022-11-08 16:07 ` [PATCH 0/4] mmc: Add support for F_SDH30_E51 Jassi Brar

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=20221108082533.21384-3-hayashi.kunihiko@socionext.com \
    --to=hayashi.kunihiko@socionext.com \
    --cc=adrian.hunter@intel.com \
    --cc=ard.biesheuvel@linaro.org \
    --cc=jaswinder.singh@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --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®