usb: dwc3: gadget: fix GCTL programming
authorFelipe Balbi <balbi@ti.com>
Thu, 8 Sep 2011 14:42:11 +0000 (17:42 +0300)
committerFelipe Balbi <balbi@ti.com>
Fri, 9 Sep 2011 10:05:25 +0000 (13:05 +0300)
ensure a few bits are cleared before enabling
what we need.

Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/gadget.c

index 1de4d3f8756987220b5407c3689d3902c49fc6f0..6c64c7385314f2f36a2f011196b548a419b974cc 100644 (file)
@@ -1150,13 +1150,10 @@ static int dwc3_gadget_start(struct usb_gadget *g,
 
        reg = dwc3_readl(dwc->regs, DWC3_GCTL);
 
-       /*
-        * REVISIT: power down scale might be different
-        * depending on PHY used, need to pass that via platform_data
-        */
-       reg |= DWC3_GCTL_PWRDNSCALE(0x61a)
-               | DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_DEVICE);
+       reg &= ~DWC3_GCTL_SCALEDOWN(3);
+       reg &= ~DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_OTG);
        reg &= ~DWC3_GCTL_DISSCRAMBLE;
+       reg |= DWC3_GCTL_PRTCAPDIR(DWC3_GCTL_PRTCAP_DEVICE);
 
        /*
         * WORKAROUND: DWC3 revisions <1.90a have a bug