From: yongd <yongd@marvell.com>
To: Chris Ball <cjb@laptop.org>,
Anton Vorontsov <anton.vorontsov@linaro.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Shawn Guo <shawn.guo@linaro.org>,
Wolfram Sang <w.sang@pengutronix.de>,
Daniel Drake <dsd@laptop.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Wilson Callan <wilson.callan@savantsystems.com>,
Ben Dooks <ben-linux@fluff.org>
Cc: zhangfei.gao@marvell.com, kevin.liu@marvell.com,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
yongd <yongd@marvell.com>
Subject: [PATCH V2 2/3] mmc: sdhci-s3c: enable polling to detect card by itself
Date: Tue, 30 Oct 2012 17:30:02 +0800 [thread overview]
Message-ID: <1351589403-26398-3-git-send-email-yongd@marvell.com> (raw)
In-Reply-To: <1351589403-26398-1-git-send-email-yongd@marvell.com>
SDHCI_QUIRK_BROKEN_CARD_DETECTION is used to disable host internal
card detection method. So it should be set for all card detection types
except S3C_SDHCI_CD_INTERNAL, or host internal card detection interrupts
will be redundantly enabled. So, the 1st change of this patch expands such
flag setting.
Moreover, we need move further after the above change.
In the current code logic, sdhci_add_host() will enable the polling method
(set MMC_CAP_NEEDS_POLL) for a removable card (MMC_CAP_NONREMOVABLE is not
set) whose host's internal card detection method is disabled.
Apparently, this is arbitrary since we can have some other detection types.
As a result, sdhci_add_host() will redundantly enable polling for a card with
S3C_SDHCI_CD_GPIO/S3C_SDHCI_CD_EXTERNAL type.
So, we plan to remove such improper setting in sdhci_add_host(). But
before this, this 2nd change of this patch is a MUST, which enables polling
in host driver itself for S3C_SDHCI_CD_NONE type. Currently, we rely on the
above improper logic for this.
Change-Id: I28bd6765e6c6a9dd6c288ff4ca6ecf7268a2d8ed
Signed-off-by: yongd <yongd@marvell.com>
---
drivers/mmc/host/sdhci-s3c.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index a093e2e..a669616 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -683,10 +683,12 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
/* Samsung SoCs need BROKEN_ADMA_ZEROLEN_DESC */
host->quirks |= SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC;
- if (pdata->cd_type == S3C_SDHCI_CD_NONE ||
- pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
+ if (pdata->cd_type != S3C_SDHCI_CD_INTERNAL)
host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ if (pdata->cd_type == S3C_SDHCI_CD_NONE)
+ host->mmc->caps = MMC_CAP_NEEDS_POLL;
+
if (pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
host->mmc->caps = MMC_CAP_NONREMOVABLE;
--
1.7.9.5
next prev parent reply other threads:[~2012-10-30 9:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-30 9:30 [PATCH V2 0/3] mmc: remove MMC_CAP_NEEDS_POLL setting in sdhci_add_host yongd
2012-10-30 9:30 ` [PATCH V2 1/3] mmc: esdhc: enable polling to detect card by itself yongd
2012-10-31 15:20 ` Shawn Guo
2012-11-02 12:37 ` yongd
2012-11-05 1:54 ` Shawn Guo
2012-11-05 3:34 ` yongd
2012-11-05 12:48 ` Shawn Guo
2012-11-06 8:49 ` yongd
2012-11-06 12:52 ` Shawn Guo
2012-11-08 2:46 ` yongd
2012-10-30 9:30 ` yongd [this message]
2012-10-30 23:11 ` [PATCH V2 0/3] mmc: remove MMC_CAP_NEEDS_POLL setting in sdhci_add_host Anton Vorontsov
2012-10-31 10:07 ` yongd
2012-10-31 10:14 ` yongd
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=1351589403-26398-3-git-send-email-yongd@marvell.com \
--to=yongd@marvell.com \
--cc=anton.vorontsov@linaro.org \
--cc=ben-linux@fluff.org \
--cc=cjb@laptop.org \
--cc=dsd@laptop.org \
--cc=kevin.liu@marvell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=s.hauer@pengutronix.de \
--cc=shawn.guo@linaro.org \
--cc=w.sang@pengutronix.de \
--cc=wilson.callan@savantsystems.com \
--cc=zhangfei.gao@marvell.com \
/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;
as well as URLs for NNTP newsgroup(s).