Skip to content

Commit

Permalink
usb: otg: jz4780_platform: Switch off OTG PHY overcurrent warnings
Browse files Browse the repository at this point in the history
Previously, the kernel log would be spammed with messages about an
overcurrent change being detected on the OTG port. Ingenic worked
around this in their 3.0.8 kernel by setting a bit in one of the
OTG controller's registers that would disable the warning. This
commit implements the same workaround, but for the 3.18 kernel.
  • Loading branch information
HarveyHunt committed Jun 24, 2015
1 parent 8ef5089 commit 60fa528
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/usb/dwc2/jz4780_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
#include "core.h"
#include "hcd.h"

#define USBRESET_DETECT_TIME 0x96
#define USBRESET_DETECT_TIME 0x96
#define OTG_REG_GUSBCFG 0xb3500000

static const char dwc2_driver_name[] = "dwc2-jz4780";

Expand Down Expand Up @@ -137,6 +138,7 @@ static int dwc2_driver_probe(struct platform_device *dev)
struct resource *res;
int retval;
int irq;
u32 reg;
struct clk *clk_otg_phy, *clk_otg1;

if (usb_disabled())
Expand Down Expand Up @@ -281,6 +283,10 @@ static int dwc2_driver_probe(struct platform_device *dev)
goto err;
}

/* Switch off VBUS overcurrent detection in OTG PHY. */
reg = readl((unsigned int __iomem *)OTG_REG_GUSBCFG);
writel(reg | 0xc, (unsigned int __iomem *)OTG_REG_GUSBCFG);

retval = dwc2_hcd_init(hsotg, irq, params);
if (retval)
goto err;
Expand Down

0 comments on commit 60fa528

Please sign in to comment.