>From 7f3529c21815990ebe4eec684e3c96156f774637 Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei....@marvell.com>
Date: Thu, 28 Oct 2010 10:44:15 -0400
Subject: [PATCH] sdhci-pxa: add MMC_CAP_NONREMOVABLE for on-chip device

        To share SDHCI_QUIRK_BROKEN_CARD_DETECTION for on-chip device,
MMC_CAP_NONREMOVABLE also needed, otherwise polling mode used by
default

Signed-off-by: Zhangfei Gao <zhangfei....@marvell.com>
CC: Philip Rakity <prak...@marvell.com>
---
 arch/arm/plat-pxa/include/plat/sdhci.h |    2 ++
 drivers/mmc/host/sdhci-pxa.c           |    8 ++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-pxa/include/plat/sdhci.h
b/arch/arm/plat-pxa/include/plat/sdhci.h
index e49c5b6..fc5ceab 100644
--- a/arch/arm/plat-pxa/include/plat/sdhci.h
+++ b/arch/arm/plat-pxa/include/plat/sdhci.h
@@ -16,6 +16,8 @@
 /* pxa specific flag */
 /* Require clock free running */
 #define PXA_FLAG_DISABLE_CLOCK_GATING (1<<0)
+/* card alwayes wired to host, like on-chip emmc */
+#define PXA_FLAG_CARD_PERMANENT        (1<<1)

 /*
  * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI
diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index fc406ac..a88c797 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -138,6 +138,12 @@ static int __devinit sdhci_pxa_probe(struct
platform_device *pdev)
        host->irq = irq;
        host->quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;

+       if (pxa->pdata->flags & PXA_FLAG_CARD_PERMANENT) {
+               /* on-chip device */
+               host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+               host->mmc->caps = MMC_CAP_NONREMOVABLE;
+       }
+
        if (pdata->quirks)
                host->quirks |= pdata->quirks;

@@ -149,6 +155,8 @@ static int __devinit sdhci_pxa_probe(struct
platform_device *pdev)

        if (pxa->pdata->max_speed)
                host->mmc->f_max = pxa->pdata->max_speed;
+       else
+               host->mmc->f_max = 50000000;

        platform_set_drvdata(pdev, host);

-- 
1.7.0.4
From 7f3529c21815990ebe4eec684e3c96156f774637 Mon Sep 17 00:00:00 2001
From: Zhangfei Gao <zhangfei....@marvell.com>
Date: Thu, 28 Oct 2010 10:44:15 -0400
Subject: [PATCH] sdhci-pxa: add MMC_CAP_NONREMOVABLE for on-chip device

        To share SDHCI_QUIRK_BROKEN_CARD_DETECTION for on-chip device, MMC_CAP_NONREMOVABLE also needed, otherwise polling mode used by default

Signed-off-by: Zhangfei Gao <zhangfei....@marvell.com>
CC: Philip Rakity <prak...@marvell.com>
---
 arch/arm/plat-pxa/include/plat/sdhci.h |    2 ++
 drivers/mmc/host/sdhci-pxa.c           |    8 ++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/arch/arm/plat-pxa/include/plat/sdhci.h b/arch/arm/plat-pxa/include/plat/sdhci.h
index e49c5b6..fc5ceab 100644
--- a/arch/arm/plat-pxa/include/plat/sdhci.h
+++ b/arch/arm/plat-pxa/include/plat/sdhci.h
@@ -16,6 +16,8 @@
 /* pxa specific flag */
 /* Require clock free running */
 #define PXA_FLAG_DISABLE_CLOCK_GATING (1<<0)
+/* card alwayes wired to host, like on-chip emmc */
+#define PXA_FLAG_CARD_PERMANENT	(1<<1)
 
 /*
  * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI
diff --git a/drivers/mmc/host/sdhci-pxa.c b/drivers/mmc/host/sdhci-pxa.c
index fc406ac..a88c797 100644
--- a/drivers/mmc/host/sdhci-pxa.c
+++ b/drivers/mmc/host/sdhci-pxa.c
@@ -138,6 +138,12 @@ static int __devinit sdhci_pxa_probe(struct platform_device *pdev)
 	host->irq = irq;
 	host->quirks = SDHCI_QUIRK_BROKEN_ADMA | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
+	if (pxa->pdata->flags & PXA_FLAG_CARD_PERMANENT) {
+		/* on-chip device */
+		host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+		host->mmc->caps = MMC_CAP_NONREMOVABLE;
+	}
+
 	if (pdata->quirks)
 		host->quirks |= pdata->quirks;
 
@@ -149,6 +155,8 @@ static int __devinit sdhci_pxa_probe(struct platform_device *pdev)
 
 	if (pxa->pdata->max_speed)
 		host->mmc->f_max = pxa->pdata->max_speed;
+	else
+		host->mmc->f_max = 50000000;
 
 	platform_set_drvdata(pdev, host);
 
-- 
1.7.0.4

Reply via email to