From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CD653C2D0C4 for ; Tue, 10 Dec 2019 13:24:27 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A2AE32465A for ; Tue, 10 Dec 2019 13:24:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NlwBHEGA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T3WH5Xqf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A2AE32465A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=4EEHcZOcpUbt3lNsUtTN5ACloVZ0SbyM2aPU426IlM8=; b=NlwBHEGAlLQlvvGiTtNhxNKKAZ hmFcI1SYL3LXMZhW2XWC0lUd2ZIyiQlHdY6SZDii0+MzbLq2f0nELRt0ukAwmGCogfpHOlsb1yjb4 Z5e0l39KBKLAHZ6558gkgBv6rmzRqxEFduapo0/HhDLigWcUnjZOcsMvVIUPLXLzCH+OL1rfLaNaw gA/k9PCR7k7k/wF/agV+2GPx5OPVXQKvoYfW+P3snLGBahdNw1iBLVbMfRLe3Y1hE6e2m5GTONxFZ UtZpmh73y4ll9dRwBDZHrssvh5FhZXnSUelSdv45IfKV3IsfvglsRxbPT89Wsd88y3tfgWnJZY68g 1RsYDMlw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iefV0-0001zY-7M; Tue, 10 Dec 2019 13:24:22 +0000 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iefUF-0001KE-Nm for linux-arm-kernel@lists.infradead.org; Tue, 10 Dec 2019 13:23:37 +0000 Received: by mail-wm1-x343.google.com with SMTP id f129so3186082wmf.2 for ; Tue, 10 Dec 2019 05:23:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=H4+FLclhdhCw74jAzeAwHm0BVOBLEFDsMtURbkkNBZU=; b=T3WH5XqfLetiRgJBy6bGiL857tumh3t0aFWaqjQBigz1b4hiy5q6+MPfBTdlR2deaY 3vEUap4VQO8vWsJ8/pt3CaMMxqt2jo/i5LrozOqJ3Acd9OzRxCl5XcrSloYesxdWqUHb Y8rES7Z6Gc82Nj2abcYYHPeCMB9X7ogpZ/9h0p7dt4VdWenICy0mLuuRdYxCR+3END9Y jjFaPcUjznVi0d2RmnmLssCIQ6PuwaOV6lg0Pipkg+lGRK0+mJo4ddwIj+TkHaxMeUIz IWgrjmQIvjHVUYj2sQB2kbwlLLHRW8kscQlNVbbNjYHfq9goJ/8XIIkBDQpEpNCNitil Zn1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=H4+FLclhdhCw74jAzeAwHm0BVOBLEFDsMtURbkkNBZU=; b=SQydUliE6Tk+oGp7JoQTr6wOcmWx7rxAQa4PSCcCvIyl4bDCCTxYiBwKJq3jR6E6dc mkcXFlt7YG/2M4UFGKx63i/v5PgCx14m8aslgnOP4ejdg/KJoJc896F0bS0sfWFS8HZV thPewcwzyLee1qhmV220+6iJCBv3PISia60Z66LhfYZdNd8V4RAx75xUGcg+bsJeuKPJ fc2/0pEQZpolQx/rRG09YEg6Ug4bbsaZU2IjzV/OtKXCPdvQUkMQ50OosaZcs5SwKLYt VmYryxnSiAYC5OzijX4jy3FdnJ8CR3x/Q0jKJJIuJ5TRF+AgYGztDwstSaY0bmzxqYy/ rdag== X-Gm-Message-State: APjAAAUIxpotXIfpk/B81BHwimYHmiI/t6J5AX3/iqhixsJPSBLlD2i6 uWGpndbeCBRDN1nhw8aToxA= X-Google-Smtp-Source: APXvYqwRKREd+dTcyz/cmUO5OP+/NQ+62nTATaIIK9TjFJFfl/x1evrju2D3rlM1KG1gHPjAkpeR7w== X-Received: by 2002:a7b:c750:: with SMTP id w16mr5536056wmk.46.1575984213983; Tue, 10 Dec 2019 05:23:33 -0800 (PST) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id s82sm3101680wms.28.2019.12.10.05.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 05:23:33 -0800 (PST) From: Al Cooper To: linux-kernel@vger.kernel.org Subject: [PATCH v3 03/13] phy: usb: Put USB phys into IDDQ on suspend to save power in S2 mode Date: Tue, 10 Dec 2019 08:21:22 -0500 Message-Id: <20191210132132.41509-4-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191210132132.41509-1-alcooperx@gmail.com> References: <20191210132132.41509-1-alcooperx@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191210_052335_871682_967D002A X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, Florian Fainelli , Al Cooper , Kishon Vijay Abraham I , Rob Herring , bcm-kernel-feedback-list@broadcom.com, Srinath Mannam , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently the Phy driver will put the USB phys into the max power saving mode (IDDQ) when there is no corresponding XHCI, EHCI or OHCI client (through rmmod, unbind or if the driver is not builtin). This change will also put the Phys into IDDQ mode on suspend so that S2 will get the additional power savings. Signed-off-by: Al Cooper --- drivers/phy/broadcom/phy-brcm-usb-init.c | 2 -- drivers/phy/broadcom/phy-brcm-usb.c | 11 +++++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/phy/broadcom/phy-brcm-usb-init.c b/drivers/phy/broadcom/phy-brcm-usb-init.c index bd473d12ab28..ac7f7995c11f 100644 --- a/drivers/phy/broadcom/phy-brcm-usb-init.c +++ b/drivers/phy/broadcom/phy-brcm-usb-init.c @@ -1002,8 +1002,6 @@ void brcm_usb_uninit_common(struct brcm_usb_init_params *params) void brcm_usb_uninit_eohci(struct brcm_usb_init_params *params) { - if (USB_CTRL_MASK_FAMILY(params, USB_PM, USB20_HC_RESETB)) - USB_CTRL_UNSET_FAMILY(params, USB_PM, USB20_HC_RESETB); } void brcm_usb_uninit_xhci(struct brcm_usb_init_params *params) diff --git a/drivers/phy/broadcom/phy-brcm-usb.c b/drivers/phy/broadcom/phy-brcm-usb.c index 217e3702ef4e..634afc803778 100644 --- a/drivers/phy/broadcom/phy-brcm-usb.c +++ b/drivers/phy/broadcom/phy-brcm-usb.c @@ -381,8 +381,15 @@ static int brcm_usb_phy_suspend(struct device *dev) struct brcm_usb_phy_data *priv = dev_get_drvdata(dev); if (priv->init_count) { - clk_disable_unprepare(priv->usb_20_clk); - clk_disable_unprepare(priv->usb_30_clk); + if (priv->phys[BRCM_USB_PHY_3_0].inited) + brcm_usb_uninit_xhci(&priv->ini); + if (priv->phys[BRCM_USB_PHY_2_0].inited) + brcm_usb_uninit_eohci(&priv->ini); + brcm_usb_uninit_common(&priv->ini); + if (priv->phys[BRCM_USB_PHY_3_0].inited) + clk_disable_unprepare(priv->usb_30_clk); + if (priv->phys[BRCM_USB_PHY_2_0].inited) + clk_disable_unprepare(priv->usb_20_clk); } return 0; } -- 2.17.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel