diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-01-13 12:17:34 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-01-19 15:21:14 +0100 |
commit | bbe0df90b8e2463dd8db651e9f1dd57702985d2d (patch) | |
tree | 22a09ec0a92d50df452dbe2070575e3c8877b746 | |
parent | 2eb99b610bf321eb56aba5d72d1b4ff346823374 (diff) | |
download | barebox-bbe0df90b8e2463dd8db651e9f1dd57702985d2d.tar.gz barebox-bbe0df90b8e2463dd8db651e9f1dd57702985d2d.tar.xz |
usb: imx: Add clock support
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | drivers/usb/imx/chipidea-imx.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/drivers/usb/imx/chipidea-imx.c b/drivers/usb/imx/chipidea-imx.c index f4354876cf..ccd5346133 100644 --- a/drivers/usb/imx/chipidea-imx.c +++ b/drivers/usb/imx/chipidea-imx.c @@ -27,6 +27,7 @@ #include <usb/fsl_usb2.h> #include <linux/err.h> #include <linux/phy/phy.h> +#include <linux/clk.h> #define MXC_EHCI_PORTSC_MASK ((0xf << 28) | (1 << 25)) @@ -44,6 +45,7 @@ struct imx_chipidea { struct regulator *vbus; struct phy *phy; struct usb_phy *usbphy; + struct clk *clk; }; static int imx_chipidea_port_init(void *drvdata) @@ -268,6 +270,17 @@ static int imx_chipidea_probe(struct device_d *dev) if (IS_ERR(ci->vbus)) ci->vbus = NULL; + /* + * Some devices have more than one clock, in this case they are enabled + * by default in the clock driver. At least enable the main clock for + * devices which have only one. + */ + ci->clk = clk_get(dev, NULL); + if (IS_ERR(ci->clk)) + return PTR_ERR(ci->clk); + + clk_enable(ci->clk); + if (of_property_read_bool(dev->device_node, "fsl,usbphy")) { ci->phy = of_phy_get_by_phandle(dev, "fsl,usbphy", 0); if (IS_ERR(ci->phy)) { |