aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
authorArnaud Patard (Rtp) <arnaud.patard@rtp-net.org>2011-01-17 18:04:12 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-01-22 21:48:10 -0500
commita464dc4d4044c936d4558725fa2229fb4a1aa932 (patch)
treea551fcf656c2a3bb489efc0f7e71f6bf6958c053 /drivers/usb
parent3bb8029a2445e289efade6133b01545143336f70 (diff)
USB: ehci-mxc: add work-around for efika mx/sb bug
Add support for setting CHRGVBUS to workaround a hardware bug on efika mx/sb boards. See http://lists.infradead.org/pipermail/linux-arm-kernel/2011-January/037341.html Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/host/ehci-mxc.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/usb/host/ehci-mxc.c b/drivers/usb/host/ehci-mxc.c
index d443fbd8535b..c8e360d7d975 100644
--- a/drivers/usb/host/ehci-mxc.c
+++ b/drivers/usb/host/ehci-mxc.c
@@ -21,10 +21,13 @@
21#include <linux/clk.h> 21#include <linux/clk.h>
22#include <linux/delay.h> 22#include <linux/delay.h>
23#include <linux/usb/otg.h> 23#include <linux/usb/otg.h>
24#include <linux/usb/ulpi.h>
24#include <linux/slab.h> 25#include <linux/slab.h>
25 26
26#include <mach/mxc_ehci.h> 27#include <mach/mxc_ehci.h>
27 28
29#include <asm/mach-types.h>
30
28#define ULPI_VIEWPORT_OFFSET 0x170 31#define ULPI_VIEWPORT_OFFSET 0x170
29 32
30struct ehci_mxc_priv { 33struct ehci_mxc_priv {
@@ -114,6 +117,7 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
114 struct usb_hcd *hcd; 117 struct usb_hcd *hcd;
115 struct resource *res; 118 struct resource *res;
116 int irq, ret; 119 int irq, ret;
120 unsigned int flags;
117 struct ehci_mxc_priv *priv; 121 struct ehci_mxc_priv *priv;
118 struct device *dev = &pdev->dev; 122 struct device *dev = &pdev->dev;
119 struct ehci_hcd *ehci; 123 struct ehci_hcd *ehci;
@@ -240,6 +244,23 @@ static int ehci_mxc_drv_probe(struct platform_device *pdev)
240 if (ret) 244 if (ret)
241 goto err_add; 245 goto err_add;
242 246
247 if (pdata->otg) {
248 /*
249 * efikamx and efikasb have some hardware bug which is
250 * preventing usb to work unless CHRGVBUS is set.
251 * It's in violation of USB specs
252 */
253 if (machine_is_mx51_efikamx() || machine_is_mx51_efikasb()) {
254 flags = otg_io_read(pdata->otg, ULPI_OTG_CTRL);
255 flags |= ULPI_OTG_CTRL_CHRGVBUS;
256 ret = otg_io_write(pdata->otg, flags, ULPI_OTG_CTRL);
257 if (ret) {
258 dev_err(dev, "unable to set CHRVBUS\n");
259 goto err_add;
260 }
261 }
262 }
263
243 return 0; 264 return 0;
244 265
245err_add: 266err_add: