USB: chipidea: imx: add pinctrl support
authorRichard Zhao <richard.zhao@freescale.com>
Wed, 12 Sep 2012 11:58:06 +0000 (14:58 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Sep 2012 18:20:38 +0000 (11:20 -0700)
Some controllers may not need to setup pinctrl, so we don't fail the
probe if pinctrl get/select failed.

Tested-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Tested-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/chipidea/ci13xxx_imx.c

index 96ac67bbd2db4c3b74545db13e9c2b2f288bfc8d..0f5ca4bea17f5e52b60c818f85048254c8522f53 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/usb/chipidea.h>
 #include <linux/clk.h>
 #include <linux/regulator/consumer.h>
+#include <linux/pinctrl/consumer.h>
 
 #include "ci.h"
 #include "ci13xxx_imx.h"
@@ -99,6 +100,7 @@ static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
        struct device_node *phy_np;
        struct resource *res;
        struct regulator *reg_vbus;
+       struct pinctrl *pinctrl;
        int ret;
 
        if (of_find_property(pdev->dev.of_node, "fsl,usbmisc", NULL)
@@ -117,6 +119,11 @@ static int __devinit ci13xxx_imx_probe(struct platform_device *pdev)
                return -ENOENT;
        }
 
+       pinctrl = devm_pinctrl_get_select_default(&pdev->dev);
+       if (IS_ERR(pinctrl))
+               dev_warn(&pdev->dev, "pinctrl get/select failed, err=%ld\n",
+                       PTR_ERR(pinctrl));
+
        data->clk = devm_clk_get(&pdev->dev, NULL);
        if (IS_ERR(data->clk)) {
                dev_err(&pdev->dev,