UPSTREAM: usb: dwc3: Use the correct speed macros for DSTS/DCFG
authorJohn Youn <johnyoun@synopsys.com>
Fri, 20 May 2016 23:34:26 +0000 (16:34 -0700)
committerHuang, Tao <huangtao@rock-chips.com>
Tue, 16 Aug 2016 12:48:19 +0000 (20:48 +0800)
Correct the use of the DWC3_DSTS_XXX_SPEED and DWC3_DCFG_XXX_SPEED
macros. The wrong set of macros were being used in a few places.

This is only a cosmetic change as the values for both sets are
identical.

Signed-off-by: John Youn <johnyoun@synopsys.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
(cherry picked from commit 2da9ad761e70c6a22e3a84f9a3e67faeef122a58)

Conflicts:
drivers/usb/dwc3/gadget.c

Change-Id: I39aed8e30e6f150c2e4d5350caac7b3936ba784d

drivers/usb/dwc3/gadget.c

index cbf90aeb03a1fd63d2bbe6b762852a6efb346c11..d7d1facc04a5984d6dbfb68ec44ea02c6597ec97 100644 (file)
@@ -1682,18 +1682,18 @@ static int __dwc3_gadget_start(struct dwc3 *dwc)
        } else {
                switch (dwc->maximum_speed) {
                case USB_SPEED_LOW:
-                       reg |= DWC3_DSTS_LOWSPEED;
+                       reg |= DWC3_DCFG_LOWSPEED;
                        break;
                case USB_SPEED_FULL:
-                       reg |= DWC3_DSTS_FULLSPEED1;
+                       reg |= DWC3_DCFG_FULLSPEED1;
                        break;
                case USB_SPEED_HIGH:
-                       reg |= DWC3_DSTS_HIGHSPEED;
+                       reg |= DWC3_DCFG_HIGHSPEED;
                        break;
                case USB_SPEED_SUPER:   /* FALLTHROUGH */
                case USB_SPEED_UNKNOWN: /* FALTHROUGH */
                default:
-                       reg |= DWC3_DSTS_SUPERSPEED;
+                       reg |= DWC3_DCFG_SUPERSPEED;
                }
        }
        dwc3_writel(dwc->regs, DWC3_DCFG, reg);
@@ -2462,7 +2462,7 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
        dwc3_update_ram_clk_sel(dwc, speed);
 
        switch (speed) {
-       case DWC3_DCFG_SUPERSPEED:
+       case DWC3_DSTS_SUPERSPEED:
                /*
                 * WORKAROUND: DWC3 revisions <1.90a have an issue which
                 * would cause a missing USB3 Reset event.
@@ -2483,18 +2483,18 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
                dwc->gadget.ep0->maxpacket = 512;
                dwc->gadget.speed = USB_SPEED_SUPER;
                break;
-       case DWC3_DCFG_HIGHSPEED:
+       case DWC3_DSTS_HIGHSPEED:
                dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(64);
                dwc->gadget.ep0->maxpacket = 64;
                dwc->gadget.speed = USB_SPEED_HIGH;
                break;
-       case DWC3_DCFG_FULLSPEED2:
-       case DWC3_DCFG_FULLSPEED1:
+       case DWC3_DSTS_FULLSPEED2:
+       case DWC3_DSTS_FULLSPEED1:
                dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(64);
                dwc->gadget.ep0->maxpacket = 64;
                dwc->gadget.speed = USB_SPEED_FULL;
                break;
-       case DWC3_DCFG_LOWSPEED:
+       case DWC3_DSTS_LOWSPEED:
                dwc3_gadget_ep0_desc.wMaxPacketSize = cpu_to_le16(8);
                dwc->gadget.ep0->maxpacket = 8;
                dwc->gadget.speed = USB_SPEED_LOW;
@@ -2503,8 +2503,8 @@ static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
 
        /* Enable USB2 LPM Capability */
 
-       if ((dwc->revision > DWC3_REVISION_194A)
-                       && (speed != DWC3_DCFG_SUPERSPEED)) {
+       if ((dwc->revision > DWC3_REVISION_194A) &&
+           (speed != DWC3_DSTS_SUPERSPEED)) {
                reg = dwc3_readl(dwc->regs, DWC3_DCFG);
                reg |= DWC3_DCFG_LPM_CAP;
                dwc3_writel(dwc->regs, DWC3_DCFG, reg);