diff options
author | Andrey Smirnov <andrew.smirnov@gmail.com> | 2017-01-10 07:09:12 -0800 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-01-12 07:42:33 +0100 |
commit | 8108b5a81b1dacd9eb8d82cd2f7530b916015e14 (patch) | |
tree | 58d75354bdc69f62be927236e276c913593e7cab /drivers/usb | |
parent | 024f720adc34df6a4cb6a981ffc0fa6d1677eda7 (diff) | |
download | barebox-8108b5a81b1dacd9eb8d82cd2f7530b916015e14.tar.gz barebox-8108b5a81b1dacd9eb8d82cd2f7530b916015e14.tar.xz |
i.MX: imx-usb-misc: Add Vybrid support
Add code to do usbmisc initialization on VF610 family of SoCs. Based on
analogous code from Linux kernel.
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/imx/imx-usb-misc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/usb/imx/imx-usb-misc.c b/drivers/usb/imx/imx-usb-misc.c index 7c18ca2a18..9cae44056c 100644 --- a/drivers/usb/imx/imx-usb-misc.c +++ b/drivers/usb/imx/imx-usb-misc.c @@ -422,6 +422,28 @@ static __maybe_unused struct imx_usb_misc_data mx6_data = { .post_init = mx6_post_init, }; +#define VF610_OVER_CUR_DIS BIT(7) + +static __maybe_unused int vf610_initialize_usb_hw(void __iomem *base, int port, + unsigned int flags) +{ + u32 reg; + + if (port >= 1) + return -EINVAL; + + if (flags & MXC_EHCI_DISABLE_OVERCURRENT) { + reg = readl(base); + writel(reg | VF610_OVER_CUR_DIS, base); + } + + return 0; +} + +static __maybe_unused struct imx_usb_misc_data vf610_data = { + .init = vf610_initialize_usb_hw, +}; + static struct platform_device_id imx_usbmisc_ids[] = { #ifdef CONFIG_ARCH_IMX25 { @@ -519,6 +541,12 @@ static __maybe_unused struct of_device_id imx_usbmisc_dt_ids[] = { .data = &mx6_data, }, #endif +#ifdef CONFIG_ARCH_VF610 + { + .compatible = "fsl,vf610-usbmisc", + .data = &vf610_data, + }, +#endif { /* sentinel */ }, |