mmc: add DT bindings for more MMC capability flags
authorGuennadi Liakhovetski <g.liakhovetski@gmx.de>
Fri, 15 Feb 2013 15:14:01 +0000 (16:14 +0100)
committerChris Ball <cjb@laptop.org>
Sun, 24 Feb 2013 19:37:25 +0000 (14:37 -0500)
Many MMC capability flags are platform-dependent and are traditionally set
in platform data. With DT often each such capability requires a special
binding. Add bindings for MMC_CAP_SD_HIGHSPEED, MMC_CAP_MMC_HIGHSPEED,
MMC_CAP_POWER_OFF_CARD and MMC_CAP_SDIO_IRQ capabilities. Also add code to
DT parser to look up "keep-power-in-suspend" and "enable-sdio-wakeup"
bindings and set MMC_PM_KEEP_POWER and MMC_PM_WAKE_SDIO_IRQ respectively,
if found.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Chris Ball <cjb@laptop.org>
Documentation/devicetree/bindings/mmc/mmc.txt
drivers/mmc/core/host.c

index 654b705fc5b70d0a1c04f4bd6581fad8024ce3c3..85aada2263d54b9c26717ff89eae95a6ef8507a5 100644 (file)
@@ -24,6 +24,10 @@ Optional properties:
 - max-frequency: maximum operating clock frequency
 - no-1-8-v: when present, denotes that 1.8v card voltage is not supported on
   this system, even if the controller claims it is.
+- cap-sd-highspeed: SD high-speed timing is supported
+- cap-mmc-highspeed: MMC high-speed timing is supported
+- cap-power-off-card: powering off the card is safe
+- cap-sdio-irq: enable SDIO IRQ signalling on this interface
 
 *NOTE* on CD and WP polarity. To use common for all SD/MMC host controllers line
 polarity properties, we have to fix the meaning of the "normal" and "inverted"
index 9c53452e73e17078920e6b885e973fc3b341f0fb..821cd822413724a0b280a56a5a601781baca51b8 100644 (file)
@@ -400,6 +400,19 @@ void mmc_of_parse(struct mmc_host *host)
        }
        if (explicit_inv_wp ^ gpio_inv_wp)
                host->caps2 |= MMC_CAP2_RO_ACTIVE_HIGH;
+
+       if (of_find_property(np, "cap-sd-highspeed", &len))
+               host->caps |= MMC_CAP_SD_HIGHSPEED;
+       if (of_find_property(np, "cap-mmc-highspeed", &len))
+               host->caps |= MMC_CAP_MMC_HIGHSPEED;
+       if (of_find_property(np, "cap-power-off-card", &len))
+               host->caps |= MMC_CAP_POWER_OFF_CARD;
+       if (of_find_property(np, "cap-sdio-irq", &len))
+               host->caps |= MMC_CAP_SDIO_IRQ;
+       if (of_find_property(np, "keep-power-in-suspend", &len))
+               host->pm_caps |= MMC_PM_KEEP_POWER;
+       if (of_find_property(np, "enable-sdio-wakeup", &len))
+               host->pm_caps |= MMC_PM_WAKE_SDIO_IRQ;
 }
 
 EXPORT_SYMBOL(mmc_of_parse);