From patchwork Thu Apr 4 09:37:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Cercueil X-Patchwork-Id: 10885315 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C988D922 for ; Thu, 4 Apr 2019 09:38:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B29D328329 for ; Thu, 4 Apr 2019 09:38:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A5A5828A21; Thu, 4 Apr 2019 09:38:07 +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=-7.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,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 30BB128329 for ; Thu, 4 Apr 2019 09:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732053AbfDDJhy (ORCPT ); Thu, 4 Apr 2019 05:37:54 -0400 Received: from outils.crapouillou.net ([89.234.176.41]:58190 "EHLO crapouillou.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730726AbfDDJhy (ORCPT ); Thu, 4 Apr 2019 05:37:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crapouillou.net; s=mail; t=1554370670; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=F5VToilLnMBME9L+TXy2uaYnd9STb1aEJYklDsxqWuQ=; b=QRoB0vcM9gcLxl3Uf7c5RHDTeJTflknGkL7a27BdL6DxyUKMmsxbUiREfovQ0IkMfYIkEx QBXDb9EhacgyA0xz2tislqRLgK632OO/+24rhnmHDoiYKgAfd6QZTvkFMwLO4LKKu06JWe LlxEVLSuspXuHt3iWm1vIqwHIV2PFFM= From: Paul Cercueil To: Bin Liu Cc: od@zcrc.me, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Paul Cercueil Subject: [PATCH] usb: musb: Disable pullup in gadget setup Date: Thu, 4 Apr 2019 11:37:43 +0200 Message-Id: <20190404093743.6470-1-paul@crapouillou.net> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The pullup may be already enabled before the driver is initialized. It has to be disabled at init time, as we cannot guarantee that a gadget driver will be bound to the UDC. Signed-off-by: Paul Cercueil --- drivers/usb/musb/musb_gadget.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index ffe462a657b1..094dc59c834c 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1794,6 +1794,7 @@ int musb_gadget_setup(struct musb *musb) musb->is_active = 0; musb_platform_try_idle(musb, 0); + musb_pullup(musb, 0); status = usb_add_gadget_udc(musb->controller, &musb->g); if (status)