aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/sdhci-pltfm.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/sdhci-pltfm.c')
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c56
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index c5b01d6bb85d..a207f5aaf62f 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -75,43 +75,41 @@ void sdhci_get_of_property(struct platform_device *pdev)
75 u32 bus_width; 75 u32 bus_width;
76 int size; 76 int size;
77 77
78 if (of_device_is_available(np)) { 78 if (of_get_property(np, "sdhci,auto-cmd12", NULL))
79 if (of_get_property(np, "sdhci,auto-cmd12", NULL)) 79 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
80 host->quirks |= SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12;
81 80
82 if (of_get_property(np, "sdhci,1-bit-only", NULL) || 81 if (of_get_property(np, "sdhci,1-bit-only", NULL) ||
83 (of_property_read_u32(np, "bus-width", &bus_width) == 0 && 82 (of_property_read_u32(np, "bus-width", &bus_width) == 0 &&
84 bus_width == 1)) 83 bus_width == 1))
85 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; 84 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
86 85
87 if (sdhci_of_wp_inverted(np)) 86 if (sdhci_of_wp_inverted(np))
88 host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT; 87 host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
89 88
90 if (of_get_property(np, "broken-cd", NULL)) 89 if (of_get_property(np, "broken-cd", NULL))
91 host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION; 90 host->quirks |= SDHCI_QUIRK_BROKEN_CARD_DETECTION;
92 91
93 if (of_get_property(np, "no-1-8-v", NULL)) 92 if (of_get_property(np, "no-1-8-v", NULL))
94 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V; 93 host->quirks2 |= SDHCI_QUIRK2_NO_1_8_V;
95 94
96 if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc")) 95 if (of_device_is_compatible(np, "fsl,p2020-rev1-esdhc"))
97 host->quirks |= SDHCI_QUIRK_BROKEN_DMA; 96 host->quirks |= SDHCI_QUIRK_BROKEN_DMA;
98 97
99 if (of_device_is_compatible(np, "fsl,p2020-esdhc") || 98 if (of_device_is_compatible(np, "fsl,p2020-esdhc") ||
100 of_device_is_compatible(np, "fsl,p1010-esdhc") || 99 of_device_is_compatible(np, "fsl,p1010-esdhc") ||
101 of_device_is_compatible(np, "fsl,t4240-esdhc") || 100 of_device_is_compatible(np, "fsl,t4240-esdhc") ||
102 of_device_is_compatible(np, "fsl,mpc8536-esdhc")) 101 of_device_is_compatible(np, "fsl,mpc8536-esdhc"))
103 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL; 102 host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
104 103
105 clk = of_get_property(np, "clock-frequency", &size); 104 clk = of_get_property(np, "clock-frequency", &size);
106 if (clk && size == sizeof(*clk) && *clk) 105 if (clk && size == sizeof(*clk) && *clk)
107 pltfm_host->clock = be32_to_cpup(clk); 106 pltfm_host->clock = be32_to_cpup(clk);
108 107
109 if (of_find_property(np, "keep-power-in-suspend", NULL)) 108 if (of_find_property(np, "keep-power-in-suspend", NULL))
110 host->mmc->pm_caps |= MMC_PM_KEEP_POWER; 109 host->mmc->pm_caps |= MMC_PM_KEEP_POWER;
111 110
112 if (of_find_property(np, "enable-sdio-wakeup", NULL)) 111 if (of_find_property(np, "enable-sdio-wakeup", NULL))
113 host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ; 112 host->mmc->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
114 }
115} 113}
116#else 114#else
117void sdhci_get_of_property(struct platform_device *pdev) {} 115void sdhci_get_of_property(struct platform_device *pdev) {}
@@ -225,9 +223,11 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_register);
225int sdhci_pltfm_unregister(struct platform_device *pdev) 223int sdhci_pltfm_unregister(struct platform_device *pdev)
226{ 224{
227 struct sdhci_host *host = platform_get_drvdata(pdev); 225 struct sdhci_host *host = platform_get_drvdata(pdev);
226 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host);
228 int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff); 227 int dead = (readl(host->ioaddr + SDHCI_INT_STATUS) == 0xffffffff);
229 228
230 sdhci_remove_host(host, dead); 229 sdhci_remove_host(host, dead);
230 clk_disable_unprepare(pltfm_host->clk);
231 sdhci_pltfm_free(pdev); 231 sdhci_pltfm_free(pdev);
232 232
233 return 0; 233 return 0;