aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc
diff options
context:
space:
mode:
authorFabio Estevam <fabio.estevam@freescale.com>2015-04-08 09:17:44 -0400
committerUlf Hansson <ulf.hansson@linaro.org>2015-04-09 03:14:41 -0400
commit8d86e4fcccf61bafe54212f6ea9fb47a455abc56 (patch)
treed6b0930547d2535c3322f0dbfddc1d8f4da5e0da /drivers/mmc
parent49ba030221d23ad8e35deb66b74873b852f4d7bf (diff)
mmc: sdhci-esdhc-imx: Call mmc_of_parse()
Currently it is not possible to use 'mmc-pwrseq-simple' property with this driver because mmc_of_parse() is never called. mmc_of_parse() calls mmc_pwrseq_alloc() that manages MMC power sequence and allows passing GPIOs in the devicetree to properly power/reset the Wifi chipset. When using mmc_of_parse() we no longer need to have custom code to request card-detect and write-protect pins, as this can now be handled by the mmc core. Tested on a imx6sl-warp board where BT/Wifi is functional and also on a imx6q-sabresd. Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-esdhc-imx.c38
1 files changed, 6 insertions, 32 deletions
diff --git a/drivers/mmc/host/sdhci-esdhc-imx.c b/drivers/mmc/host/sdhci-esdhc-imx.c
index 7ee831255f50..82f512d87cb8 100644
--- a/drivers/mmc/host/sdhci-esdhc-imx.c
+++ b/drivers/mmc/host/sdhci-esdhc-imx.c
@@ -1013,40 +1013,9 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
1013 host->mmc->parent->platform_data); 1013 host->mmc->parent->platform_data);
1014 } 1014 }
1015 1015
1016 /* write_protect */
1017 if (boarddata->wp_type == ESDHC_WP_GPIO) {
1018 err = mmc_gpio_request_ro(host->mmc, boarddata->wp_gpio);
1019 if (err) {
1020 dev_err(mmc_dev(host->mmc),
1021 "failed to request write-protect gpio!\n");
1022 goto disable_clk;
1023 }
1024 host->mmc->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
1025 }
1026
1027 /* card_detect */ 1016 /* card_detect */
1028 switch (boarddata->cd_type) { 1017 if (boarddata->cd_type == ESDHC_CD_CONTROLLER)
1029 case ESDHC_CD_GPIO:
1030 err = mmc_gpio_request_cd(host->mmc, boarddata->cd_gpio, 0);
1031 if (err) {
1032 dev_err(mmc_dev(host->mmc),
1033 "failed to request card-detect gpio!\n");
1034 goto disable_clk;
1035 }
1036 /* fall through */
1037
1038 case ESDHC_CD_CONTROLLER:
1039 /* we have a working card_detect back */
1040 host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION; 1018 host->quirks &= ~SDHCI_QUIRK_BROKEN_CARD_DETECTION;
1041 break;
1042
1043 case ESDHC_CD_PERMANENT:
1044 host->mmc->caps |= MMC_CAP_NONREMOVABLE;
1045 break;
1046
1047 case ESDHC_CD_NONE:
1048 break;
1049 }
1050 1019
1051 switch (boarddata->max_bus_width) { 1020 switch (boarddata->max_bus_width) {
1052 case 8: 1021 case 8:
@@ -1079,6 +1048,11 @@ static int sdhci_esdhc_imx_probe(struct platform_device *pdev)
1079 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; 1048 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
1080 } 1049 }
1081 1050
1051 /* call to generic mmc_of_parse to support additional capabilities */
1052 err = mmc_of_parse(host->mmc);
1053 if (err)
1054 goto disable_clk;
1055
1082 err = sdhci_add_host(host); 1056 err = sdhci_add_host(host);
1083 if (err) 1057 if (err)
1084 goto disable_clk; 1058 goto disable_clk;