Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp5394817ybl; Tue, 10 Dec 2019 05:26:26 -0800 (PST) X-Google-Smtp-Source: APXvYqw8qRTmcXYRMdBqEdufzoypEUmMKbBI7N8gPdqn1+fGDDtFGzuk+CpmLgnTa4E9oRJgV9gt X-Received: by 2002:a05:6830:1b6a:: with SMTP id d10mr26272011ote.52.1575984385978; Tue, 10 Dec 2019 05:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575984385; cv=none; d=google.com; s=arc-20160816; b=UFqAmFl9XH2jDQgHEAQJ84kjv8l53sWPq95hzu7sFR2gtBkUfgSlRD2+kuq245Jn1Z JZtjxl71SpPkT2LWW0TqDledOSWn+pp3FDmFEwMHDH+jYwpWSseD+sWdvrxm6sqtJzmR 344TxDDOoxC90VGT1p4K2jLgpKOO+P26mRX0mb/z+WbmPpwN4eGVcU0ZIDlhbg5+88ij D6MxfEMKnzQ1kWJ9EUeHUtHZ5RNJWadBQ1d/Ps8d5F79g44zETQmEE0Ib31e0l9jlzTZ 5JDgCstU7FMqJb2WWNw9iUvR21dL7E6wJSkRch0g19w5shLcPwTSzAIbdZCgbcenFXbv QsOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=jJrtiyNSy3kb+yNwZbjKaE7PnY4m0t7haj0Vxh+WdWs=; b=JuTvKrpVNM+3WqULpXcKGTplmLKDP2M8Ic4KS/FRRxRdGhmFD6qlk43gxrrXIVfbiE tpOsIvzmsEszpTVKN/En/3lUM4K9z8GlFhexjIx5gJ6eLdf2aqeCVVrjkeJ/bi97kqJR UhLsQLOEJpBOC3v2EUUjn/kw0mVdyf/jWxmhSbKwijkshozRmslq7rWhGvvzCMJHe1gN mOVLjjwYUZ8TxIrvMJHWzVXguqlBlBPo99uaqbU56NneD/SluedaUEflj1WOM8PQ0Oht oPApozIJy83BVu4HlpzoLzS3VZjzyexr2ET7RVP44FJuH4zBDJMDRgSBjvaAKFX2w8hm /dhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J99n2bWz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i26si1871590otp.46.2019.12.10.05.26.13; Tue, 10 Dec 2019 05:26:25 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=J99n2bWz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbfLJNXf (ORCPT + 99 others); Tue, 10 Dec 2019 08:23:35 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:46312 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727007AbfLJNXe (ORCPT ); Tue, 10 Dec 2019 08:23:34 -0500 Received: by mail-wr1-f68.google.com with SMTP id z7so19982090wrl.13; Tue, 10 Dec 2019 05:23:32 -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=jJrtiyNSy3kb+yNwZbjKaE7PnY4m0t7haj0Vxh+WdWs=; b=J99n2bWznpxOP6+vsSZXrEr6p/rw1T5xKdv3U2W6e9//RNmPZtPXfD62u24G8E+C/7 XtwiqCDRNhXLmsDBiHVkU4zNSkopGxxHRzkWHwqzVKWhux6HNd5FHIAgUjenIZeY0JEI TEVAlO4ktkiqYCmQDqZWXC0pDNAxCtdluBOXIMlXO8nr/QZXaYHKZgUCAF5qKF6kxAdD W+ocHC6CEtPkTlYlFIIkMX9ehfWN4VmWo8PKArMUcj9fYSlTTU7E7BgbBk0wmP885JT4 00t12Pn0vbf8l+ToQpMqZAE9ZZt9OdQw6PnhCP0gcwxlHchMrexSZ/445YuFgG/f1qQP CP3A== 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=jJrtiyNSy3kb+yNwZbjKaE7PnY4m0t7haj0Vxh+WdWs=; b=auTeupwX/67CQ0tGq7yTjQ2wCOcmtSA/3DpcKjrvXPq0QIsPg6v+zUw/bz264XVEp8 eIBTc4tfPs+gMV3GU9dGWbv86cTIaFFqiN1LKvwM0COhag3K7PaTPd5igp2jMaEL81Pd TpJ6x+gxJK2tYiO37AwREWP3RxGN8rysst4QoFAiHrCPTIBsJc6sF/lE0Ep3p9kqwLUo tFgA0uN159DuT2O6il6M9g1JvA3U3TOnqvAzSyP8xboVh7xqqnCvIr8sbH7TfSs0vl0b Z+8w6saP5zqYIzcvtBB9vHQzdK42/myAS+W9XHrDNPYAVrtdTqZLiD2tUTSeQITtfcpD psvw== X-Gm-Message-State: APjAAAUBawExN1dnjvWrLNaTZWuXYt8U9O2WSSz5kSRnNUHP4m2c8cec kWcGiC5IHq9SSE6SY1lsyG9+7sa9RRc= X-Received: by 2002:a5d:558d:: with SMTP id i13mr190439wrv.364.1575984211923; Tue, 10 Dec 2019 05:23:31 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 05:23:31 -0800 (PST) From: Al Cooper To: linux-kernel@vger.kernel.org Cc: Al Cooper , bcm-kernel-feedback-list@broadcom.com, devicetree@vger.kernel.org, Florian Fainelli , Kishon Vijay Abraham I , linux-arm-kernel@lists.infradead.org, Mark Rutland , Rob Herring , Srinath Mannam Subject: [PATCH v3 02/13] phy: usb: Get all drivers that use USB clks using correct enable/disable Date: Tue, 10 Dec 2019 08:21:21 -0500 Message-Id: <20191210132132.41509-3-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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The BRCM USB Phy, ohci, ehci and xhci drivers all use the USB clocks but not all drivers use the clk_prepare_enable/clk_disable_unprepare versions to enable/disable the clocks. This change gets all drivers using the prepare version. Signed-off-by: Al Cooper --- drivers/phy/broadcom/phy-brcm-usb.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/drivers/phy/broadcom/phy-brcm-usb.c b/drivers/phy/broadcom/phy-brcm-usb.c index f5c1f2983a1d..217e3702ef4e 100644 --- a/drivers/phy/broadcom/phy-brcm-usb.c +++ b/drivers/phy/broadcom/phy-brcm-usb.c @@ -74,8 +74,8 @@ static int brcm_usb_phy_init(struct phy *gphy) */ mutex_lock(&priv->mutex); if (priv->init_count++ == 0) { - clk_enable(priv->usb_20_clk); - clk_enable(priv->usb_30_clk); + clk_prepare_enable(priv->usb_20_clk); + clk_prepare_enable(priv->usb_30_clk); brcm_usb_init_common(&priv->ini); } mutex_unlock(&priv->mutex); @@ -106,8 +106,8 @@ static int brcm_usb_phy_exit(struct phy *gphy) mutex_lock(&priv->mutex); if (--priv->init_count == 0) { brcm_usb_uninit_common(&priv->ini); - clk_disable(priv->usb_20_clk); - clk_disable(priv->usb_30_clk); + clk_disable_unprepare(priv->usb_20_clk); + clk_disable_unprepare(priv->usb_30_clk); } mutex_unlock(&priv->mutex); phy->inited = false; @@ -360,8 +360,8 @@ static int brcm_usb_phy_probe(struct platform_device *pdev) if (priv->has_eohci) brcm_usb_uninit_eohci(&priv->ini); brcm_usb_uninit_common(&priv->ini); - clk_disable(priv->usb_20_clk); - clk_disable(priv->usb_30_clk); + clk_disable_unprepare(priv->usb_20_clk); + clk_disable_unprepare(priv->usb_30_clk); phy_provider = devm_of_phy_provider_register(dev, brcm_usb_phy_xlate); @@ -381,8 +381,8 @@ 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(priv->usb_20_clk); - clk_disable(priv->usb_30_clk); + clk_disable_unprepare(priv->usb_20_clk); + clk_disable_unprepare(priv->usb_30_clk); } return 0; } @@ -391,8 +391,8 @@ static int brcm_usb_phy_resume(struct device *dev) { struct brcm_usb_phy_data *priv = dev_get_drvdata(dev); - clk_enable(priv->usb_20_clk); - clk_enable(priv->usb_30_clk); + clk_prepare_enable(priv->usb_20_clk); + clk_prepare_enable(priv->usb_30_clk); brcm_usb_init_ipp(&priv->ini); /* @@ -405,13 +405,13 @@ static int brcm_usb_phy_resume(struct device *dev) brcm_usb_init_eohci(&priv->ini); } else if (priv->has_eohci) { brcm_usb_uninit_eohci(&priv->ini); - clk_disable(priv->usb_20_clk); + clk_disable_unprepare(priv->usb_20_clk); } if (priv->phys[BRCM_USB_PHY_3_0].inited) { brcm_usb_init_xhci(&priv->ini); } else if (priv->has_xhci) { brcm_usb_uninit_xhci(&priv->ini); - clk_disable(priv->usb_30_clk); + clk_disable_unprepare(priv->usb_30_clk); } } else { if (priv->has_xhci) @@ -419,8 +419,8 @@ static int brcm_usb_phy_resume(struct device *dev) if (priv->has_eohci) brcm_usb_uninit_eohci(&priv->ini); brcm_usb_uninit_common(&priv->ini); - clk_disable(priv->usb_20_clk); - clk_disable(priv->usb_30_clk); + clk_disable_unprepare(priv->usb_20_clk); + clk_disable_unprepare(priv->usb_30_clk); } return 0; -- 2.17.1