Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18856332ybl; Fri, 3 Jan 2020 10:20:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzC7jVsZnS5foK35zBTFyOwN9XPvw7a68fnCMoAUM+Im28DFjl8+KccmxjQRQlYPQvNZvu+ X-Received: by 2002:aca:c493:: with SMTP id u141mr4586714oif.62.1578075622036; Fri, 03 Jan 2020 10:20:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578075622; cv=none; d=google.com; s=arc-20160816; b=mqMk/o5mrJM20CUN/fac6y/0DbIoeHYeuQG0Zg33ntfUAdT9Ilr3EksmGKESjtgIUH 0Fl/fWV/8PDnt7Vxzub/by8G9mDeaQEwMwP9VArBoCgsSyQn0huIyrY434H9oPsLIV/q aMBH+/Lucgn7v7sxBYt7/xFQvvVrKGHRLeOVgGIyXRNHhhwjQoI3OdPNwXZd3WSKDDyr 4zN8WcJywwCO0/tXEeUq2/gHVKrRyOkbpBlHaoTBFQjtGkq3Fng05I8xOqum7ykPnYM+ f7fnsVWmmZ/4m7lHFA38spM+MftLacAaIXPk9ozlmuT0OdKA597GL2avBWiAz0I1NYxP BJxQ== 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=iq8cQYWgGt7L7QkqK7Y9H3gHxm7JXMTYvhJENzTyt+01XYRn20XqL4rhquMgqxRgZ5 NT3Z+EUIq/p4asKYxSka2h6z/A1CWneOcHbqxA1hdHyvcHekWETM6AKwE72+3VeY5SUH Rxhg0zxP7Ug2rYvNIZlT6lPBLGHYDoKYtP1R5iJAx49NrL82q+UhjulMWe5pYBrcbWQJ ZT3RjddhPlau9Kwnle+or/FcjwXY8QxAzaqJPTdOL3QHls1LCNWWWH3yDHVloDN0O+KM t4OY9Dtw5Kk/jh1cb3iFmdsuaaL3O8Ooz4lFgWwhR7M4S+uttCs2P/MIMQ5GPpPBUtIa LFcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=IF3w5TDJ; 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 p7si31027725ota.299.2020.01.03.10.20.10; Fri, 03 Jan 2020 10:20:22 -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=IF3w5TDJ; 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 S1728350AbgACST1 (ORCPT + 99 others); Fri, 3 Jan 2020 13:19:27 -0500 Received: from mail-pj1-f65.google.com ([209.85.216.65]:35373 "EHLO mail-pj1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728335AbgACST0 (ORCPT ); Fri, 3 Jan 2020 13:19:26 -0500 Received: by mail-pj1-f65.google.com with SMTP id s7so5027681pjc.0; Fri, 03 Jan 2020 10:19:26 -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=IF3w5TDJT3EvdRJsjP6OD/+zJ+QmTMVrbgmWYoi7USPJrBxUNPuyL1a6OPWgI6Zz5o GMFh758d9cRk2hNIP7WWG1ov8XkjLkVMcbB2d+ZYHmBGDh19QM6O8oRbaVad/Gy66F/j P6SvV6Nwxu6UMeWrkumDZ8jIZGyxUmSx43wG39TvtRElJ5IGnu5RSgDivRznblPRqZVk s28ex+kfYRozfE1g9yhDq24aNCgz5yfuiFI9Du+QKZYiys5q08mFAl334dpGWap33cHV L/3yR8j0vD4tMYH7RHB+To4ekVJk0cAMph16tkWZ+36wg/vnPZitqrG+8YEJsGNmAHPX rOWg== 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=WLA204vFhkFZx4c4eWtxvUcwyIOWynw4UFQWcne2hL9SDWKSsQXYtJBxu+sdDwck0S C9hqWLwbhNjcXicFp5c0YDSqVIygwoRWQgAnfwB2kvBIaQ3hfgbFrnq8HNk/GJUPEL9F 57c+ASTvRJTNm53k5Blrgev++tHMoKhW42FtjnZBC+Rtf7WyHuQmwkLm14NhszbKUhpJ 444OZ7imrrIa92DabFMR5B5pSf1Vo+L4jUJSGWVsCLv9+yGPdYTXRtrgj/X6QNm7nmAZ AKJx1/Ezzno6xNb3fIJEjVVipMmoS+zgRnp1MBb2zDc3ZmxmHW0r7o3J2dTXWnrqA8Zr GXvw== X-Gm-Message-State: APjAAAWq9EFGmRtj8YUt8FA2e2WXp9TAgLDPVPD+1ETEO/oiYJCxytTn mwZ620lKauLh0/EP/uMTHrOYU2NGs3A= X-Received: by 2002:a17:902:b210:: with SMTP id t16mr42466097plr.65.1578075565871; Fri, 03 Jan 2020 10:19:25 -0800 (PST) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id j8sm41783602pfe.182.2020.01.03.10.19.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jan 2020 10:19:25 -0800 (PST) From: Al Cooper To: linux-kernel@vger.kernel.org Cc: Al Cooper , Kishon Vijay Abraham I , Rob Herring , Mark Rutland , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com (maintainer:BROADCOM BCM7XXX ARM ARCHITECTURE), Srinath Mannam , devicetree@vger.kernel.org (open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS), linux-arm-kernel@lists.infradead.org (moderated list:BROADCOM BCM7XXX ARM ARCHITECTURE) Subject: [PATCH v4 02/13] phy: usb: Get all drivers that use USB clks using correct enable/disable Date: Fri, 3 Jan 2020 13:18:00 -0500 Message-Id: <20200103181811.22939-3-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200103181811.22939-1-alcooperx@gmail.com> References: <20200103181811.22939-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