[PATCH 2/3] mmc: sdhci-s3c: enable polling to detect card by itself
From: yongd
Date: Fri Sep 28 2012 - 06:29:05 EST
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 for some reason (SDHCI_QUIRK_BROKEN_CARD_DETECTION is set).
However, this is improper since we can have some other card detection
methods besides host internal card detection and polling method. As a
result, sdhci_add_host() will redundantly enable polling for a card
which actually uses other methods, eg external GPIO.
So, we plan to remove such improper setting in sdhci_add_host(). But
before this, this patch is a MUST, which enables polling in host driver
itself when the detection type is S3C_SDHCI_CD_NONE.
Change-Id: I28bd6765e6c6a9dd6c288ff4ca6ecf7268a2d8ed
Signed-off-by: yongd <yongd@xxxxxxxxxxx>
---
drivers/mmc/host/sdhci-s3c.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
index 2903949..0701f08 100644
--- a/drivers/mmc/host/sdhci-s3c.c
+++ b/drivers/mmc/host/sdhci-s3c.c
@@ -687,6 +687,9 @@ static int __devinit sdhci_s3c_probe(struct platform_device *pdev)
pdata->cd_type == S3C_SDHCI_CD_PERMANENT)
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/