From patchwork Tue Aug 23 12:11:13 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yoshihiro Shimoda X-Patchwork-Id: 9295557 X-Patchwork-Delegate: geert@linux-m68k.org 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 1726A60757 for ; Tue, 23 Aug 2016 12:12:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0891228C21 for ; Tue, 23 Aug 2016 12:12:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F12C228C2B; Tue, 23 Aug 2016 12:12:45 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 16D9128C2D for ; Tue, 23 Aug 2016 12:12:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756514AbcHWMMn (ORCPT ); Tue, 23 Aug 2016 08:12:43 -0400 Received: from relmlor1.renesas.com ([210.160.252.171]:35215 "EHLO relmlie4.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756697AbcHWMMj (ORCPT ); Tue, 23 Aug 2016 08:12:39 -0400 Received: from unknown (HELO relmlir2.idc.renesas.com) ([10.200.68.152]) by relmlie4.idc.renesas.com with ESMTP; 23 Aug 2016 21:12:25 +0900 Received: from relmlac3.idc.renesas.com (relmlac3.idc.renesas.com [10.200.69.23]) by relmlir2.idc.renesas.com (Postfix) with ESMTP id 1A2F64D9C7; Tue, 23 Aug 2016 21:12:25 +0900 (JST) Received: by relmlac3.idc.renesas.com (Postfix, from userid 0) id 1614F1806F; Tue, 23 Aug 2016 21:12:25 +0900 (JST) Received: from relmlac3.idc.renesas.com (localhost [127.0.0.1]) by relmlac3.idc.renesas.com (Postfix) with ESMTP id 108FF1800A; Tue, 23 Aug 2016 21:12:25 +0900 (JST) Received: from relmlii1.idc.renesas.com [10.200.68.65] by relmlac3.idc.renesas.com with ESMTP id XAJ01917; Tue, 23 Aug 2016 21:12:25 +0900 X-IronPort-AV: E=Sophos;i="5.22,559,1449500400"; d="scan'";a="217918064" Received: from mail-hk2apc01lp0210.outbound.protection.outlook.com (HELO APC01-HK2-obe.outbound.protection.outlook.com) ([65.55.88.210]) by relmlii1.idc.renesas.com with ESMTP/TLS/AES256-SHA; 23 Aug 2016 21:12:24 +0900 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=renesasgroup.onmicrosoft.com; s=selector1-renesas-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/4w41x+JOPY+v2x3h56cymHxUV8dX4it7LugWirY+iM=; b=RIKL2uKcLe20ZPkvQFwuZ56i6zJbuTZHx6S3rX9Z/44R3/UXYt9qrSC4C5LJ3m0X7WTeOVbaR0ldZArZTRzI/76xUw0LSD8TMn6VRQ9Zp5nW6vPJSENRWz5hjlIm5Hjf2fGBY2OVd+C92a4rTkYUna5yYsx/8YA9e6n7HJP2jTw= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=<>; Received: from localhost.localdomain (211.11.155.144) by SIXPR06MB0560.apcprd06.prod.outlook.com (10.160.238.153) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.587.9; Tue, 23 Aug 2016 12:12:22 +0000 From: Yoshihiro Shimoda To: CC: , , , , Yoshihiro Shimoda Subject: [PATCH] usb: gadget: udc: renesas-usb3: clear VBOUT bit in DRD_CON Date: Tue, 23 Aug 2016 21:11:13 +0900 Message-ID: <1471954273-29729-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [211.11.155.144] X-ClientProxiedBy: OS2PR01CA0010.jpnprd01.prod.outlook.com (10.161.74.148) To SIXPR06MB0560.apcprd06.prod.outlook.com (10.160.238.153) X-MS-Office365-Filtering-Correlation-Id: 08c4e4da-d3a8-4470-65d5-08d3cb4ebd01 X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0560; 2:C1TdUpXAy6NX4AXDL3+xPWlyoTOapO9+vjOyrYoxHY5tyzg+loeftgtf8EyeLxcLleXmjaWJNeKYnUhrSMLl+vNSH05MwA+6Vg4tj5NwRkZXJ/xrxZDFWvdXft5AhrHKU3M/Mh+WlX/xplJLubLcx0Pc4VStVrSqxk1vcCyLZuC72mZW7yMCFmVVc5lolWZh; 3:t9FggIjoe7LSuaUJ5tiSw4qyqEFqBMpuc+RjjfY9LgudxbyC1ijDpN2GCrM4ZHWU7QNOeuBgJ94XShd1rb8ONiNE1Hlprs6tGz4W/RB23jA8e5ULT8c3UpIaAb7VqiCf X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SIXPR06MB0560; X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0560; 25:KrIDO5FPy+mVxjS2bBQreEH93zVmU4Twdcbor/X+iSrUEjbivBVbbYfGGrfW8xaomKRhFY4OtC5sPAHORsmex2o8WUSdWDkeW8ms8cQOui/d/o1unHALdCZ2VBXu2w8AkwsLHPQmwyX0cX1sOpOZ4pDl/t91KlCXYAioFMdyldoVkGdAd2neZwN+zqdy1gYOZLJQ4uQ8NUuZKBvnX6qksYnUSHZj5/dHanZo2iXV1RnLWJDaE9zPm+/IDrQP3Aqi3p9549pQFpQ97DXzg5TjMAPQnD8VCzBIs7dAgpUqNp3BgU1zLKCXiob51wFRYk9nK3VCrymE/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yNZZRTqRnvJ6LjPY2U7RVLBXx5r+kd0iArmYBnMwn9Ky9w4sQFymAaG+cM6OsSmNZ7BUd5AC/JfPWTKv4XbBZ2dlLoqa3DJd/Ei7BZBBF/kUjYiP1CcLAfS6CDOrZ8LcfEMeyjCxBwDrz0izvHPksOJWENVS/ifvvWXzkMu91DnZj X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(9452136761055); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026); SRVR:SIXPR06MB0560; BCL:0; PCL:0; RULEID:; SRVR:SIXPR06MB0560; X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0560; 4:kPkPef2vWhKOHuSRGCCw8RC4G5i7dnSvov0q92jSCQtPcNtBYLV0L+0FR5ayPXepl4IgslLrGXFQoPncY4h8mxqwRQinSg8CqVFkV3OSuygnhXHP689zpYU6xBijya3vSgDyg6hmjXQ6hUUIERRJ8H/dkusCRkFpfUh7otyHDw3ZPBrjWxlkClOb7djGCMj4U3n+N+j8utjVSzapF6bDiZQ/FqCu34kl9Ay4o15SjTNxIdEUnBAa5k+GqNiI1zNPb0KEOs6B7PtR3aIdYZ8WSNXE0gpp38ti0PQdQu/eHBvcnayBSqx4gkhgQmbxtq8uWHtBlXMdiAUx4PZiDJidQBJtqIN9wI6dcmoG7FPMZCODfw55WCR7AzCHEp4Malsw4BO5xE9AfJg9FrV9123mbOr1/nyYmle0+pxF2sfoOSPUleAAfFyYFUZPkLHnCe4B X-Forefront-PRVS: 004395A01C X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(7916002)(189002)(199003)(229853001)(50466002)(2351001)(36756003)(50986999)(33646002)(66066001)(48376002)(47776003)(81166006)(81156014)(6116002)(50226002)(8676002)(5660300001)(92566002)(305945005)(586003)(77096005)(4326007)(78352004)(7846002)(3846002)(7736002)(68736007)(2906002)(97736004)(110136002)(4001430100002)(5003940100001)(189998001)(107886002)(19580405001)(19580395003)(105586002)(101416001)(106356001)(42186005); DIR:OUT; SFP:1102; SCL:1; SRVR:SIXPR06MB0560; H:localhost.localdomain; FPR:; SPF:None; PTR:InfoNoRecords; MX:0; A:0; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SIXPR06MB0560; 23:lkwBJDUjnfxpsickOuw9aU8JUTivicvZY2Qy5C25f?= =?us-ascii?Q?b7YHS9Wke+JXRfNIWK3v7sC1nmJZom8TSqbNOeTnm16dcXrsk1VRrXo1vr7U?= =?us-ascii?Q?L2YZ0qgypFQpARJxxsdHPCYjrj7inUz62boY2Fj5bTy2JzqylovDJPPVYWbl?= =?us-ascii?Q?eLSzCin1hwvZ0i1dsy8qSCwaCFermhD2dGVdv3+fTtBCVy/I9IcjNPtWDB03?= =?us-ascii?Q?LQTuRG1Bs/JY1YUa9brsJz0P9ftOS810kthXiOu6CocFYNfLB+M65LpsKo3c?= =?us-ascii?Q?9z02ZHjGFeH/bGXTmx4+i/3vb6i2/GGh/pMNrvPNjZ/EKzkkTEu1yEaLVGex?= =?us-ascii?Q?2ZKawc+51GUk+3PuaTsrqMeerHqJeXJYCAGhXuewcAiG6SG1pMRk7I5O4nov?= =?us-ascii?Q?LHORyU2v9ZHgM2lzEDHycnnQgnqHVaFYSPj/HuaPkgcc/cP13yfPUg51z2LR?= =?us-ascii?Q?ZyXnS8X5gi0MsMkGRQPUhoO7/w6YIM2debWl4gts6dh3agMvqu5YDIa8dTb6?= =?us-ascii?Q?hCcf7CqM/nSBZ5kVLY7u+6XHsPhElESohxKgYhoyy0CHCGfVry8MCtU4UIUI?= =?us-ascii?Q?V8QhH9z5w0kpJ8jbpDWmVb+CXkriNUiWJIsKFwcrv3CEPPVTwEQpSb4x19Il?= =?us-ascii?Q?wD+E9FbdIyo3F06jtLRtsedTOjXeB0ju99HC116G/5Gtxy6QMgCS/gFcMKF9?= =?us-ascii?Q?v8Qk5y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ouvUwgh3vio6e1GhD6WMpHNyUJR3WLsUgS5NqVU0U1X9flgHh5BJ17m4HLJ66AH5aTr8O6Q7BFB7s0npsqw5tJENtWpxFQVS8Vz/vZA=; 7:7vQUowtoef2P6bZ4FFATxBkHEnHzXr5y6NpJtrHcF2zv5cy1kseFmrRPojgnmpzxiWXH1u0nyIr6E1HHCt3piWdh9j09i7txRbTzxkuZhHVD5b6U3JoFVOw1k3uanow8Lz3CJi4pLEAgwgRuJ8IWnoZs4z1iK2zRoD33P9HS+x90psDyqQ+YvcaPQahbcWz9z6qmym20N6eLVYYlJH6IKW8NCsQA+1CjaAQfnL7dUGpsnoDkumXOiAQzVvm7OUg+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SIXPR06MB0560; 20:uKqzpr+7iVCG6ely1C7zJSDl1ZDjLFUTkXZa6BXf3lwr94RhuNMcP9Kggor5g95/65se+4fJqVbfBo6oH4zUU9bPTHvRfbfBTyBRK5FNq2V5etttUY6Ab5qLSu2cQGmhaawjYTjAXB7ehXIuHDTf/kU4ncaxSLktfBujtTJlols= X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Aug 2016 12:12:22.0879 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SIXPR06MB0560 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This driver should clear the bit. Otherwise, the VBUS will output wrongly if the usb port on a board has VBUS output capability. Fixes: 746bfe63bba3 ("usb: gadget: renesas_usb3: add support for Renesas USB3.0 peripheral controller") Cc: # v4.5+ Signed-off-by: Yoshihiro Shimoda --- drivers/usb/gadget/udc/renesas_usb3.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/gadget/udc/renesas_usb3.c b/drivers/usb/gadget/udc/renesas_usb3.c index 93a3bec..fb8fc34 100644 --- a/drivers/usb/gadget/udc/renesas_usb3.c +++ b/drivers/usb/gadget/udc/renesas_usb3.c @@ -106,6 +106,7 @@ /* DRD_CON */ #define DRD_CON_PERI_CON BIT(24) +#define DRD_CON_VBOUT BIT(0) /* USB_INT_ENA_1 and USB_INT_STA_1 */ #define USB_INT_1_B3_PLLWKUP BIT(31) @@ -363,6 +364,7 @@ static void usb3_init_epc_registers(struct renesas_usb3 *usb3) { /* FIXME: How to change host / peripheral mode as well? */ usb3_set_bit(usb3, DRD_CON_PERI_CON, USB3_DRD_CON); + usb3_clear_bit(usb3, DRD_CON_VBOUT, USB3_DRD_CON); usb3_write(usb3, ~0, USB3_USB_INT_STA_1); usb3_enable_irq_1(usb3, USB_INT_1_VBUS_CNG);