Linux MultiMedia Card development
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: "linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: Chris Ball <chris@printf.net>, Arnd Bergmann <arnd@arndb.de>,
	Ulf Hansson <ulf.hansson@linaro.org>,
	Seungwon Jeon <tgih.jun@samsung.com>
Subject: [PATCH v2 8/8] mmc: core: use the broken-cd for non-removable card
Date: Tue, 28 Jan 2014 17:24:59 +0900	[thread overview]
Message-ID: <52E7695B.2050504@samsung.com> (raw)

Some SoC is used the broken card-detection.
And it should be also used the "non-removable".
Even if card is "non-removable", it didn't always use the cd-gpio.

If it's used only broken-cd, then card-detect interrupt is polling.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/core/core.c |    4 ++--
 drivers/mmc/core/host.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 098374b..df732aa 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -2460,8 +2460,8 @@ void mmc_rescan(struct work_struct *work)
 	 */
 	mmc_bus_put(host);
 
-	if (!(host->caps & MMC_CAP_NONREMOVABLE) && host->ops->get_cd &&
-			host->ops->get_cd(host) == 0) {
+	if (host->ops->get_cd && host->ops->get_cd(host) == 0 &&
+			!(host->caps & MMC_CAP_NONREMOVABLE)) {
 		mmc_claim_host(host);
 		mmc_power_off(host);
 		mmc_release_host(host);
diff --git a/drivers/mmc/core/host.c b/drivers/mmc/core/host.c
index 4b81c93..52a64fe 100644
--- a/drivers/mmc/core/host.c
+++ b/drivers/mmc/core/host.c
@@ -356,6 +356,9 @@ int mmc_of_parse(struct mmc_host *host)
 	 * configuration is performed.
 	 */
 
+	if (of_find_property(np, "broken-cd", &len))
+		host->caps |= MMC_CAP_NEEDS_POLL;
+
 	/* Parse Card Detection */
 	if (of_find_property(np, "non-removable", &len)) {
 		host->caps |= MMC_CAP_NONREMOVABLE;
@@ -364,9 +367,6 @@ int mmc_of_parse(struct mmc_host *host)
 
 		explicit_inv_cd = of_property_read_bool(np, "cd-inverted");
 
-		if (of_find_property(np, "broken-cd", &len))
-			host->caps |= MMC_CAP_NEEDS_POLL;
-
 		gpio = of_get_named_gpio_flags(np, "cd-gpios", 0, &flags);
 		if (gpio == -EPROBE_DEFER)
 			return gpio;
-- 
1.7.9.5

             reply	other threads:[~2014-01-28  8:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-28  8:24 Jaehoon Chung [this message]
2014-01-28 10:32 ` [PATCH v2 8/8] mmc: core: use the broken-cd for non-removable card Ulf Hansson
2014-01-28 10:51   ` Jaehoon Chung
2014-01-28 11:21     ` Ulf Hansson
2014-01-28 23:56       ` Jaehoon Chung

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=52E7695B.2050504@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=arnd@arndb.de \
    --cc=chris@printf.net \
    --cc=linux-mmc@vger.kernel.org \
    --cc=tgih.jun@samsung.com \
    --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