aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Zhu <r65037@freescale.com>2011-04-18 14:52:50 +0800
committerRichard Zhao <richard.zhao@freescale.com>2011-04-19 16:25:59 +0800
commitab871fff4947fef4f64220377ad45256dc543ef0 (patch)
tree689e5520e8f3a637e72f337f821360d8a8421710
parenteeee959d20493e06bd677522f4f74a99dc8dc9c3 (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> Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
-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 a19967d0bfc..3ef52006046 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;
}