mmc: sdhci-imx-esdhc: adopt pinctrl support
authorDong Aisheng <dong.aisheng@linaro.org>
Fri, 11 May 2012 06:56:01 +0000 (14:56 +0800)
committerShawn Guo <shawn.guo@linaro.org>
Fri, 11 May 2012 06:56:01 +0000 (14:56 +0800)
Cc: linux-mmc@vger.kernel.org
Cc: Chris Ball <cjb@laptop.org>
Signed-off-by: Dong Aisheng <dong.aisheng@linaro.org>
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
drivers/mmc/host/sdhci-esdhc-imx.c

index 8abdaf6697a8db6e0bf0949e9c54900cb2ac0889..d190d04636a714e87da50a3f8748b17347ca225f 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/of.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
+#include <linux/pinctrl/consumer.h>
 #include <mach/esdhc.h>
 #include "sdhci-pltfm.h"
 #include "sdhci-esdhc.h"
@@ -68,6 +69,7 @@ struct pltfm_imx_data {
        int flags;
        u32 scratchpad;
        enum imx_esdhc_type devtype;
+       struct pinctrl *pinctrl;
        struct esdhc_platform_data boarddata;
 };
 
@@ -467,6 +469,12 @@ static int __devinit sdhci_esdhc_imx_probe(struct platform_device *pdev)
        clk_prepare_enable(clk);
        pltfm_host->clk = clk;
 
+       imx_data->pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(imx_data->pinctrl)) {
+               err = PTR_ERR(imx_data->pinctrl);
+               goto pin_err;
+       }
+
        host->quirks |= SDHCI_QUIRK_BROKEN_TIMEOUT_VAL;
 
        if (is_imx25_esdhc(imx_data) || is_imx35_esdhc(imx_data))
@@ -558,6 +566,7 @@ no_card_detect_irq:
                gpio_free(boarddata->wp_gpio);
 no_card_detect_pin:
 no_board_data:
+pin_err:
        clk_disable_unprepare(pltfm_host->clk);
        clk_put(pltfm_host->clk);
 err_clk_get: