usb: dwc3: core: add helper to extract trb type
authorFelipe Balbi <felipe.balbi@linux.intel.com>
Thu, 14 Apr 2016 13:05:54 +0000 (16:05 +0300)
committerFelipe Balbi <felipe.balbi@linux.intel.com>
Tue, 19 Apr 2016 08:11:57 +0000 (11:11 +0300)
This helper will be used later to convert trb type
into a human-readable string for debugfs.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
drivers/usb/dwc3/core.h

index c3ea427..bbbd178 100644 (file)
@@ -580,6 +580,7 @@ enum dwc3_link_state {
 #define DWC3_TRB_CTRL_IOC              (1 << 11)
 #define DWC3_TRB_CTRL_SID_SOFN(n)      (((n) & 0xffff) << 14)
 
+#define DWC3_TRBCTL_TYPE(n)            ((n) & (0x3f << 4))
 #define DWC3_TRBCTL_NORMAL             DWC3_TRB_CTRL_TRBCTL(1)
 #define DWC3_TRBCTL_CONTROL_SETUP      DWC3_TRB_CTRL_TRBCTL(2)
 #define DWC3_TRBCTL_CONTROL_STATUS2    DWC3_TRB_CTRL_TRBCTL(3)