summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPavan Kunapuli <pkunapuli@nvidia.com>2012-03-05 19:19:16 +0530
committerSimone Willett <swillett@nvidia.com>2012-03-06 18:51:03 -0800
commit3bbead1710a643704350ea4d86caa4104a7b7d56 (patch)
treee8bf6b8654fd0c100d61a0581c915ac39d0cda3d /drivers
parent41feccc1d2555db3b16553838e59f43d0674a541 (diff)
mmc: tegra: Enable SDHCI_QUIRK_BROKEN_CARD_DETECTION
Enable quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION. Also, implemented tegra_sdhci_get_cd() to return the card presence status. Bug 948943 Change-Id: I42eed23f951304e331a235f5a9199b70ba5e96b5 Signed-off-by: Pavan Kunapuli <pkunapuli@nvidia.com> Reviewed-on: http://git-master/r/87766 Reviewed-by: Simone Willett <swillett@nvidia.com> Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/sdhci-tegra.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index fb728291ffe8..2276fdeec50f 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -162,6 +162,14 @@ static void tegra_sdhci_writel(struct sdhci_host *host, u32 val, int reg)
#endif
}
+static unsigned int tegra_sdhci_get_cd(struct sdhci_host *sdhci)
+{
+ struct sdhci_pltfm_host *pltfm_host = sdhci_priv(sdhci);
+ struct tegra_sdhci_host *tegra_host = pltfm_host->priv;
+
+ return tegra_host->card_present;
+}
+
static unsigned int tegra_sdhci_get_ro(struct sdhci_host *sdhci)
{
struct platform_device *pdev = to_platform_device(mmc_dev(sdhci->mmc));
@@ -861,6 +869,7 @@ static int tegra_sdhci_resume(struct sdhci_host *sdhci)
static struct sdhci_ops tegra_sdhci_ops = {
.get_ro = tegra_sdhci_get_ro,
+ .get_cd = tegra_sdhci_get_cd,
.read_l = tegra_sdhci_readl,
.read_w = tegra_sdhci_readw,
.write_l = tegra_sdhci_writel,
@@ -887,7 +896,8 @@ static struct sdhci_pltfm_data sdhci_tegra_pdata = {
SDHCI_QUIRK_SINGLE_POWER_WRITE |
SDHCI_QUIRK_NO_HISPD_BIT |
SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC |
- SDHCI_QUIRK_NO_CALC_MAX_DISCARD_TO,
+ SDHCI_QUIRK_NO_CALC_MAX_DISCARD_TO |
+ SDHCI_QUIRK_BROKEN_CARD_DETECTION,
.ops = &tegra_sdhci_ops,
};
@@ -987,6 +997,12 @@ static int __devinit sdhci_tegra_probe(struct platform_device *pdev)
gpio_direction_input(plat->wp_gpio);
}
+ /*
+ * If there is no card detect gpio, assume that the
+ * card is always present.
+ */
+ if (!gpio_is_valid(plat->cd_gpio))
+ tegra_host->card_present = 1;
if (!plat->mmc_data.built_in) {
if (plat->mmc_data.ocr_mask & SDHOST_1V8_OCR_MASK) {