diff options
Diffstat (limited to 'drivers/mmc/host/sdhci-iproc.c')
-rw-r--r-- | drivers/mmc/host/sdhci-iproc.c | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/drivers/mmc/host/sdhci-iproc.c b/drivers/mmc/host/sdhci-iproc.c index 3b423b0ad..1110f73b0 100644 --- a/drivers/mmc/host/sdhci-iproc.c +++ b/drivers/mmc/host/sdhci-iproc.c @@ -26,6 +26,7 @@ struct sdhci_iproc_data { const struct sdhci_pltfm_data *pdata; u32 caps; u32 caps1; + u32 mmc_caps; }; struct sdhci_iproc_host { @@ -165,9 +166,25 @@ static const struct sdhci_iproc_data iproc_data = { .pdata = &sdhci_iproc_pltfm_data, .caps = 0x05E90000, .caps1 = 0x00000064, + .mmc_caps = MMC_CAP_1_8V_DDR, +}; + +static const struct sdhci_pltfm_data sdhci_bcm2835_pltfm_data = { + .quirks = SDHCI_QUIRK_BROKEN_CARD_DETECTION | + SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | + SDHCI_QUIRK_MISSING_CAPS, + .ops = &sdhci_iproc_ops, +}; + +static const struct sdhci_iproc_data bcm2835_data = { + .pdata = &sdhci_bcm2835_pltfm_data, + .caps = SDHCI_CAN_VDD_330, + .caps1 = 0x00000000, + .mmc_caps = 0x00000000, }; static const struct of_device_id sdhci_iproc_of_match[] = { + { .compatible = "brcm,bcm2835-sdhci", .data = &bcm2835_data }, { .compatible = "brcm,sdhci-iproc-cygnus", .data = &iproc_data }, { } }; @@ -199,32 +216,37 @@ static int sdhci_iproc_probe(struct platform_device *pdev) mmc_of_parse(host->mmc); sdhci_get_of_property(pdev); - /* Enable EMMC 1/8V DDR capable */ - host->mmc->caps |= MMC_CAP_1_8V_DDR; + host->mmc->caps |= iproc_host->data->mmc_caps; pltfm_host->clk = devm_clk_get(&pdev->dev, NULL); if (IS_ERR(pltfm_host->clk)) { ret = PTR_ERR(pltfm_host->clk); goto err; } + ret = clk_prepare_enable(pltfm_host->clk); + if (ret) { + dev_err(&pdev->dev, "failed to enable host clk\n"); + goto err; + } if (iproc_host->data->pdata->quirks & SDHCI_QUIRK_MISSING_CAPS) { host->caps = iproc_host->data->caps; host->caps1 = iproc_host->data->caps1; } - return sdhci_add_host(host); + ret = sdhci_add_host(host); + if (ret) + goto err_clk; + + return 0; +err_clk: + clk_disable_unprepare(pltfm_host->clk); err: sdhci_pltfm_free(pdev); return ret; } -static int sdhci_iproc_remove(struct platform_device *pdev) -{ - return sdhci_pltfm_unregister(pdev); -} - static struct platform_driver sdhci_iproc_driver = { .driver = { .name = "sdhci-iproc", @@ -232,7 +254,7 @@ static struct platform_driver sdhci_iproc_driver = { .pm = SDHCI_PLTFM_PMOPS, }, .probe = sdhci_iproc_probe, - .remove = sdhci_iproc_remove, + .remove = sdhci_pltfm_unregister, }; module_platform_driver(sdhci_iproc_driver); |