Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2649776pxb; Tue, 13 Apr 2021 07:03:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJcn1llNUXDbsXPaocdWwvHA91kzorqOWmcT9r5axYeLSk9I3UYM7w+KnvkW2AWrImaSUj X-Received: by 2002:a05:6402:1051:: with SMTP id e17mr35263963edu.42.1618322619701; Tue, 13 Apr 2021 07:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618322619; cv=none; d=google.com; s=arc-20160816; b=Bw3S5U/eJF9tdvGPMdGSQhyAJTgK6RAW2r/1vaeb8BVT7wpJme6yXn6IhDeHFiieVo W7xIT89s2fHGoBgvzHHc1nf8VH/kNX3Zjuc7kgjgY9+Crj49QEu+X+ptZ6riLHeLrepI 1H8yck9K0M8EVkk9x4devNALP3MDjjlzzyY1S5hjZrzQOkYfddhEnL/Q8vh6286Y2EyK cNdNM+fvB+2Gf7bWK1XKBv6ejS63mmmEHUICFbpmiCrBl+vO8YiOF1MhDJXIf4h+OFfj 2nrDFq0Kvx8EwMW/Lt8ukE4kXTQP0GaKr5/SL09Y+FwOC7zg+Xm6EffNgsVlK74nauea zwEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:cc:to:subject:from:references :in-reply-to:date:dkim-signature; bh=ZE5aCCuEWh7a2oXUaC8LW0kdP1adMOHkAqdTn97qVD0=; b=uGmbBRUuqGknUCHanXU50GpedsSwnVdeTx2Gi5KHsig2H+cfCwyQX7JIXzPo/LhY4G ycAPoiJsdNDnYefAYnXZDX8R0/LF/iGlalakC88Z8+WBFdplsNOPhvgveUPU/91oDfQD Q6rQSz280zPkBRQ9VOcQkEgPftxcW4wgOjV1nxjeiJZY25t5FCwv0lWG1O7tvPzh4lRP dl1IfOTvUAhiFXD9WKGih9SSJABj/LHipfjWz1nMDAc+UuICNqALI2eglYsTLB+dxEpl CCjk4xaMnjn/GNH3QeltmgrS9Zzf2G+j8FpfEpg0zUAt+7tS6NLWKxF4OfQI2wEAGN7j clfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="g3/xysSb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q19si2134645ejc.124.2021.04.13.07.03.12; Tue, 13 Apr 2021 07:03:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b="g3/xysSb"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242450AbhDMHh7 (ORCPT + 99 others); Tue, 13 Apr 2021 03:37:59 -0400 Received: from smtprelay-out1.synopsys.com ([149.117.73.133]:36518 "EHLO smtprelay-out1.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241598AbhDMHhi (ORCPT ); Tue, 13 Apr 2021 03:37:38 -0400 Received: from mailhost.synopsys.com (mdc-mailhost2.synopsys.com [10.225.0.210]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by smtprelay-out1.synopsys.com (Postfix) with ESMTPS id DFA8D40162; Tue, 13 Apr 2021 07:37:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1618299439; bh=oQLK+as116JsTTrwBLAOVEJMYz2eNHyQVGS7SPLaUGU=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=g3/xysSbZVxmBNw/QcoiUV39KPyjS5jPK7ofrJeCxysCJHKDHx623afBwmWXykWDw QyuDS4/ZyTRZJlvH4IMCzC9bTT9r3y/pz3QErn763nsdNA+SQml+DyXce6EcjDHEDI 4Y1dBxti8n9I6cMKKcMtLNNKMe4kxTRtbnunqxpur67bFYf3OXZ2JQA4kfA157lxL6 74UfokeP9YVEDeU/5eJbxOqSRq1hl0GzLwvZRofOOz74bmaw33l+KsMaC0/5Nd2RtI nhIHEI08e0XfJNC6C6XB9ChrOmo36GSRkA/qdEr0+i6VbiEDfmFaOvcTgT6rfaHhSq diQO51rjzrkaA== Received: from razpc-HP (razpc-hp.internal.synopsys.com [10.116.126.207]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by mailhost.synopsys.com (Postfix) with ESMTPSA id 30C13A0094; Tue, 13 Apr 2021 07:37:16 +0000 (UTC) Received: by razpc-HP (sSMTP sendmail emulation); Tue, 13 Apr 2021 11:37:15 +0400 Date: Tue, 13 Apr 2021 11:37:15 +0400 In-Reply-To: References: X-SNPS-Relay: synopsys.com From: Artur Petrosyan Subject: [PATCH v2 10/12] usb: dwc2: Add clock gating entering flow by system suspend To: Felipe Balbi , Greg Kroah-Hartman , Minas Harutyunyan , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Cc: John Youn , Artur Petrosyan Message-Id: <20210413073716.30C13A0094@mailhost.synopsys.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If not hibernation nor partial power down are supported, clock gating is used to save power. Adds a new flow of entering clock gating when PC is suspended. Signed-off-by: Artur Petrosyan --- Changes in v2: - None drivers/usb/dwc2/hcd.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c index 31d6a1b87228..09dcd37b9ef8 100644 --- a/drivers/usb/dwc2/hcd.c +++ b/drivers/usb/dwc2/hcd.c @@ -4372,6 +4372,15 @@ static int _dwc2_hcd_suspend(struct usb_hcd *hcd) break; case DWC2_POWER_DOWN_PARAM_HIBERNATION: case DWC2_POWER_DOWN_PARAM_NONE: + /* + * If not hibernation nor partial power down are supported, + * clock gating is used to save power. + */ + dwc2_host_enter_clock_gating(hsotg); + + /* After entering suspend, hardware is not accessible */ + clear_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags); + break; default: goto skip_power_saving; } -- 2.25.1