diff options
author | Felipe Balbi <balbi@ti.com> | 2014-08-19 17:49:20 -0400 |
---|---|---|
committer | Felipe Balbi <balbi@ti.com> | 2014-09-05 10:53:56 -0400 |
commit | e996061b9632d2ac7d00112208c644328c2411d5 (patch) | |
tree | d4aefa438f4a4cdc21052cecb747d097e3a306cb | |
parent | 80977dc99be5d874d10716594e716ef317c1723c (diff) |
usb: dwc3: debug: add dwc3_gadget_event_type_string
this new helper will return a pretty string for
DWC3 Gadget Events.
Signed-off-by: Felipe Balbi <balbi@ti.com>
-rw-r--r-- | drivers/usb/dwc3/debug.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h index e35a3d103d7f..12ff4c9479c0 100644 --- a/drivers/usb/dwc3/debug.h +++ b/drivers/usb/dwc3/debug.h | |||
@@ -180,6 +180,40 @@ static inline const char *dwc3_ep_event_string(u8 event) | |||
180 | return "UNKNOWN"; | 180 | return "UNKNOWN"; |
181 | } | 181 | } |
182 | 182 | ||
183 | /** | ||
184 | * dwc3_gadget_event_type_string - return event name | ||
185 | * @event: the event code | ||
186 | */ | ||
187 | static inline const char *dwc3_gadget_event_type_string(u8 event) | ||
188 | { | ||
189 | switch (event) { | ||
190 | case DWC3_DEVICE_EVENT_DISCONNECT: | ||
191 | return "Disconnect"; | ||
192 | case DWC3_DEVICE_EVENT_RESET: | ||
193 | return "Reset"; | ||
194 | case DWC3_DEVICE_EVENT_CONNECT_DONE: | ||
195 | return "Connect Done"; | ||
196 | case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE: | ||
197 | return "Link Status Change"; | ||
198 | case DWC3_DEVICE_EVENT_WAKEUP: | ||
199 | return "Wake-Up"; | ||
200 | case DWC3_DEVICE_EVENT_HIBER_REQ: | ||
201 | return "Hibernation"; | ||
202 | case DWC3_DEVICE_EVENT_EOPF: | ||
203 | return "End of Periodic Frame"; | ||
204 | case DWC3_DEVICE_EVENT_SOF: | ||
205 | return "Start of Frame"; | ||
206 | case DWC3_DEVICE_EVENT_ERRATIC_ERROR: | ||
207 | return "Erratic Error"; | ||
208 | case DWC3_DEVICE_EVENT_CMD_CMPL: | ||
209 | return "Command Complete"; | ||
210 | case DWC3_DEVICE_EVENT_OVERFLOW: | ||
211 | return "Overflow"; | ||
212 | default: | ||
213 | return "UNKNOWN"; | ||
214 | } | ||
215 | } | ||
216 | |||
183 | #ifdef CONFIG_DEBUG_FS | 217 | #ifdef CONFIG_DEBUG_FS |
184 | extern int dwc3_debugfs_init(struct dwc3 *); | 218 | extern int dwc3_debugfs_init(struct dwc3 *); |
185 | extern void dwc3_debugfs_exit(struct dwc3 *); | 219 | extern void dwc3_debugfs_exit(struct dwc3 *); |