summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSuresh Mangipudi <smangipudi@nvidia.com>2011-05-18 16:37:25 +0530
committerNiket Sirsi <nsirsi@nvidia.com>2011-05-24 16:26:20 -0700
commit9a9e1d5d0a0a115043579b2de468dc84e49c6ec0 (patch)
tree30aa8ae2b51a7f8921f6014844bfecda8e160ae5
parent59e90176334eee9bfc86c63c8bf29ef9f0ddbd9a (diff)
sdhci: tegra: Enable SDHCI_QUIRK_BROKEN_CARD_DETECTION
Enabling SDHCI_QUIRK_BROKEN_CARD_DETECTION. For non- removable cards, always set card_present as true. Bug 827470 Change-Id: I1148984e4dff314173b88373e1494379abce31f3 Reviewed-on: http://git-master/r/31990 Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com> Tested-by: Pavan Kunapuli <pkunapuli@nvidia.com> Reviewed-by: Suresh Mangipudi <smangipudi@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
-rw-r--r--drivers/mmc/host/sdhci-tegra.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index edf0dc63dc0a..762b32bb00ac 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -41,6 +41,7 @@ struct tegra_sdhci_host {
bool card_always_on;
u32 sdhci_ints;
int wp_gpio;
+ int card_present;
};
static irqreturn_t carddetect_irq(int irq, void *data)
@@ -86,6 +87,13 @@ static void tegra_sdhci_set_clock(struct sdhci_host *sdhci, unsigned int clock)
tegra_sdhci_enable_clock(host, clock);
}
+static int tegra_sdhci_card_detect(struct sdhci_host *sdhost)
+{
+ struct tegra_sdhci_host *host = sdhci_priv(sdhost);
+
+ return host->card_present;
+}
+
static int tegra_sdhci_get_ro(struct sdhci_host *sdhci)
{
struct tegra_sdhci_host *host;
@@ -99,6 +107,7 @@ static struct sdhci_ops tegra_sdhci_ops = {
.enable_dma = tegra_sdhci_enable_dma,
.set_clock = tegra_sdhci_set_clock,
.get_ro = tegra_sdhci_get_ro,
+ .card_detect = tegra_sdhci_card_detect,
};
static int __devinit tegra_sdhci_probe(struct platform_device *pdev)
@@ -163,7 +172,8 @@ static int __devinit tegra_sdhci_probe(struct platform_device *pdev)
SDHCI_QUIRK_8_BIT_DATA |
SDHCI_QUIRK_NO_VERSION_REG |
SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
- SDHCI_QUIRK_RUNTIME_DISABLE;
+ SDHCI_QUIRK_RUNTIME_DISABLE |
+ SDHCI_QUIRK_BROKEN_CARD_DETECTION;
if (plat->force_hs != 0)
sdhci->quirks |= SDHCI_QUIRK_FORCE_HIGH_SPEED_MODE;
@@ -194,6 +204,8 @@ static int __devinit tegra_sdhci_probe(struct platform_device *pdev)
plat->register_status_notify(
tegra_sdhci_status_notify_cb, sdhci);
}
+ if (plat->cd_gpio == -1)
+ host->card_present = true;
if (plat->board_probe)
plat->board_probe(pdev->id, sdhci->mmc);