From patchwork Sun Mar 17 18:23:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grazvydas Ignotas X-Patchwork-Id: 2284271 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 9F900E00DD for ; Sun, 17 Mar 2013 18:23:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932767Ab3CQSX4 (ORCPT ); Sun, 17 Mar 2013 14:23:56 -0400 Received: from mail-ea0-f178.google.com ([209.85.215.178]:43408 "EHLO mail-ea0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932756Ab3CQSXw (ORCPT ); Sun, 17 Mar 2013 14:23:52 -0400 Received: by mail-ea0-f178.google.com with SMTP id g14so2270382eak.23 for ; Sun, 17 Mar 2013 11:23:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=jfU+ZDniH9ZixlSnXgi/iGmXxSj4IZ5eiFjrb/JZTs0=; b=cf+K0LYqtA1d0S6dMkt/ucJ8hh9ECDeyhbS26scYiexXjJXghBxOBPx27SpeExWWPv EjcbQzuYS76RnIjwrAk6DljzzBPBYfU/yIpSTha1e7hYmbpmAttntKerzquyPbanhiL7 5pPCpIVKkBGHwz3mQpofOF5Mxm30d4jG4vjZWLG8fEWsxErB4DKL+f0co9jIY0hmWB/W ZCGCKmJlra4WuPCvi+xj1odi8dtrYHEtY4LFV4vx6XqpwpiGQkL9ixne8BIG8thj0SkX Vx+pQWEc7RAHMs6uaQcovEQ1FEKK7qys/yLpb5rwkbc4Wa2dzcXRu+HGVQxaB9XflEIs 0UpQ== X-Received: by 10.14.210.8 with SMTP id t8mr40793917eeo.35.1363544631094; Sun, 17 Mar 2013 11:23:51 -0700 (PDT) Received: from localhost.localdomain (ip-88-119-226-136.static.b4net.lt. [88.119.226.136]) by mx.google.com with ESMTPS id a1sm22724358eep.2.2013.03.17.11.23.49 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 17 Mar 2013 11:23:50 -0700 (PDT) From: Grazvydas Ignotas To: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org, Felipe Balbi , NeilBrown , kishon , Grazvydas Ignotas Subject: [PATCHv2 6/7] usb: musb: omap2430: turn off vbus on cable disconnect Date: Sun, 17 Mar 2013 20:23:26 +0200 Message-Id: <1363544607-17634-7-git-send-email-notasas@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363544607-17634-1-git-send-email-notasas@gmail.com> References: <1363544607-17634-1-git-send-email-notasas@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org On USB_EVENT_ID event the musb glue enables VBUS by calling omap2430_musb_set_vbus(musb, 1) that sets the session bit, but on USB_EVENT_NONE reverse action is never made, and that breaks PM. Disable VBUS on USB_EVENT_NONE to be sure musb session is ended on cable unplug so that PM works. Signed-off-by: Grazvydas Ignotas --- drivers/usb/musb/omap2430.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index ec460ea..780a750 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -291,6 +291,7 @@ static void omap_musb_set_mailbox(struct omap2430_glue *glue) musb->xceiv->last_event = USB_EVENT_NONE; if (musb->gadget_driver) { + omap2430_musb_set_vbus(musb, 0); pm_runtime_mark_last_busy(dev); pm_runtime_put_autosuspend(dev); }