aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/mmc/host/sdhci-of.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-of.c b/drivers/mmc/host/sdhci-of.c
index 56041dc74ce1..c8dab07e34b8 100644
--- a/drivers/mmc/host/sdhci-of.c
+++ b/drivers/mmc/host/sdhci-of.c
@@ -21,6 +21,7 @@
21#include <linux/of.h> 21#include <linux/of.h>
22#include <linux/of_platform.h> 22#include <linux/of_platform.h>
23#include <linux/mmc/host.h> 23#include <linux/mmc/host.h>
24#include <asm/machdep.h>
24#include "sdhci.h" 25#include "sdhci.h"
25 26
26struct sdhci_of_data { 27struct sdhci_of_data {
@@ -175,7 +176,6 @@ static unsigned int esdhc_get_min_clock(struct sdhci_host *host)
175static struct sdhci_of_data sdhci_esdhc = { 176static struct sdhci_of_data sdhci_esdhc = {
176 .quirks = SDHCI_QUIRK_FORCE_BLK_SZ_2048 | 177 .quirks = SDHCI_QUIRK_FORCE_BLK_SZ_2048 |
177 SDHCI_QUIRK_BROKEN_CARD_DETECTION | 178 SDHCI_QUIRK_BROKEN_CARD_DETECTION |
178 SDHCI_QUIRK_INVERTED_WRITE_PROTECT |
179 SDHCI_QUIRK_NO_BUSY_IRQ | 179 SDHCI_QUIRK_NO_BUSY_IRQ |
180 SDHCI_QUIRK_NONSTANDARD_CLOCK | 180 SDHCI_QUIRK_NONSTANDARD_CLOCK |
181 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK | 181 SDHCI_QUIRK_DATA_TIMEOUT_USES_SDCLK |
@@ -219,6 +219,15 @@ static int sdhci_of_resume(struct of_device *ofdev)
219 219
220#endif 220#endif
221 221
222static bool __devinit sdhci_of_wp_inverted(struct device_node *np)
223{
224 if (of_get_property(np, "sdhci,wp-inverted", NULL))
225 return true;
226
227 /* Old device trees don't have the wp-inverted property. */
228 return machine_is(mpc837x_rdb) || machine_is(mpc837x_mds);
229}
230
222static int __devinit sdhci_of_probe(struct of_device *ofdev, 231static int __devinit sdhci_of_probe(struct of_device *ofdev,
223 const struct of_device_id *match) 232 const struct of_device_id *match)
224{ 233{
@@ -261,6 +270,9 @@ static int __devinit sdhci_of_probe(struct of_device *ofdev,
261 if (of_get_property(np, "sdhci,1-bit-only", NULL)) 270 if (of_get_property(np, "sdhci,1-bit-only", NULL))
262 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA; 271 host->quirks |= SDHCI_QUIRK_FORCE_1_BIT_DATA;
263 272
273 if (sdhci_of_wp_inverted(np))
274 host->quirks |= SDHCI_QUIRK_INVERTED_WRITE_PROTECT;
275
264 clk = of_get_property(np, "clock-frequency", &size); 276 clk = of_get_property(np, "clock-frequency", &size);
265 if (clk && size == sizeof(*clk) && *clk) 277 if (clk && size == sizeof(*clk) && *clk)
266 of_host->clock = *clk; 278 of_host->clock = *clk;