From patchwork Wed Mar 15 14:08:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Moreno Bartalucci X-Patchwork-Id: 9625831 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 6CF9A6048C for ; Wed, 15 Mar 2017 14:44:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 610E028624 for ; Wed, 15 Mar 2017 14:44:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5553D2863A; Wed, 15 Mar 2017 14:44:36 +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,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 BC36F28636 for ; Wed, 15 Mar 2017 14:44:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753450AbdCOOnx (ORCPT ); Wed, 15 Mar 2017 10:43:53 -0400 Received: from out.consiagnet.it ([83.149.128.196]:28474 "EHLO out.consiagnet.it" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753100AbdCOOmo (ORCPT ); Wed, 15 Mar 2017 10:42:44 -0400 X-Greylist: delayed 1972 seconds by postgrey-1.27 at vger.kernel.org; Wed, 15 Mar 2017 10:42:43 EDT Received: from hermes.tecnorama.it (host-static-157-154.consiagnet.it [83.149.157.154] (may be forged)) by out.consiagnet.it (8.15.2/8.15.2) with ESMTP id v2FE9eGH062572; Wed, 15 Mar 2017 15:09:41 +0100 (CET) (envelope-from moreno.bartalucci@tecnorama.it) Received: from localhost (localhost [127.0.0.1]) by hermes.tecnorama.it (Postfix) with ESMTP id D2CD5B407AE; Wed, 15 Mar 2017 15:09:26 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at tecnorama.it Received: from hermes.tecnorama.it ([127.0.0.1]) by localhost (hermes.tecnorama.it [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YIFRiciUldNR; Wed, 15 Mar 2017 15:09:24 +0100 (CET) Received: from macmoreno.tecnorama.it (macmoreno.tecnorama.it [192.168.100.21]) (using TLSv1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by hermes.tecnorama.it (Postfix) with ESMTPSA id 905BCB4021F; Wed, 15 Mar 2017 15:09:24 +0100 (CET) From: Moreno Bartalucci To: Bin Liu Cc: linux-omap@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Alessio Igor Bogani , Moreno Bartalucci Subject: [PATCH] usb-musb: keep VBUS on when device is disconnected Date: Wed, 15 Mar 2017 15:08:01 +0100 Message-Id: <20170315140801.97230-1-moreno.bartalucci@tecnorama.it> X-Mailer: git-send-email 2.10.1 (Apple Git-78) Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP With usb-musb port in host mode, when the device is disconnected, either logically (because of a mode switch) or physically (by pulling the cable), the USB port should keep suppling VBUS, with no interruption, to prevent power loss on USB powered devices. Signed-off-by: Moreno Bartalucci --- drivers/usb/musb/musb_dsps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 7c047c4..5d9986b 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -245,7 +245,7 @@ static int dsps_check_status(struct musb *musb, void *unused) dsps_mod_timer_optional(glue); break; case OTG_STATE_A_WAIT_BCON: - musb_writeb(musb->mregs, MUSB_DEVCTL, 0); + musb_writeb(musb->mregs, MUSB_DEVCTL, MUSB_DEVCTL_SESSION); skip_session = 1; /* fall */