]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00142266-2 eSDHC:Add the GPIO CD/WP on MX5x boards
authorRichard Zhu <r65037@freescale.com>
Mon, 18 Apr 2011 06:52:50 +0000 (14:52 +0800)
committerOliver Wendt <ow@karo-electronics.de>
Mon, 30 Sep 2013 12:08:59 +0000 (14:08 +0200)
sdhc: add the CD/WP on the MX5x boards

Signed-off-by: Richard Zhu <r65037@freescale.com>
drivers/mmc/host/sdhci-esdhc-imx.c

index 6fe8cede417986116f44bffc989b4f7264380b50..0cc60ef540e3713f68584df91320d13f25dfbac4 100644 (file)
@@ -247,17 +247,24 @@ static int esdhc_pltfm_init(struct sdhci_host *host, struct sdhci_pltfm_data *pd
 
        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;
 }