Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4603215ybl; Mon, 9 Dec 2019 13:45:55 -0800 (PST) X-Google-Smtp-Source: APXvYqwevHIBIYrGVbu1tidykOVi0UK1i8R4juvFPLjIR/BqenN4CrBjE3aNk7qRgh+Nsew2JLLC X-Received: by 2002:a9d:6d10:: with SMTP id o16mr24235884otp.28.1575927955719; Mon, 09 Dec 2019 13:45:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575927955; cv=none; d=google.com; s=arc-20160816; b=mSshFRg2UYfsS13CVO6qLDiWOzl/78eug8aUDWzVv/0clw3xuYF4ivEuYzRGuK8d/a fJHTgxImcF4KrsWCQ3ltcv3pUeUyLHhhOfAKqHDDjFaitof3iqQ7u06uYF+7OTqjfdyr +0MW7kv4TbR6cvxLA3gCVPeY2klZ1a0+pfwjMXbXHM49zyto1k/jfuxlggIjhUeUvC5i W8ZBY+J+GVM21aDJX42lut1zPiTCBHWHpHI0frZlGppQ8ccqWG+93y7sXw8jOufKXepD J7EoIoAPh/KM7fU24Vw6xJ400znVxcJ0WqKRxyTXpNEW6QlejJTxWhP/MrDiR4lWTIBj u/Kw== 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=vdTkV6xcVgPMpj1VFak74ETZWmW21qzyptxqFewf4TZkpPhY5jtSnUxEOrA4lRfE7s 5DKXaVNjMuxEn59RtURPBM5agjnLVgh1ibxnUpPrlbm5W6DNuWQzzStK4ft855zeXqZw rxmjZUzbG6DBhKPKpnVo5WvW5BtgMNkG/c17fGoWbT58LAiCayQZ+eWqjhl0dTqzJSWH lY4S70KzVjf+ZDls0AGzS5qYp9Z2CLxArp8OEYSHNF9+AIuGZowTE9nkisuvZbAvQk7t dwgLupVDGZ5jISi3snr/7VF9L3qOBj5vww+lQnzhhV9SeK07scjE4XXEXOQlUGB+0h/F Reaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=jbAb1fA8; 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 d187si770419oif.33.2019.12.09.13.45.43; Mon, 09 Dec 2019 13:45:55 -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=jbAb1fA8; 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 S1726874AbfLIVoA (ORCPT + 99 others); Mon, 9 Dec 2019 16:44:00 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:40767 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726532AbfLIVn7 (ORCPT ); Mon, 9 Dec 2019 16:43:59 -0500 Received: by mail-wm1-f65.google.com with SMTP id t14so903603wmi.5; Mon, 09 Dec 2019 13:43:58 -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=jbAb1fA8KX8Y8PwYKNYDdE0HH6hmUW/fWzkkhmiwZaCG9+MEnzb9FDseK/3fmxoK70 Qa5s2SV65r34IsnegiZNnEMhoQ1PQeKuoDC8Gd/13xt8oZPM40lvzXpIkYKEiiuXH6bM 965VTDP1D8selcFEdBVOUJbGomqls3VkoZkCukYgx8GfIHGfJFgK8vMEW8yMCgNjjAyq TYvdqM6bMoGpo7bMT0rgki9Kk4QnPihmFdhcQaxqcKikGHEZUpVI4YIIA5+5RLmcZ7j3 zJWtmo1YkB9hWWF/JLa6nrnVNcbFGE6JbkEflVtavDNMgCkFiNx9/NPSGe/2FDmduLHR STxA== 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=jerRqDb0BhB7n6UXH8GS8KnD59aI7hMi2OX7VEt45BpIELQZcis0bfYtjQEYXyt0w3 3bqxL+5uquK+EaPce7wPaBYv6auZxD2WdwMPP6W7atOe1nzr/cSZACQTYN5H8A/nLWsP mwifUWNhGitLjIYDVVwlsVNn6yzbButFFdOxcjdL1jOg2X3/3WsGKMg2EZLb4EXd9Z9B tPrVqXN4w6KWYJq/LuexFi/TKeescWIi0XRTbcWwYvRnIy+tT12mi5++Qx08Ddas0xCP gCc47sO7gQsVzb6rNxRUf5WWv9mUcigHNcbtOwUvjogyFUP5CczdNaOsKpIXUnQsdMzf VCfA== X-Gm-Message-State: APjAAAVwZOKNWzf7z7dgvhVOGpfRJ6FsRkwcHHsiN8303sGCtoW7gZR+ 7yGYwdDRDfAgiieD9RmVstnmvFzLssU= X-Received: by 2002:a7b:cc81:: with SMTP id p1mr1238187wma.62.1575927837172; Mon, 09 Dec 2019 13:43:57 -0800 (PST) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id z6sm757714wmz.12.2019.12.09.13.43.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Dec 2019 13:43:56 -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 v2 resend 02/13] phy: usb: Get all drivers that use USB clks using correct enable/disable Date: Mon, 9 Dec 2019 16:42:38 -0500 Message-Id: <20191209214249.41137-3-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20191209214249.41137-1-alcooperx@gmail.com> References: <20191209214249.41137-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