From patchwork Wed Jan 4 13:22:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Manish Narani X-Patchwork-Id: 9497831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7AE8E606A9 for ; Wed, 4 Jan 2017 21:22:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 710DA1FF15 for ; Wed, 4 Jan 2017 21:22:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6528428339; Wed, 4 Jan 2017 21:22:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1186F1FF15 for ; Wed, 4 Jan 2017 21:22:50 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cOt01-0007hC-ST; Wed, 04 Jan 2017 21:21:33 +0000 Received: from casper.infradead.org ([2001:770:15f::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cOsqK-00056E-QF for linux-arm-kernel@bombadil.infradead.org; Wed, 04 Jan 2017 21:11:33 +0000 Received: from mail-dm3nam03on0089.outbound.protection.outlook.com ([104.47.41.89] helo=NAM03-DM3-obe.outbound.protection.outlook.com) by casper.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cOlXY-0007av-I5 for linux-arm-kernel@lists.infradead.org; Wed, 04 Jan 2017 13:23:42 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=RrnG5uonjgslWjO5JpmTOa3x6Z0NVn7zLI+OIKMJY90=; b=uBlEYbmPRj/l5Ob3fvYdLOsV7IIlSJXf1MmnxI41AQesZ2JYD0kiRRL5ipCc48WEWDJbmmufjzdkiU0qaui76c4tmL/SNNVPSEHlTNTIzpx0Q/taRBq2pVkomGmKd6UkWyvtg42up+JGDmY6KHtAlDUsmDq4HCNWQQprD29ovj8= Received: from BLUPR0201CA0014.namprd02.prod.outlook.com (10.163.116.24) by BN6PR02MB2769.namprd02.prod.outlook.com (10.175.95.147) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10; Wed, 4 Jan 2017 13:23:17 +0000 Received: from SN1NAM02FT038.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by BLUPR0201CA0014.outlook.office365.com (2a01:111:e400:52e7::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.817.10 via Frontend Transport; Wed, 4 Jan 2017 13:23:17 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; apm.com; dkim=none (message not signed) header.d=none;apm.com; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.83 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.83; helo=xsj-pvapsmtpgw01; Received: from xsj-pvapsmtpgw01 (149.199.60.83) by SN1NAM02FT038.mail.protection.outlook.com (10.152.72.69) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.803.8 via Frontend Transport; Wed, 4 Jan 2017 13:23:16 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66] helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw01 with esmtp (Exim 4.63) (envelope-from ) id 1cOlXA-00071q-83; Wed, 04 Jan 2017 05:23:16 -0800 Received: from [127.0.0.1] (helo=localhost) by xsj-pvapsmtp01 with smtp (Exim 4.63) (envelope-from ) id 1cOlXA-0007f7-36; Wed, 04 Jan 2017 05:23:16 -0800 Received: from [172.23.64.139] (helo=xhd-lin64re116.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1cOlX2-0007cl-KM; Wed, 04 Jan 2017 05:23:08 -0800 Received: by xhd-lin64re116.xilinx.com (Postfix, from userid 16987) id D00A6302698; Wed, 4 Jan 2017 18:53:07 +0530 (IST) From: Manish Narani To: , , , , , , , , , , , , , , , , , , Subject: [RFC PATCH] usb: dwc3: core: add OTG support function calls and modifications Date: Wed, 4 Jan 2017 18:52:57 +0530 Message-ID: <1483536181-22356-3-git-send-email-mnarani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1483536181-22356-1-git-send-email-mnarani@xilinx.com> References: <1483536181-22356-1-git-send-email-mnarani@xilinx.com> X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-22802.006 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.83; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(39450400003)(39410400002)(39850400002)(39840400002)(2980300002)(438002)(199003)(189002)(626004)(36756003)(50466002)(46386002)(4001430100002)(2906002)(48376002)(47776003)(6666003)(54906002)(92566002)(52956003)(33646002)(106466001)(45336002)(81166006)(81156014)(103686003)(4326007)(2950100002)(8676002)(189998001)(107886002)(36386004)(90966002)(5003940100001)(38730400001)(305945005)(5660300001)(5001770100001)(7416002)(50986999)(50226002)(76176999)(8936002)(42186005)(63266004)(2201001)(356003)(107986001)(921003)(2101003)(1121003)(83996005); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR02MB2769; H:xsj-pvapsmtpgw01; FPR:; SPF:Pass; PTR:unknown-60-83.xilinx.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT038; 1:pp+sk8AyzQ7c1ARit+1jPIKtfmDVcvEiUqKRT2zdgNdrwJN+3JpbGAbKZIS35ytcpsrAXqifYjiyVgKZ14RIPgqJlZjsDQl7iG3byHm4+5txylz+5wgo7rIG9guaRnoi9wDS4vAZnpRbZs30emxf1gJXpkOxxXXqBvyanEC/e7R/+ZdQ1VrEdM3vyTJH3Xg05A/6mnamrw3oTbZRWtooqIdhmQYeU3TlfKq9tvrvsr6ZCjmOI8F3n17I/CO3+ReYL0kjOxw8NXkp9wRL5NmxQKL4KVJauxrKe3gjgy11FyeK+KzUeZ4deUlXj70ZxC0W+MmY7BrGaid56D2f3X7rEILIOBpM5A2Te/AHr8tX11/HrBhNSv3RzlvtsDhGXsXfQSczfjvvf3PB//L/N+HkwJ6/QLU7AUjkTB4Gd1Cz0khNROxw+x8cjetPWd0JOKfvUW0rlCpX8C2X88CL5o5ZRv2WzcYRD9t7nTj4WUG9XMdlnl/saGQGUVxT0IDcja2Ud4ABu45JNggFHarSR1gC/UE7darqz7ITVbHa4uRGp9ZpI2yviaBpRptApjMPDiQYzVeN0WO1yPGMDNi7vmZt4xcTtIrnTH70Zu6ImmgvUWBN47+19SkA0Faqnm8AoRp9xrauJbg/nqWtfkJcjAEa1Q== MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 11c2581e-ce10-4a52-58fe-08d434a4d83d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:BN6PR02MB2769; X-Microsoft-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GflMbKk8LCkxv2GuChn0M+r41+Aumnt6H2JXyEFFh/qRn7fymefAIjHTkrSVz2ojjQUP8o9gXMQ20NN6qlOVB/jTwL4PuIf9EjK5O0Wzn1lUH3sw6sOkWPEoIMAtrSSQf3OTrAJSpZUQpj73Lcidem/tA8rLSd8LI+RiPM/Q=; 20:bYxxuGhcl1j/JimwliSnPYCm2QXHNUmmYPL3QTPXuONHBwSf3LXqN51lVxEi7GZE7uoxxmOh0wbk3IroxECEDlzo1WI32MFsQ6orWl1EVwJr9kObwb92RvcHlsg40FqkWZ/DeqaQnksD/DUTDxCHbl3ny6XTSiRVCT0P4PRCpiEaKSx+Wxx9D7POte3qB12XRvaCPDKI6qnzQRorkzolYo1Ed1eKZLaLNtrWuqk8bfFAH/Y4zHTq+ZEuBPJQnT+x8MNd9NL36/YVSqMxLa1DkKjDuptUwPN5YPyDd5Q4bgZQHceSbi1T4lfdqdPPsBeQzivBb1FgbdnWVjYcu4dnY4D2XtdMBiiTPnPokVF4GBm+UAZ/ze87SO3nsb1MppvjZwph72FR6Pzjz1mjjkJzu+l4iN94fq0+jTWoxdW266eVIYBwZrkBQw4LmiErBkWXrMp9VSV7ddjlh9lYgbR/5Cecj5Sbs2wyEMiXYy1luV5z+3bKj4O7yI1gq3zlTdSL X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13024025)(13023025)(13015025)(13017025)(13018025)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(6072148); SRVR:BN6PR02MB2769; BCL:0; PCL:0; RULEID:; SRVR:BN6PR02MB2769; X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2769; 4:JXaWNqQcr75orOv2zFX5MPnXYAB8WAVcLMWa4Y/LS9HlfGzC2Z0QvYZr52XKLbIx4O+wqN2t5ZRH2bZNe4KjoVB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/7K5Gl?= =?us-ascii?Q?iKUuhz1iu48Tyir3LLlBO55/SJJhsgOihRTCrGZsXb4s9cTzC+dxWODKnd7p?= =?us-ascii?Q?4nM6kled0tZwbZgMqYDO7ML7OKHRM+RO7HuTtHsMco4R3oaANq5+RCfyu+bV?= =?us-ascii?Q?GwOKEI49dVMRldSPLZ1ihE=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2769; 6:/2T1t2buHL+1HZrf/V+/IWYG2Gnj8bHes4duxuytymlC4GwNItjEIxVUi+7qFvHE6ky0vgW7IzZJyKngdHYRaqhF1lqlojKZxhCW4izFGu6rryou/D8ucgn9gxu4m82GJuYizXD1imWxV4MRrBeOkaqwjfrv7iYQm/+lnLCnL/UmmiAY22pFDkygpBIWZKLKQLT1jgfaqhAuP1RHxNh9ekhX+fIRPkmXAI+kaD3tiaKI4NxCsAY9gKaQjNVPiIKZtrdJxSO5B/npzVIe0MrvAcQ7A9BFvLNvFFAKVaKzgeeVp8CgjAz7eWJvQ8zVuHK5fbC6y/9foaGk6uvyqRf2qRfoh5SApnJ48h2It/SYUSx8vcqqJHBacF91w3vmrK/waXxJZyUBGZ8+xkVfC9CnPe/9fo0EqViOBWwfOqHtg62R1+IfuAKIk3ckbhO2FZiShjk6Uvy6TYJVUtec16l24Q==; 5:66DQXtXq1tlkCBhEjHiw00Wh7NMheeIo+xpnG4PWRc94Bbrb4hd1v6DiHjKcBFmmGdvhsWjVQ/uget72ncjgBTM19xD0103QC/zLtUIq72Qn84Ar+TniQDYnExsz+8I84Js+IXAk6XQJAbQXLqopNkWslYmk7Xql3bDWZYLlY4g=; 24:C2trksRPtV/na7cwG+5/7DDbO4kRp5b2HNJhUYebQe18s+jvZve6+XMaAx9/NGTZ2W/dzP1erz1LY8jHvjrkRcK7A5bpWbixsipNEGRWdk8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR02MB2769; 7:tVD7R6qlGo4WwRxEG7hHrmgLWh7rM/PblwYHRNlGQ0+t/Ui/NdRP0kld258WD1iB+pPt4q96EwT8CySihw2RgRxio0xHrMSXFVsUWZVeVRsajAUns4DAO/oWdkzkK4xsdYxO7zI9KBwYENlVL8b3h6Q/qjZuQAmE6zQvyzOuKIj+iRp8GkEr10cNVIkpD5r0TJOaZMEupXtDjdbM1+7N2Xwq9dKoLtA2yJUZwhZfJh7M2KCLPMZzK2a0i8+qNq4Nqax3Tl77LdtmMUfaD+VNY07hO0CTOtpHc+kx/U8TouZH3oV1BsORMARECXtbhDFQUzIcoxjsojJtIympK+1cc1oOd9+7Nh254u25mM/I6N/HG1rkWQA+hgJbny7U8SD9APdkCGLCuullMFDHeYciIHM0vmd+olIhT7fTVQdsYupHEh/Wv5Xk7EeDIrYKq3rCzpptOiGQjRdvY5r0Q8Li6w== X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Jan 2017 13:23:16.6856 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.83]; Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR02MB2769 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170104_132340_872858_8BA003B7 X-CRM114-Status: GOOD ( 17.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: anuragku@xilinx.com, anirudh@xilinx.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds function call to initialize OTG driver. This patch also adds support for OTG device structure in DWC3 device. Modifications to event buffer related functions which are called from OTG driver upon requirement. Signed-off-by: Manish Narani --- drivers/usb/dwc3/core.c | 17 ++++++++++++----- drivers/usb/dwc3/core.h | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 369bab1..9ab9c5b 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -240,7 +240,7 @@ static struct dwc3_event_buffer *dwc3_alloc_one_event_buffer(struct dwc3 *dwc, * dwc3_free_event_buffers - frees all allocated event buffers * @dwc: Pointer to our controller context structure */ -static void dwc3_free_event_buffers(struct dwc3 *dwc) +void dwc3_free_event_buffers(struct dwc3 *dwc) { struct dwc3_event_buffer *evt; @@ -257,7 +257,7 @@ static void dwc3_free_event_buffers(struct dwc3 *dwc) * Returns 0 on success otherwise negative errno. In the error case, dwc * may contain some buffers allocated but not all which were requested. */ -static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) +int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) { struct dwc3_event_buffer *evt; @@ -277,7 +277,7 @@ static int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length) * * Returns 0 on success otherwise negative errno. */ -static int dwc3_event_buffers_setup(struct dwc3 *dwc) +int dwc3_event_buffers_setup(struct dwc3 *dwc) { struct dwc3_event_buffer *evt; @@ -862,10 +862,10 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) } break; case USB_DR_MODE_OTG: - ret = dwc3_host_init(dwc); + ret = dwc3_otg_init(dwc); if (ret) { if (ret != -EPROBE_DEFER) - dev_err(dev, "failed to initialize host\n"); + dev_err(dev, "failed to initialize otg\n"); return ret; } @@ -875,6 +875,13 @@ static int dwc3_core_init_mode(struct dwc3 *dwc) dev_err(dev, "failed to initialize gadget\n"); return ret; } + + ret = dwc3_host_init(dwc); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(dev, "failed to initialize host\n"); + return ret; + } break; default: dev_err(dev, "Unsupported mode of operation %d\n", dwc->dr_mode); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index de5a857..6b92064 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -887,6 +887,8 @@ struct dwc3 { struct usb_gadget gadget; struct usb_gadget_driver *gadget_driver; + struct dwc3_otg *otg; + struct usb_phy *usb2_phy; struct usb_phy *usb3_phy; @@ -987,6 +989,7 @@ struct dwc3 { unsigned setup_packet_pending:1; unsigned three_stage_setup:1; unsigned usb3_lpm_capable:1; + unsigned remote_wakeup:1; unsigned disable_scramble_quirk:1; unsigned u2exit_lfps_quirk:1; @@ -1220,6 +1223,13 @@ static inline int dwc3_send_gadget_generic_command(struct dwc3 *dwc, { return 0; } #endif +#if IS_ENABLED(CONFIG_USB_DWC3_DUAL_ROLE) +int dwc3_otg_init(struct dwc3 *dwc); +#else +static inline int dwc3_otg_init(struct dwc3 *dwc) +{ return 0; } +#endif + /* power management interface */ #if !IS_ENABLED(CONFIG_USB_DWC3_HOST) int dwc3_gadget_suspend(struct dwc3 *dwc); @@ -1251,4 +1261,8 @@ static inline void dwc3_ulpi_exit(struct dwc3 *dwc) { } #endif +int dwc3_alloc_event_buffers(struct dwc3 *dwc, unsigned length); +void dwc3_free_event_buffers(struct dwc3 *dwc); +int dwc3_event_buffers_setup(struct dwc3 *dwc); + #endif /* __DRIVERS_USB_DWC3_CORE_H */