summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorRichard Zhu <r65037@freescale.com>2011-04-18 14:52:50 +0800
committerJason Liu <r64343@freescale.com>2012-01-09 20:08:17 +0800
commitd5647ed0ae69930ff0f7839829384a2249ee8cf8 (patch)
tree2ff269f86f842fedd13d82441cc0633fa58b489b /drivers/mmc
parentda963e4111fe7ac4012d075ef8d82b54676f379a (diff)
ENGR00142266-2 eSDHC:Add the GPIO CD/WP on MX5x boards
sdhc: add the CD/WP on the MX5x boards Signed-off-by: Richard Zhu <r65037@freescale.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index ba31abee9487..ce56d3ffab77 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -247,17 +247,24 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
if (!cpu_is_mx25())
host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
- if (cpu_is_mx25() || cpu_is_mx35()) {
+ if (cpu_is_mx25() || cpu_is_mx35())
/* Fix errata ENGcm07207 present on i.MX25 and i.MX35 */
host->quirks |= SDHCI_QUIRK_NO_MULTIBLOCK;
- /* write_protect can't be routed to controller, use gpio */
- sdhci_esdhc_ops.get_ro = esdhc_pltfm_get_ro;
- }
+
+ /* write_protect can't be routed to controller, use gpio */
+ sdhci_esdhc_ops.get_ro = esdhc_pltfm_get_ro;
if (!(cpu_is_mx25() || cpu_is_mx35() || cpu_is_mx51()))
imx_data->flags |= ESDHC_FLAG_MULTIBLK_NO_INT;
if (boarddata) {
+ /* Device is always present, e.x, populated emmc device */
+ if (boarddata->always_present) {
+ imx_data->flags |= ESDHC_FLAG_GPIO_FOR_CD_WP;
+ host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
+ return 0;
+ }
+
err = gpio_request_one(boarddata->wp_gpio, GPIOF_IN, "ESDHC_WP");
if (err) {
dev_warn(mmc_dev(host->mmc),
@@ -272,10 +279,6 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
goto no_card_detect_pin;
}
- /* i.MX5x has issues to be researched */
- if (!cpu_is_mx25() && !cpu_is_mx35())
- goto not_supported;
-
err = request_irq(gpio_to_irq(boarddata->cd_gpio), cd_irq,
IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
mmc_hostname(host->mmc), host);
@@ -295,7 +298,6 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
gpio_free(boarddata->cd_gpio);
no_card_detect_pin:
boarddata->cd_gpio = err;
- not_supported:
kfree(imx_data);
return 0;
}