From patchwork Fri Sep 5 14:56:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Felipe Balbi X-Patchwork-Id: 36852 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f197.google.com (mail-ob0-f197.google.com [209.85.214.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 49D4D206A0 for ; Fri, 5 Sep 2014 14:57:19 +0000 (UTC) Received: by mail-ob0-f197.google.com with SMTP id vb8sf60046656obc.4 for ; Fri, 05 Sep 2014 07:57:18 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=HmN1tyUYxC6ua7rpxpQW+PKEco4OqDqQCFd5t3rE9gA=; b=frB9dq6bfGINudyzyEyZ7z7t4Gwmky4DZPTPAuU5eP1EvuvOADJ3cuDsz3ROaZWb6S 8matKbzBkjRSDpx31wTeWV0ShxRyKExlNxKb89y6aMqMmd4ACaKVAcpuPWjfcPq4VCee pIf1q4Qt1xpQ+GsFdq6W4tZ5U66MHUaEQoUP18JChFtODwDdx43/s/UE8RtRjScx1w73 Hx7IDf0MSxR03yu0Kd5xb5rGU3+eqRU1sN9nP8ygz3/zjCjUK8xsGcDx3H1ds0HcGUmG QneUU2L0fly5oQE72jCSX3h0NgBmL+OFu6Mo3trYlRiComDtCyUA888qgMk1sR7BPk3N EBZQ== X-Gm-Message-State: ALoCoQmZoKE0f994wyFwP4pT4m7HW8DLVeMTeFyIJ1LHeTWOL6mSMkTJfZ8Mj+oTs5KFUD8A/axX X-Received: by 10.182.230.133 with SMTP id sy5mr7348668obc.22.1409929038955; Fri, 05 Sep 2014 07:57:18 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.33.246 with SMTP id j109ls784522qgj.83.gmail; Fri, 05 Sep 2014 07:57:18 -0700 (PDT) X-Received: by 10.52.120.51 with SMTP id kz19mr1082117vdb.95.1409929038551; Fri, 05 Sep 2014 07:57:18 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id wn1si799480vcb.98.2014.09.05.07.57.18 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 05 Sep 2014 07:57:18 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id le20so1089726vcb.31 for ; Fri, 05 Sep 2014 07:57:18 -0700 (PDT) X-Received: by 10.52.3.40 with SMTP id 8mr9352375vdz.24.1409929036338; Fri, 05 Sep 2014 07:57:16 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp94632vcb; Fri, 5 Sep 2014 07:57:15 -0700 (PDT) X-Received: by 10.70.35.207 with SMTP id k15mr21912531pdj.5.1409929035564; Fri, 05 Sep 2014 07:57:15 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k5si4691303pdn.89.2014.09.05.07.57.13 for ; Fri, 05 Sep 2014 07:57:13 -0700 (PDT) Received-SPF: none (google.com: linux-usb-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932631AbaIEO4y (ORCPT + 2 others); Fri, 5 Sep 2014 10:56:54 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:39126 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932531AbaIEO4y (ORCPT ); Fri, 5 Sep 2014 10:56:54 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s85EulWA021245; Fri, 5 Sep 2014 09:56:47 -0500 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s85Eulm1019826; Fri, 5 Sep 2014 09:56:47 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.3.174.1; Fri, 5 Sep 2014 09:56:46 -0500 Received: from localhost (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s85Eukva017589; Fri, 5 Sep 2014 09:56:46 -0500 From: Felipe Balbi To: Linux USB Mailing List CC: Paul Zimmerman , , Felipe Balbi Subject: [PATCH 2/4] usb: dwc3: debug: add dwc3_gadget_event_type_string Date: Fri, 5 Sep 2014 09:56:24 -0500 Message-ID: <1409928986-8690-2-git-send-email-balbi@ti.com> X-Mailer: git-send-email 2.0.1.563.g66f467c In-Reply-To: <1409928986-8690-1-git-send-email-balbi@ti.com> References: <1409928986-8690-1-git-send-email-balbi@ti.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: balbi@ti.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , this new helper will return a pretty string for DWC3 Gadget Events. Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/debug.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/drivers/usb/dwc3/debug.h b/drivers/usb/dwc3/debug.h index e35a3d1..12ff4c9 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) return "UNKNOWN"; } +/** + * dwc3_gadget_event_type_string - return event name + * @event: the event code + */ +static inline const char *dwc3_gadget_event_type_string(u8 event) +{ + switch (event) { + case DWC3_DEVICE_EVENT_DISCONNECT: + return "Disconnect"; + case DWC3_DEVICE_EVENT_RESET: + return "Reset"; + case DWC3_DEVICE_EVENT_CONNECT_DONE: + return "Connect Done"; + case DWC3_DEVICE_EVENT_LINK_STATUS_CHANGE: + return "Link Status Change"; + case DWC3_DEVICE_EVENT_WAKEUP: + return "Wake-Up"; + case DWC3_DEVICE_EVENT_HIBER_REQ: + return "Hibernation"; + case DWC3_DEVICE_EVENT_EOPF: + return "End of Periodic Frame"; + case DWC3_DEVICE_EVENT_SOF: + return "Start of Frame"; + case DWC3_DEVICE_EVENT_ERRATIC_ERROR: + return "Erratic Error"; + case DWC3_DEVICE_EVENT_CMD_CMPL: + return "Command Complete"; + case DWC3_DEVICE_EVENT_OVERFLOW: + return "Overflow"; + default: + return "UNKNOWN"; + } +} + #ifdef CONFIG_DEBUG_FS extern int dwc3_debugfs_init(struct dwc3 *); extern void dwc3_debugfs_exit(struct dwc3 *);