Skip to content

Commit 6f26ebb

Browse files
jackp780gregkh
authored andcommitted
usb: dwc3: gadget: Rename EOPF event macros to Suspend
The device event corresponding to End of Periodic Frame is only found on older IP revisions (2.10a and prior, according to a cursory SNPS databook search). On revisions 2.30a and newer, including DWC3.1, the same event value and corresponding DEVTEN bit were repurposed to indicate that the link has gone into suspend state (U3 or L2/L1). EOPF events had never been enabled before in this driver, and going forward we expect current and future DWC3-based devices won't likely to be using such old DWC3 IP revisions either. Hence rather than keeping the deprecated EOPF macro names let's rename them to indicate their usage for suspend events. Acked-by: Felipe Balbi <balbi@kernel.org> Signed-off-by: Jack Pham <jackp@codeaurora.org> Link: https://lore.kernel.org/r/20210428090111.3370-2-jackp@codeaurora.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent d1d90dd commit 6f26ebb

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

drivers/usb/dwc3/core.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
#define DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE 3
5858
#define DWC3_DEVICE_EVENT_WAKEUP 4
5959
#define DWC3_DEVICE_EVENT_HIBER_REQ 5
60-
#define DWC3_DEVICE_EVENT_EOPF 6
60+
#define DWC3_DEVICE_EVENT_SUSPEND 6
6161
#define DWC3_DEVICE_EVENT_SOF 7
6262
#define DWC3_DEVICE_EVENT_ERRATIC_ERROR 9
6363
#define DWC3_DEVICE_EVENT_CMD_CMPL 10
@@ -460,7 +460,7 @@
460460
#define DWC3_DEVTEN_CMDCMPLTEN BIT(10)
461461
#define DWC3_DEVTEN_ERRTICERREN BIT(9)
462462
#define DWC3_DEVTEN_SOFEN BIT(7)
463-
#define DWC3_DEVTEN_EOPFEN BIT(6)
463+
#define DWC3_DEVTEN_U3L2L1SUSPEN BIT(6)
464464
#define DWC3_DEVTEN_HIBERNATIONREQEVTEN BIT(5)
465465
#define DWC3_DEVTEN_WKUPEVTEN BIT(4)
466466
#define DWC3_DEVTEN_ULSTCNGEN BIT(3)
@@ -1375,7 +1375,7 @@ struct dwc3_event_depevt {
13751375
* 3 - ULStChng
13761376
* 4 - WkUpEvt
13771377
* 5 - Reserved
1378-
* 6 - EOPF
1378+
* 6 - Suspend (EOPF on revisions 2.10a and prior)
13791379
* 7 - SOF
13801380
* 8 - Reserved
13811381
* 9 - ErrticErr

drivers/usb/dwc3/debug.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,8 @@ static inline const char *dwc3_gadget_event_string(char *str, size_t size,
221221
snprintf(str, size, "WakeUp [%s]",
222222
dwc3_gadget_link_string(state));
223223
break;
224-
case DWC3_DEVICE_EVENT_EOPF:
225-
snprintf(str, size, "End-Of-Frame [%s]",
224+
case DWC3_DEVICE_EVENT_SUSPEND:
225+
snprintf(str, size, "Suspend [%s]",
226226
dwc3_gadget_link_string(state));
227227
break;
228228
case DWC3_DEVICE_EVENT_SOF:
@@ -353,8 +353,8 @@ static inline const char *dwc3_gadget_event_type_string(u8 event)
353353
return "Wake-Up";
354354
case DWC3_DEVICE_EVENT_HIBER_REQ:
355355
return "Hibernation";
356-
case DWC3_DEVICE_EVENT_EOPF:
357-
return "End of Periodic Frame";
356+
case DWC3_DEVICE_EVENT_SUSPEND:
357+
return "Suspend";
358358
case DWC3_DEVICE_EVENT_SOF:
359359
return "Start of Frame";
360360
case DWC3_DEVICE_EVENT_ERRATIC_ERROR:

drivers/usb/dwc3/gadget.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2325,7 +2325,7 @@ static void dwc3_gadget_enable_irq(struct dwc3 *dwc)
23252325

23262326
/* On 2.30a and above this bit enables U3/L2-L1 Suspend Events */
23272327
if (!DWC3_VER_IS_PRIOR(DWC3, 230A))
2328-
reg |= DWC3_DEVTEN_EOPFEN;
2328+
reg |= DWC3_DEVTEN_U3L2L1SUSPEN;
23292329

23302330
dwc3_writel(dwc->regs, DWC3_DEVTEN, reg);
23312331
}
@@ -3744,7 +3744,7 @@ static void dwc3_gadget_interrupt(struct dwc3 *dwc,
37443744
case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE:
37453745
dwc3_gadget_linksts_change_interrupt(dwc, event->event_info);
37463746
break;
3747-
case DWC3_DEVICE_EVENT_EOPF:
3747+
case DWC3_DEVICE_EVENT_SUSPEND:
37483748
/* It changed to be suspend event for version 2.30a and above */
37493749
if (!DWC3_VER_IS_PRIOR(DWC3, 230A)) {
37503750
/*

0 commit comments

Comments
 (0)