From patchwork Tue Nov 18 01:21:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kever Yang X-Patchwork-Id: 5325121 Return-Path: X-Original-To: patchwork-linux-rockchip@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 391B39F1E1 for ; Tue, 18 Nov 2014 01:22:04 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5F1E820127 for ; Tue, 18 Nov 2014 01:22:03 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 77E7D20120 for ; Tue, 18 Nov 2014 01:22:02 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqXUX-0000Zh-MR; Tue, 18 Nov 2014 01:22:01 +0000 Received: from mail-pa0-x229.google.com ([2607:f8b0:400e:c03::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XqXUV-0000N3-Lu for linux-rockchip@lists.infradead.org; Tue, 18 Nov 2014 01:22:00 +0000 Received: by mail-pa0-f41.google.com with SMTP id rd3so8836006pab.14 for ; Mon, 17 Nov 2014 17:21:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=kdjhT9j6N7uF8mJhJ99M9f+pcwxv4+lvlGNTUC/bHH8=; b=U35O93wOr3vpkYvsa6XUyMvAPLyk/CMadnRWB7CPAVqDCid1cdZ8Ct9dISMpSPQRTl 5sm4Hs8tUt9AcbD+wvU3vwv6wg/4EmxwftqpBUFQwcw8kIsugSl8k9EUKanE8+I+SMoJ zHCEDJGCx5wbjANI/4+58cGpJc0OaYB76w83GwsY8560hHddHY9VPgDIWy/ycJXJ1FfP RYOQTCRDLJUbEeMKY4wzZ1CpT7eS0lqKhIqciAHCqf10fRGGM2+w+F8apeMrDS5jzhQU 4JHHqOXHPPwlKI7i+Wwmy+07iipcBTCJgEOBtBWtsteuNLs4a5ebCR+laHXxIPihpky6 /ixA== X-Received: by 10.68.249.133 with SMTP id yu5mr33235672pbc.31.1416273698663; Mon, 17 Nov 2014 17:21:38 -0800 (PST) Received: from localhost.localdomain ([58.22.7.114]) by mx.google.com with ESMTPSA id sd4sm18683019pbc.83.2014.11.17.17.21.30 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Nov 2014 17:21:37 -0800 (PST) From: Kever Yang To: Paul Zimmerman , Felipe Balbi Subject: [PATCH v2] usb: dwc2: resume root hub when device detect with suspend state Date: Tue, 18 Nov 2014 09:21:24 +0800 Message-Id: <1416273684-11300-1-git-send-email-kever.yang@rock-chips.com> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141117_172159_742692_CDC2BD84 X-CRM114-Status: UNSURE ( 9.56 ) X-CRM114-Notice: Please train this message. X-Spam-Score: 0.0 (/) Cc: huangtao@rock-chips.com, addy.ke@rock-chips.com, Heiko Stuebner , Greg Kroah-Hartman , linux-usb@vger.kernel.org, dianders@chromium.org, Kever Yang , linux-rockchip@lists.infradead.org, cf@rock-chips.com, wulf@rock-chips.com, Dinh Nguyen , romain.perier@gmail.com, sonnyrao@chromium.org, Roy Li , linux-kernel@vger.kernel.org X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP After we implement the bus_suspend/resume, auto suspend id enabled. The root hub will be auto suspend if there is no device connected, we need to resume the root hub when a device connect detect. This patch tested on rk3288. Signed-off-by: Roy Li Signed-off-by: Kever Yang Tested-by: Doug Anderson Reviewed-by: Felipe Balbi --- Changes in v2: - add definition for hcd structure - remove check for bus->root_hub drivers/usb/dwc2/hcd_intr.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/dwc2/hcd_intr.c b/drivers/usb/dwc2/hcd_intr.c index 551ba87..680206f 100644 --- a/drivers/usb/dwc2/hcd_intr.c +++ b/drivers/usb/dwc2/hcd_intr.c @@ -329,6 +329,7 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg) { u32 hprt0; u32 hprt0_modify; + struct usb_hcd *hcd = (struct usb_hcd *)hsotg->priv; dev_vdbg(hsotg->dev, "--Port Interrupt--\n"); @@ -354,6 +355,10 @@ static void dwc2_port_intr(struct dwc2_hsotg *hsotg) hsotg->flags.b.port_connect_status = 1; hprt0_modify |= HPRT0_CONNDET; + /* resume root hub? */ + if (hcd->state == HC_STATE_SUSPENDED) + usb_hcd_resume_root_hub(hcd); + /* * The Hub driver asserts a reset when it sees port connect * status change flag