Skip to content

Commit

Permalink
USB: chipidea: imx: add pinctrl support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Richard Zhao authored and Greg Kroah-Hartman committed Sep 12, 2012
1 parent d142d6b commit b4dbb25
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/usb/chipidea/ci13xxx_imx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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,
Expand Down

0 comments on commit b4dbb25

Please sign in to comment.