From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758834AbaJ3KKS (ORCPT ); Thu, 30 Oct 2014 06:10:18 -0400 Received: from mail-bn1bn0106.outbound.protection.outlook.com ([157.56.110.106]:13716 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758587AbaJ3KKM (ORCPT ); Thu, 30 Oct 2014 06:10:12 -0400 X-WSS-ID: 0NE95KS-07-XSN-02 X-M-MSG: From: Huang Rui To: Felipe Balbi , Alan Stern , "Bjorn Helgaas" , Greg Kroah-Hartman CC: Paul Zimmerman , Heikki Krogerus , Sergei Shtylyov , Jason Chang , Vincent Wan , Tony Li , , , , , Huang Rui Subject: [PATCH v4 01/20] usb: dwc3: enable hibernation if to be supported Date: Thu, 30 Oct 2014 18:08:26 +0800 Message-ID: <1414663725-2195-2-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1414663725-2195-1-git-send-email-ray.huang@amd.com> References: <1414663725-2195-1-git-send-email-ray.huang@amd.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(428002)(199003)(189002)(53416004)(68736004)(46102003)(93916002)(50986999)(48376002)(77096002)(19580405001)(86362001)(31966008)(80022003)(19580395003)(92726001)(44976005)(84676001)(4396001)(92566001)(2171001)(88136002)(77156001)(97736003)(33646002)(87936001)(87286001)(85306004)(85852003)(229853001)(102836001)(99396003)(36756003)(76482002)(107046002)(104166001)(76176999)(106466001)(64706001)(95666004)(20776003)(50466002)(89996001)(120916001)(50226001)(101416001)(105586002)(47776003)(62966002)(21056001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR02MB202;H:atltwp01.amd.com;FPR:;MLV:sfv;PTR:InfoDomainNonexistent;A:1;MX:1;LANG:en; X-Microsoft-Antispam: UriScan:; X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR02MB202; X-Forefront-PRVS: 038002787A Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=Ray.Huang@amd.com; X-OriginatorOrg: amd4.onmicrosoft.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It enables hibernation if the function is set in coreConsultant. Suggested-by: Felipe Balbi Signed-off-by: Huang Rui Signed-off-by: Felipe Balbi --- drivers/usb/dwc3/core.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index fa396fc..5a47482 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -447,8 +447,14 @@ static int dwc3_core_init(struct dwc3 *dwc) reg &= ~DWC3_GCTL_DSBLCLKGTNG; break; case DWC3_GHWPARAMS1_EN_PWROPT_HIB: - /* enable hibernation here */ dwc->nr_scratch = DWC3_GHWPARAMS4_HIBER_SCRATCHBUFS(hwparams4); + /* + * Enable hibernation here. + * + * Enabling this bit so that host-mode hibernation will + * work, device-mode hibernation is not implemented yet. + */ + reg |= DWC3_GCTL_GBLHIBERNATIONEN; break; default: dev_dbg(dwc->dev, "No power optimization available\n"); -- 1.9.1