Greg Kroah-Hartman | 5fd54ac | 2017-11-03 11:28:30 +0100 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 2 | /** |
| 3 | * debug.h - DesignWare USB3 DRD Controller Debug Header |
| 4 | * |
| 5 | * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 6 | * |
| 7 | * Authors: Felipe Balbi <balbi@ti.com>, |
| 8 | * Sebastian Andrzej Siewior <bigeasy@linutronix.de> |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 9 | */ |
| 10 | |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 11 | #ifndef __DWC3_DEBUG_H |
| 12 | #define __DWC3_DEBUG_H |
| 13 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 14 | #include "core.h" |
| 15 | |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 16 | /** |
| 17 | * dwc3_gadget_ep_cmd_string - returns endpoint command string |
| 18 | * @cmd: command code |
| 19 | */ |
| 20 | static inline const char * |
| 21 | dwc3_gadget_ep_cmd_string(u8 cmd) |
| 22 | { |
| 23 | switch (cmd) { |
| 24 | case DWC3_DEPCMD_DEPSTARTCFG: |
| 25 | return "Start New Configuration"; |
| 26 | case DWC3_DEPCMD_ENDTRANSFER: |
| 27 | return "End Transfer"; |
| 28 | case DWC3_DEPCMD_UPDATETRANSFER: |
| 29 | return "Update Transfer"; |
| 30 | case DWC3_DEPCMD_STARTTRANSFER: |
| 31 | return "Start Transfer"; |
| 32 | case DWC3_DEPCMD_CLEARSTALL: |
| 33 | return "Clear Stall"; |
| 34 | case DWC3_DEPCMD_SETSTALL: |
| 35 | return "Set Stall"; |
| 36 | case DWC3_DEPCMD_GETEPSTATE: |
| 37 | return "Get Endpoint State"; |
| 38 | case DWC3_DEPCMD_SETTRANSFRESOURCE: |
| 39 | return "Set Endpoint Transfer Resource"; |
| 40 | case DWC3_DEPCMD_SETEPCONFIG: |
| 41 | return "Set Endpoint Configuration"; |
| 42 | default: |
| 43 | return "UNKNOWN command"; |
| 44 | } |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * dwc3_gadget_generic_cmd_string - returns generic command string |
| 49 | * @cmd: command code |
| 50 | */ |
| 51 | static inline const char * |
| 52 | dwc3_gadget_generic_cmd_string(u8 cmd) |
| 53 | { |
| 54 | switch (cmd) { |
| 55 | case DWC3_DGCMD_SET_LMP: |
| 56 | return "Set LMP"; |
| 57 | case DWC3_DGCMD_SET_PERIODIC_PAR: |
| 58 | return "Set Periodic Parameters"; |
| 59 | case DWC3_DGCMD_XMIT_FUNCTION: |
| 60 | return "Transmit Function Wake Device Notification"; |
| 61 | case DWC3_DGCMD_SET_SCRATCHPAD_ADDR_LO: |
| 62 | return "Set Scratchpad Buffer Array Address Lo"; |
| 63 | case DWC3_DGCMD_SET_SCRATCHPAD_ADDR_HI: |
| 64 | return "Set Scratchpad Buffer Array Address Hi"; |
| 65 | case DWC3_DGCMD_SELECTED_FIFO_FLUSH: |
| 66 | return "Selected FIFO Flush"; |
| 67 | case DWC3_DGCMD_ALL_FIFO_FLUSH: |
| 68 | return "All FIFO Flush"; |
| 69 | case DWC3_DGCMD_SET_ENDPOINT_NRDY: |
| 70 | return "Set Endpoint NRDY"; |
| 71 | case DWC3_DGCMD_RUN_SOC_BUS_LOOPBACK: |
| 72 | return "Run SoC Bus Loopback Test"; |
| 73 | default: |
| 74 | return "UNKNOWN"; |
| 75 | } |
| 76 | } |
| 77 | |
| 78 | /** |
| 79 | * dwc3_gadget_link_string - returns link name |
| 80 | * @link_state: link state code |
| 81 | */ |
| 82 | static inline const char * |
| 83 | dwc3_gadget_link_string(enum dwc3_link_state link_state) |
| 84 | { |
| 85 | switch (link_state) { |
| 86 | case DWC3_LINK_STATE_U0: |
| 87 | return "U0"; |
| 88 | case DWC3_LINK_STATE_U1: |
| 89 | return "U1"; |
| 90 | case DWC3_LINK_STATE_U2: |
| 91 | return "U2"; |
| 92 | case DWC3_LINK_STATE_U3: |
| 93 | return "U3"; |
| 94 | case DWC3_LINK_STATE_SS_DIS: |
| 95 | return "SS.Disabled"; |
| 96 | case DWC3_LINK_STATE_RX_DET: |
| 97 | return "RX.Detect"; |
| 98 | case DWC3_LINK_STATE_SS_INACT: |
| 99 | return "SS.Inactive"; |
| 100 | case DWC3_LINK_STATE_POLL: |
| 101 | return "Polling"; |
| 102 | case DWC3_LINK_STATE_RECOV: |
| 103 | return "Recovery"; |
| 104 | case DWC3_LINK_STATE_HRESET: |
| 105 | return "Hot Reset"; |
| 106 | case DWC3_LINK_STATE_CMPLY: |
| 107 | return "Compliance"; |
| 108 | case DWC3_LINK_STATE_LPBK: |
| 109 | return "Loopback"; |
| 110 | case DWC3_LINK_STATE_RESET: |
| 111 | return "Reset"; |
| 112 | case DWC3_LINK_STATE_RESUME: |
| 113 | return "Resume"; |
| 114 | default: |
| 115 | return "UNKNOWN link state\n"; |
| 116 | } |
| 117 | } |
| 118 | |
Felipe Balbi | b5c7ed5 | 2017-03-31 14:44:09 +0300 | [diff] [blame] | 119 | /** |
Thinh Nguyen | 0d36ded | 2018-11-07 17:55:19 -0800 | [diff] [blame] | 120 | * dwc3_gadget_hs_link_string - returns highspeed and below link name |
| 121 | * @link_state: link state code |
| 122 | */ |
| 123 | static inline const char * |
| 124 | dwc3_gadget_hs_link_string(enum dwc3_link_state link_state) |
| 125 | { |
| 126 | switch (link_state) { |
| 127 | case DWC3_LINK_STATE_U0: |
| 128 | return "On"; |
| 129 | case DWC3_LINK_STATE_U2: |
| 130 | return "Sleep"; |
| 131 | case DWC3_LINK_STATE_U3: |
| 132 | return "Suspend"; |
| 133 | case DWC3_LINK_STATE_SS_DIS: |
| 134 | return "Disconnected"; |
| 135 | case DWC3_LINK_STATE_RX_DET: |
| 136 | return "Early Suspend"; |
| 137 | case DWC3_LINK_STATE_RECOV: |
| 138 | return "Recovery"; |
| 139 | case DWC3_LINK_STATE_RESET: |
| 140 | return "Reset"; |
| 141 | case DWC3_LINK_STATE_RESUME: |
| 142 | return "Resume"; |
| 143 | default: |
| 144 | return "UNKNOWN link state\n"; |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | /** |
Felipe Balbi | b5c7ed5 | 2017-03-31 14:44:09 +0300 | [diff] [blame] | 149 | * dwc3_trb_type_string - returns TRB type as a string |
| 150 | * @type: the type of the TRB |
| 151 | */ |
| 152 | static inline const char *dwc3_trb_type_string(unsigned int type) |
| 153 | { |
| 154 | switch (type) { |
| 155 | case DWC3_TRBCTL_NORMAL: |
| 156 | return "normal"; |
| 157 | case DWC3_TRBCTL_CONTROL_SETUP: |
| 158 | return "setup"; |
| 159 | case DWC3_TRBCTL_CONTROL_STATUS2: |
| 160 | return "status2"; |
| 161 | case DWC3_TRBCTL_CONTROL_STATUS3: |
| 162 | return "status3"; |
| 163 | case DWC3_TRBCTL_CONTROL_DATA: |
| 164 | return "data"; |
| 165 | case DWC3_TRBCTL_ISOCHRONOUS_FIRST: |
| 166 | return "isoc-first"; |
| 167 | case DWC3_TRBCTL_ISOCHRONOUS: |
| 168 | return "isoc"; |
| 169 | case DWC3_TRBCTL_LINK_TRB: |
| 170 | return "link"; |
| 171 | default: |
| 172 | return "UNKNOWN"; |
| 173 | } |
| 174 | } |
| 175 | |
Felipe Balbi | cdd72ac | 2016-09-26 13:22:21 +0300 | [diff] [blame] | 176 | static inline const char *dwc3_ep0_state_string(enum dwc3_ep0_state state) |
| 177 | { |
| 178 | switch (state) { |
| 179 | case EP0_UNCONNECTED: |
| 180 | return "Unconnected"; |
| 181 | case EP0_SETUP_PHASE: |
| 182 | return "Setup Phase"; |
| 183 | case EP0_DATA_PHASE: |
| 184 | return "Data Phase"; |
| 185 | case EP0_STATUS_PHASE: |
| 186 | return "Status Phase"; |
| 187 | default: |
| 188 | return "UNKNOWN"; |
| 189 | } |
| 190 | } |
| 191 | |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 192 | /** |
| 193 | * dwc3_gadget_event_string - returns event name |
| 194 | * @event: the event code |
| 195 | */ |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 196 | static inline const char *dwc3_gadget_event_string(char *str, size_t size, |
| 197 | const struct dwc3_event_devt *event) |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 198 | { |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 199 | enum dwc3_link_state state = event->event_info & DWC3_LINK_STATE_MASK; |
| 200 | |
| 201 | switch (event->type) { |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 202 | case DWC3_DEVICE_EVENT_DISCONNECT: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 203 | snprintf(str, size, "Disconnect: [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 204 | dwc3_gadget_link_string(state)); |
| 205 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 206 | case DWC3_DEVICE_EVENT_RESET: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 207 | snprintf(str, size, "Reset [%s]", |
| 208 | dwc3_gadget_link_string(state)); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 209 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 210 | case DWC3_DEVICE_EVENT_CONNECT_DONE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 211 | snprintf(str, size, "Connection Done [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 212 | dwc3_gadget_link_string(state)); |
| 213 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 214 | case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 215 | snprintf(str, size, "Link Change [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 216 | dwc3_gadget_link_string(state)); |
| 217 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 218 | case DWC3_DEVICE_EVENT_WAKEUP: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 219 | snprintf(str, size, "WakeUp [%s]", |
| 220 | dwc3_gadget_link_string(state)); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 221 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 222 | case DWC3_DEVICE_EVENT_EOPF: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 223 | snprintf(str, size, "End-Of-Frame [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 224 | dwc3_gadget_link_string(state)); |
| 225 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 226 | case DWC3_DEVICE_EVENT_SOF: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 227 | snprintf(str, size, "Start-Of-Frame [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 228 | dwc3_gadget_link_string(state)); |
| 229 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 230 | case DWC3_DEVICE_EVENT_ERRATIC_ERROR: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 231 | snprintf(str, size, "Erratic Error [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 232 | dwc3_gadget_link_string(state)); |
| 233 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 234 | case DWC3_DEVICE_EVENT_CMD_CMPL: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 235 | snprintf(str, size, "Command Complete [%s]", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 236 | dwc3_gadget_link_string(state)); |
| 237 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 238 | case DWC3_DEVICE_EVENT_OVERFLOW: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 239 | snprintf(str, size, "Overflow [%s]", |
| 240 | dwc3_gadget_link_string(state)); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 241 | break; |
| 242 | default: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 243 | snprintf(str, size, "UNKNOWN"); |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 244 | } |
| 245 | |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 246 | return str; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 247 | } |
| 248 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 249 | static inline void dwc3_decode_get_status(__u8 t, __u16 i, __u16 l, char *str, |
| 250 | size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 251 | { |
| 252 | switch (t & USB_RECIP_MASK) { |
| 253 | case USB_RECIP_INTERFACE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 254 | snprintf(str, size, "Get Interface Status(Intf = %d, Length = %d)", |
| 255 | i, l); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 256 | break; |
| 257 | case USB_RECIP_ENDPOINT: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 258 | snprintf(str, size, "Get Endpoint Status(ep%d%s)", |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 259 | i & ~USB_DIR_IN, |
| 260 | i & USB_DIR_IN ? "in" : "out"); |
| 261 | break; |
| 262 | } |
| 263 | } |
| 264 | |
| 265 | static inline void dwc3_decode_set_clear_feature(__u8 t, __u8 b, __u16 v, |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 266 | __u16 i, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 267 | { |
| 268 | switch (t & USB_RECIP_MASK) { |
| 269 | case USB_RECIP_DEVICE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 270 | snprintf(str, size, "%s Device Feature(%s%s)", |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 271 | b == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set", |
| 272 | ({char *s; |
| 273 | switch (v) { |
| 274 | case USB_DEVICE_SELF_POWERED: |
| 275 | s = "Self Powered"; |
| 276 | break; |
| 277 | case USB_DEVICE_REMOTE_WAKEUP: |
| 278 | s = "Remote Wakeup"; |
| 279 | break; |
| 280 | case USB_DEVICE_TEST_MODE: |
| 281 | s = "Test Mode"; |
| 282 | break; |
Felipe Balbi | 0c5d295 | 2017-11-09 15:00:46 +0200 | [diff] [blame] | 283 | case USB_DEVICE_U1_ENABLE: |
| 284 | s = "U1 Enable"; |
| 285 | break; |
| 286 | case USB_DEVICE_U2_ENABLE: |
| 287 | s = "U2 Enable"; |
| 288 | break; |
| 289 | case USB_DEVICE_LTM_ENABLE: |
| 290 | s = "LTM Enable"; |
| 291 | break; |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 292 | default: |
| 293 | s = "UNKNOWN"; |
| 294 | } s; }), |
| 295 | v == USB_DEVICE_TEST_MODE ? |
| 296 | ({ char *s; |
| 297 | switch (i) { |
| 298 | case TEST_J: |
| 299 | s = ": TEST_J"; |
| 300 | break; |
| 301 | case TEST_K: |
| 302 | s = ": TEST_K"; |
| 303 | break; |
| 304 | case TEST_SE0_NAK: |
| 305 | s = ": TEST_SE0_NAK"; |
| 306 | break; |
| 307 | case TEST_PACKET: |
| 308 | s = ": TEST_PACKET"; |
| 309 | break; |
| 310 | case TEST_FORCE_EN: |
| 311 | s = ": TEST_FORCE_EN"; |
| 312 | break; |
| 313 | default: |
| 314 | s = ": UNKNOWN"; |
| 315 | } s; }) : ""); |
| 316 | break; |
| 317 | case USB_RECIP_INTERFACE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 318 | snprintf(str, size, "%s Interface Feature(%s)", |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 319 | b == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set", |
| 320 | v == USB_INTRF_FUNC_SUSPEND ? |
| 321 | "Function Suspend" : "UNKNOWN"); |
| 322 | break; |
| 323 | case USB_RECIP_ENDPOINT: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 324 | snprintf(str, size, "%s Endpoint Feature(%s ep%d%s)", |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 325 | b == USB_REQ_CLEAR_FEATURE ? "Clear" : "Set", |
| 326 | v == USB_ENDPOINT_HALT ? "Halt" : "UNKNOWN", |
| 327 | i & ~USB_DIR_IN, |
| 328 | i & USB_DIR_IN ? "in" : "out"); |
| 329 | break; |
| 330 | } |
| 331 | } |
| 332 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 333 | static inline void dwc3_decode_set_address(__u16 v, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 334 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 335 | snprintf(str, size, "Set Address(Addr = %02x)", v); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 336 | } |
| 337 | |
| 338 | static inline void dwc3_decode_get_set_descriptor(__u8 t, __u8 b, __u16 v, |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 339 | __u16 i, __u16 l, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 340 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 341 | snprintf(str, size, "%s %s Descriptor(Index = %d, Length = %d)", |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 342 | b == USB_REQ_GET_DESCRIPTOR ? "Get" : "Set", |
| 343 | ({ char *s; |
| 344 | switch (v >> 8) { |
| 345 | case USB_DT_DEVICE: |
| 346 | s = "Device"; |
| 347 | break; |
| 348 | case USB_DT_CONFIG: |
| 349 | s = "Configuration"; |
| 350 | break; |
| 351 | case USB_DT_STRING: |
| 352 | s = "String"; |
| 353 | break; |
| 354 | case USB_DT_INTERFACE: |
| 355 | s = "Interface"; |
| 356 | break; |
| 357 | case USB_DT_ENDPOINT: |
| 358 | s = "Endpoint"; |
| 359 | break; |
| 360 | case USB_DT_DEVICE_QUALIFIER: |
| 361 | s = "Device Qualifier"; |
| 362 | break; |
| 363 | case USB_DT_OTHER_SPEED_CONFIG: |
| 364 | s = "Other Speed Config"; |
| 365 | break; |
| 366 | case USB_DT_INTERFACE_POWER: |
| 367 | s = "Interface Power"; |
| 368 | break; |
| 369 | case USB_DT_OTG: |
| 370 | s = "OTG"; |
| 371 | break; |
| 372 | case USB_DT_DEBUG: |
| 373 | s = "Debug"; |
| 374 | break; |
| 375 | case USB_DT_INTERFACE_ASSOCIATION: |
| 376 | s = "Interface Association"; |
| 377 | break; |
| 378 | case USB_DT_BOS: |
| 379 | s = "BOS"; |
| 380 | break; |
| 381 | case USB_DT_DEVICE_CAPABILITY: |
| 382 | s = "Device Capability"; |
| 383 | break; |
| 384 | case USB_DT_PIPE_USAGE: |
| 385 | s = "Pipe Usage"; |
| 386 | break; |
| 387 | case USB_DT_SS_ENDPOINT_COMP: |
| 388 | s = "SS Endpoint Companion"; |
| 389 | break; |
| 390 | case USB_DT_SSP_ISOC_ENDPOINT_COMP: |
| 391 | s = "SSP Isochronous Endpoint Companion"; |
| 392 | break; |
| 393 | default: |
| 394 | s = "UNKNOWN"; |
| 395 | break; |
| 396 | } s; }), v & 0xff, l); |
| 397 | } |
| 398 | |
| 399 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 400 | static inline void dwc3_decode_get_configuration(__u16 l, char *str, |
| 401 | size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 402 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 403 | snprintf(str, size, "Get Configuration(Length = %d)", l); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 404 | } |
| 405 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 406 | static inline void dwc3_decode_set_configuration(__u8 v, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 407 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 408 | snprintf(str, size, "Set Configuration(Config = %d)", v); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 409 | } |
| 410 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 411 | static inline void dwc3_decode_get_intf(__u16 i, __u16 l, char *str, |
| 412 | size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 413 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 414 | snprintf(str, size, "Get Interface(Intf = %d, Length = %d)", i, l); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 415 | } |
| 416 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 417 | static inline void dwc3_decode_set_intf(__u8 v, __u16 i, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 418 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 419 | snprintf(str, size, "Set Interface(Intf = %d, Alt.Setting = %d)", i, v); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 420 | } |
| 421 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 422 | static inline void dwc3_decode_synch_frame(__u16 i, __u16 l, char *str, |
| 423 | size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 424 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 425 | snprintf(str, size, "Synch Frame(Endpoint = %d, Length = %d)", i, l); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 426 | } |
| 427 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 428 | static inline void dwc3_decode_set_sel(__u16 l, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 429 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 430 | snprintf(str, size, "Set SEL(Length = %d)", l); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 431 | } |
| 432 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 433 | static inline void dwc3_decode_set_isoch_delay(__u8 v, char *str, size_t size) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 434 | { |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 435 | snprintf(str, size, "Set Isochronous Delay(Delay = %d ns)", v); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | /** |
| 439 | * dwc3_decode_ctrl - returns a string represetion of ctrl request |
| 440 | */ |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 441 | static inline const char *dwc3_decode_ctrl(char *str, size_t size, |
| 442 | __u8 bRequestType, __u8 bRequest, __u16 wValue, __u16 wIndex, |
| 443 | __u16 wLength) |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 444 | { |
| 445 | switch (bRequest) { |
| 446 | case USB_REQ_GET_STATUS: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 447 | dwc3_decode_get_status(bRequestType, wIndex, wLength, str, |
| 448 | size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 449 | break; |
| 450 | case USB_REQ_CLEAR_FEATURE: |
| 451 | case USB_REQ_SET_FEATURE: |
| 452 | dwc3_decode_set_clear_feature(bRequestType, bRequest, wValue, |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 453 | wIndex, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 454 | break; |
| 455 | case USB_REQ_SET_ADDRESS: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 456 | dwc3_decode_set_address(wValue, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 457 | break; |
| 458 | case USB_REQ_GET_DESCRIPTOR: |
| 459 | case USB_REQ_SET_DESCRIPTOR: |
| 460 | dwc3_decode_get_set_descriptor(bRequestType, bRequest, wValue, |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 461 | wIndex, wLength, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 462 | break; |
| 463 | case USB_REQ_GET_CONFIGURATION: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 464 | dwc3_decode_get_configuration(wLength, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 465 | break; |
| 466 | case USB_REQ_SET_CONFIGURATION: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 467 | dwc3_decode_set_configuration(wValue, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 468 | break; |
| 469 | case USB_REQ_GET_INTERFACE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 470 | dwc3_decode_get_intf(wIndex, wLength, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 471 | break; |
| 472 | case USB_REQ_SET_INTERFACE: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 473 | dwc3_decode_set_intf(wValue, wIndex, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 474 | break; |
| 475 | case USB_REQ_SYNCH_FRAME: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 476 | dwc3_decode_synch_frame(wIndex, wLength, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 477 | break; |
| 478 | case USB_REQ_SET_SEL: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 479 | dwc3_decode_set_sel(wLength, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 480 | break; |
| 481 | case USB_REQ_SET_ISOCH_DELAY: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 482 | dwc3_decode_set_isoch_delay(wValue, str, size); |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 483 | break; |
| 484 | default: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 485 | snprintf(str, size, "%02x %02x %02x %02x %02x %02x %02x %02x", |
Felipe Balbi | af32423 | 2017-04-26 16:09:09 +0300 | [diff] [blame] | 486 | bRequestType, bRequest, |
| 487 | cpu_to_le16(wValue) & 0xff, |
| 488 | cpu_to_le16(wValue) >> 8, |
| 489 | cpu_to_le16(wIndex) & 0xff, |
| 490 | cpu_to_le16(wIndex) >> 8, |
| 491 | cpu_to_le16(wLength) & 0xff, |
| 492 | cpu_to_le16(wLength) >> 8); |
| 493 | } |
| 494 | |
| 495 | return str; |
| 496 | } |
| 497 | |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 498 | /** |
| 499 | * dwc3_ep_event_string - returns event name |
| 500 | * @event: then event code |
| 501 | */ |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 502 | static inline const char *dwc3_ep_event_string(char *str, size_t size, |
| 503 | const struct dwc3_event_depevt *event, u32 ep0state) |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 504 | { |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 505 | u8 epnum = event->endpoint_number; |
Felipe Balbi | 43c96be | 2016-09-26 13:23:34 +0300 | [diff] [blame] | 506 | size_t len; |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 507 | int status; |
| 508 | int ret; |
| 509 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 510 | ret = snprintf(str, size, "ep%d%s: ", epnum >> 1, |
Felipe Balbi | 696fe69 | 2016-08-24 14:32:39 +0300 | [diff] [blame] | 511 | (epnum & 1) ? "in" : "out"); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 512 | if (ret < 0) |
| 513 | return "UNKNOWN"; |
| 514 | |
Felipe Balbi | b27972b | 2018-04-06 11:03:19 +0300 | [diff] [blame] | 515 | status = event->status; |
| 516 | |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 517 | switch (event->endpoint_event) { |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 518 | case DWC3_DEPEVT_XFERCOMPLETE: |
Felipe Balbi | b27972b | 2018-04-06 11:03:19 +0300 | [diff] [blame] | 519 | len = strlen(str); |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 520 | snprintf(str + len, size - len, "Transfer Complete (%c%c%c)", |
Felipe Balbi | b27972b | 2018-04-06 11:03:19 +0300 | [diff] [blame] | 521 | status & DEPEVT_STATUS_SHORT ? 'S' : 's', |
| 522 | status & DEPEVT_STATUS_IOC ? 'I' : 'i', |
| 523 | status & DEPEVT_STATUS_LST ? 'L' : 'l'); |
| 524 | |
Felipe Balbi | 43c96be | 2016-09-26 13:23:34 +0300 | [diff] [blame] | 525 | len = strlen(str); |
| 526 | |
| 527 | if (epnum <= 1) |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 528 | snprintf(str + len, size - len, " [%s]", |
| 529 | dwc3_ep0_state_string(ep0state)); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 530 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 531 | case DWC3_DEPEVT_XFERINPROGRESS: |
Felipe Balbi | b27972b | 2018-04-06 11:03:19 +0300 | [diff] [blame] | 532 | len = strlen(str); |
| 533 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 534 | snprintf(str + len, size - len, "Transfer In Progress [%d] (%c%c%c)", |
Felipe Balbi | e1d542f | 2018-04-11 10:31:53 +0300 | [diff] [blame] | 535 | event->parameters, |
Felipe Balbi | b27972b | 2018-04-06 11:03:19 +0300 | [diff] [blame] | 536 | status & DEPEVT_STATUS_SHORT ? 'S' : 's', |
| 537 | status & DEPEVT_STATUS_IOC ? 'I' : 'i', |
| 538 | status & DEPEVT_STATUS_LST ? 'M' : 'm'); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 539 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 540 | case DWC3_DEPEVT_XFERNOTREADY: |
Felipe Balbi | e1d542f | 2018-04-11 10:31:53 +0300 | [diff] [blame] | 541 | len = strlen(str); |
| 542 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 543 | snprintf(str + len, size - len, "Transfer Not Ready [%d]%s", |
Felipe Balbi | e1d542f | 2018-04-11 10:31:53 +0300 | [diff] [blame] | 544 | event->parameters, |
| 545 | status & DEPEVT_STATUS_TRANSFER_ACTIVE ? |
Felipe Balbi | b27972b | 2018-04-06 11:03:19 +0300 | [diff] [blame] | 546 | " (Active)" : " (Not Active)"); |
Felipe Balbi | 45a2af2 | 2016-09-26 12:54:04 +0300 | [diff] [blame] | 547 | |
| 548 | /* Control Endpoints */ |
| 549 | if (epnum <= 1) { |
| 550 | int phase = DEPEVT_STATUS_CONTROL_PHASE(event->status); |
| 551 | |
| 552 | switch (phase) { |
| 553 | case DEPEVT_STATUS_CONTROL_DATA: |
| 554 | strcat(str, " [Data Phase]"); |
| 555 | break; |
| 556 | case DEPEVT_STATUS_CONTROL_STATUS: |
| 557 | strcat(str, " [Status Phase]"); |
| 558 | } |
| 559 | } |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 560 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 561 | case DWC3_DEPEVT_RXTXFIFOEVT: |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 562 | strcat(str, "FIFO"); |
| 563 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 564 | case DWC3_DEPEVT_STREAMEVT: |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 565 | status = event->status; |
| 566 | |
| 567 | switch (status) { |
| 568 | case DEPEVT_STREAMEVT_FOUND: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 569 | snprintf(str + ret, size - ret, " Stream %d Found", |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 570 | event->parameters); |
| 571 | break; |
| 572 | case DEPEVT_STREAMEVT_NOTFOUND: |
| 573 | default: |
| 574 | strcat(str, " Stream Not Found"); |
| 575 | break; |
| 576 | } |
| 577 | |
| 578 | break; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 579 | case DWC3_DEPEVT_EPCMDCMPLT: |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 580 | strcat(str, "Endpoint Command Complete"); |
| 581 | break; |
| 582 | default: |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 583 | snprintf(str, size, "UNKNOWN"); |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 584 | } |
| 585 | |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 586 | return str; |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 587 | } |
| 588 | |
Felipe Balbi | e996061 | 2014-08-19 16:49:20 -0500 | [diff] [blame] | 589 | /** |
| 590 | * dwc3_gadget_event_type_string - return event name |
| 591 | * @event: the event code |
| 592 | */ |
| 593 | static inline const char *dwc3_gadget_event_type_string(u8 event) |
| 594 | { |
| 595 | switch (event) { |
| 596 | case DWC3_DEVICE_EVENT_DISCONNECT: |
| 597 | return "Disconnect"; |
| 598 | case DWC3_DEVICE_EVENT_RESET: |
| 599 | return "Reset"; |
| 600 | case DWC3_DEVICE_EVENT_CONNECT_DONE: |
| 601 | return "Connect Done"; |
| 602 | case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE: |
| 603 | return "Link Status Change"; |
| 604 | case DWC3_DEVICE_EVENT_WAKEUP: |
| 605 | return "Wake-Up"; |
| 606 | case DWC3_DEVICE_EVENT_HIBER_REQ: |
| 607 | return "Hibernation"; |
| 608 | case DWC3_DEVICE_EVENT_EOPF: |
| 609 | return "End of Periodic Frame"; |
| 610 | case DWC3_DEVICE_EVENT_SOF: |
| 611 | return "Start of Frame"; |
| 612 | case DWC3_DEVICE_EVENT_ERRATIC_ERROR: |
| 613 | return "Erratic Error"; |
| 614 | case DWC3_DEVICE_EVENT_CMD_CMPL: |
| 615 | return "Command Complete"; |
| 616 | case DWC3_DEVICE_EVENT_OVERFLOW: |
| 617 | return "Overflow"; |
| 618 | default: |
| 619 | return "UNKNOWN"; |
| 620 | } |
| 621 | } |
| 622 | |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 623 | static inline const char *dwc3_decode_event(char *str, size_t size, u32 event, |
| 624 | u32 ep0state) |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 625 | { |
| 626 | const union dwc3_event evt = (union dwc3_event) event; |
| 627 | |
| 628 | if (evt.type.is_devspec) |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 629 | return dwc3_gadget_event_string(str, size, &evt.devt); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 630 | else |
Felipe Balbi | 7790b35 | 2019-02-04 15:43:38 +0200 | [diff] [blame^] | 631 | return dwc3_ep_event_string(str, size, &evt.depevt, ep0state); |
Felipe Balbi | f75cacc | 2016-05-23 11:10:08 +0300 | [diff] [blame] | 632 | } |
| 633 | |
Felipe Balbi | 0933df1 | 2016-05-23 14:02:33 +0300 | [diff] [blame] | 634 | static inline const char *dwc3_ep_cmd_status_string(int status) |
| 635 | { |
| 636 | switch (status) { |
| 637 | case -ETIMEDOUT: |
| 638 | return "Timed Out"; |
| 639 | case 0: |
| 640 | return "Successful"; |
| 641 | case DEPEVT_TRANSFER_NO_RESOURCE: |
| 642 | return "No Resource"; |
| 643 | case DEPEVT_TRANSFER_BUS_EXPIRY: |
| 644 | return "Bus Expiry"; |
| 645 | default: |
| 646 | return "UNKNOWN"; |
| 647 | } |
| 648 | } |
| 649 | |
Felipe Balbi | 71f7e70 | 2016-05-23 14:16:19 +0300 | [diff] [blame] | 650 | static inline const char *dwc3_gadget_generic_cmd_status_string(int status) |
| 651 | { |
| 652 | switch (status) { |
| 653 | case -ETIMEDOUT: |
| 654 | return "Timed Out"; |
| 655 | case 0: |
| 656 | return "Successful"; |
| 657 | case 1: |
| 658 | return "Error"; |
| 659 | default: |
| 660 | return "UNKNOWN"; |
| 661 | } |
| 662 | } |
| 663 | |
Felipe Balbi | 57b14da | 2016-09-30 14:12:34 +0300 | [diff] [blame] | 664 | |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 665 | #ifdef CONFIG_DEBUG_FS |
Du, Changbin | 4e9f311 | 2016-04-12 19:10:18 +0800 | [diff] [blame] | 666 | extern void dwc3_debugfs_init(struct dwc3 *); |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 667 | extern void dwc3_debugfs_exit(struct dwc3 *); |
| 668 | #else |
Du, Changbin | 4e9f311 | 2016-04-12 19:10:18 +0800 | [diff] [blame] | 669 | static inline void dwc3_debugfs_init(struct dwc3 *d) |
| 670 | { } |
Felipe Balbi | 72246da | 2011-08-19 18:10:58 +0300 | [diff] [blame] | 671 | static inline void dwc3_debugfs_exit(struct dwc3 *d) |
| 672 | { } |
| 673 | #endif |
Felipe Balbi | 80977dc | 2014-08-19 16:37:22 -0500 | [diff] [blame] | 674 | #endif /* __DWC3_DEBUG_H */ |