diff options
author | Dong Aisheng <aisheng.dong@freescale.com> | 2015-07-22 08:53:05 -0400 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-07-24 04:18:37 -0400 |
commit | 4800e87a2ee886c1972deb73f057d1a6541edb36 (patch) | |
tree | 4543f0d3d3c9885e7f05a9ddf5619d81487cd583 | |
parent | 1cd55947f2bfdb99a2a741d65c7463d106ef9132 (diff) |
mmc: sdhci-esdhc-imx: fix cd regression for dt platform
Current card detect probe process is that when driver finds a valid
ESDHC_CD_GPIO, it will clear the quirk SDHCI_QUIRK_BROKEN_CARD_DETECTION
which is set by default for all esdhc/usdhc controllers.
Then host driver will know there's a valid card detect function.
Commit 8d86e4fcccf6 ("mmc: sdhci-esdhc-imx: Call mmc_of_parse()")
breaks GPIO CD function for dt platform that it will return directly
when find ESDHC_CD_GPIO for dt platform which result in the later wrongly
to keep SDHCI_QUIRK_BROKEN_CARD_DETECTION for all dt platforms.
Then MMC_CAP_NEEDS_POLL will be used instead even there's a valid
GPIO card detect.
This patch adds back this function and follows the original approach to
clear the quirk if find an valid CD GPIO for dt platforms.
Fixes: 8d86e4fcccf6 ("mmc: sdhci-esdhc-imx: Call mmc_of_parse()")
Signed-off-by: Dong Aisheng <aisheng.dong@freescale.com>
Reviewed-by: Johan Derycke <johan.derycke@barco.com>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
-rw-r--r-- | drivers/mmc/host/sdhci-esdhc-imx.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c index faf0cb910c96..48153917ed08 100644 --- a/drivers/mmc/host/sdhci-esdhc-imx.c +++ b/drivers/mmc/host/sdhci-esdhc-imx.c | |||
@@ -881,6 +881,7 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, | |||
881 | struct esdhc_platform_data *boarddata) | 881 | struct esdhc_platform_data *boarddata) |
882 | { | 882 | { |
883 | struct device_node *np = pdev->dev.of_node; | 883 | struct device_node *np = pdev->dev.of_node; |
884 | int ret; | ||
884 | 885 | ||
885 | if (!np) | 886 | if (!np) |
886 | return -ENODEV; | 887 | return -ENODEV; |
@@ -917,7 +918,14 @@ sdhci_esdhc_imx_probe_dt(struct platform_device *pdev, | |||
917 | mmc_of_parse_voltage(np, &host->ocr_mask); | 918 | mmc_of_parse_voltage(np, &host->ocr_mask); |
918 | 919 | ||
919 | /* call to generic mmc_of_parse to support additional capabilities */ | 920 | /* call to generic mmc_of_parse to support additional capabilities */ |
920 | return mmc_of_parse(host->mmc); | 921 | ret = mmc_of_parse(host->mmc); |
922 | if (ret) | ||
923 | return ret; | ||
924 | |||
925 | if (!IS_ERR_VALUE(mmc_gpio_get_cd(host->mmc))) | ||
926 | host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; | ||
927 | |||
928 | return 0; | ||
921 | } | 929 | } |
922 | #else | 930 | #else |
923 | static inline int | 931 | static inline int |