]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
mmc: omap_hsmmc: claim pinctrl at probe time
authorDaniel Mack <zonque@gmail.com>
Mon, 15 Oct 2012 16:05:05 +0000 (21:35 +0530)
committerChris Ball <cjb@laptop.org>
Mon, 29 Oct 2012 16:53:48 +0000 (12:53 -0400)
This allows DT-driven board to set up the pin mux only when the driver
is in use.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Venkatraman S <svenkatr@ti.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/host/omap_hsmmc.c

index 54bfd0cc106b92280cd75818310d81aa56c48ccb..01eeeaefa6bcde3ee15fcfa8c96131fc7d5732d9 100644 (file)
@@ -37,6 +37,7 @@
 #include <linux/io.h>
 #include <linux/gpio.h>
 #include <linux/regulator/consumer.h>
+#include <linux/pinctrl/consumer.h>
 #include <linux/pm_runtime.h>
 #include <mach/hardware.h>
 #include <plat/mmc.h>
@@ -1720,6 +1721,7 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
        const struct of_device_id *match;
        dma_cap_mask_t mask;
        unsigned tx_req, rx_req;
+       struct pinctrl *pinctrl;
 
        match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
        if (match) {
@@ -1923,6 +1925,11 @@ static int __devinit omap_hsmmc_probe(struct platform_device *pdev)
 
        omap_hsmmc_disable_irq(host);
 
+       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(pinctrl))
+               dev_warn(&pdev->dev,
+                       "pins are not configured from the driver\n");
+
        omap_hsmmc_protect_card(host);
 
        mmc_add_host(mmc);