Received: by 2002:ab2:3141:0:b0:1ed:23cc:44d1 with SMTP id i1csp1919497lqg; Mon, 4 Mar 2024 07:40:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWM5E6kbwBh3KTu48HuM3oFmb+1N/3vrttqVoREuqSekYcfKX6DV2pq6ENcZmA4DRqby+tXX1M8o/Kr6QH6BbBkMm/eMRZ+77C0Bi0OWg== X-Google-Smtp-Source: AGHT+IGI3ujGip6DAylbYBglCAw6HpTlo3Us1fOXMJAA+68sf7hqp5JF3+CI0/IrqhQge5wPb212 X-Received: by 2002:aa7:d714:0:b0:567:48b9:e9e6 with SMTP id t20-20020aa7d714000000b0056748b9e9e6mr2080080edq.42.1709566802435; Mon, 04 Mar 2024 07:40:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709566802; cv=pass; d=google.com; s=arc-20160816; b=mo5prjEQ7ZxipGWkiaKlOh/uphgmESWOiG4I5TnfULdROyNyOFPwQtgnvVn6KmscAc tYwJwLha7wVsQM0p18MhLW2R4rnwU7pvos07b6NYjuXCDNe6m9QSn+gYL9iBRGSimqRR RsMdzc5H9QzB9PeJdX6dE6k+s4Q4HLWPBBtnOgVR44GWPviUnaa7INnP5RKCjtl/egOP +6eiqLpjYQ49mOT4f2UEaH0GioaVyH4ebSRA2l9FlLCKTv/6SckD0rYsyddytUZzr0SW e3U+7iH8IHyqS9qj4SNvQuEkSe5XIg+lF1i72d6L0i+RjjC0XfrSKFdDwzDcel2cRKus Iomg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :subject:date:from:dkim-signature; bh=ZY4zwQDv37yWJBGtlc4HVZQiyWGnejxAqR+BxRsb2To=; fh=wHZQkXie84v2FP+2z7dUEuyvptHwnAyqgx34WxJkhrY=; b=cM3wMCBfpXman7Xb9XgKkXi6k+TVtFgoufMOCq24rEnTz146qNa2n0FtltRRJdLdr0 hXD/evClio2RLlF9pkJ0+bjqwtbTF7XjgYb9Ed0Q/eafdilrLg1S6LgPGEi6bZd39xBT cjRLYDNq9HV9l9qW683+zyrojtrLyvNFjQXc1lPofcYnqvUtOelcw1qinNL3wryMJ/C1 m/uSb/bJb+cyuZ/kpW4fNXsbhITiXRNDsuH5Wx8g9/ITtH3SmS/kLITdShGD8ng5+t/k 1yqO6uuy4tX4hNw19j+gRPXj1Gylq4n0D4l94d0zH/3J8W2BG902/2FB6dLI8OQDfsqH m+ew==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Q+he/qon"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-90849-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id n18-20020a509352000000b00564432aa4f9si3976098eda.411.2024.03.04.07.40.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Mar 2024 07:40:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-90849-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b="Q+he/qon"; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-90849-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-90849-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 782571F23BD3 for ; Mon, 4 Mar 2024 15:39:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5501A54FA8; Mon, 4 Mar 2024 15:36:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="Q+he/qon" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52DE1548E5; Mon, 4 Mar 2024 15:36:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709566591; cv=none; b=QfJ/J9F1gMUqS5hB5YxmP4Jir2MnzHTsDFIJIbWCetNNS4xKHQSwfM0JIDShkH1MKhZCwWYFvrHbsW/36U5uJNed6mL3jg52ndaT57KBM/BCJREj0xo3RGf2cW90Twu7EpmOqc3PmwMGxZ5VmJ1ggXDQrrZuEG3ZW8FOEh3xLos= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709566591; c=relaxed/simple; bh=58Rx/Fpi5lkN1ZhQHKIMYHT21sc+k4stqHUV7CqcV3I=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=XCbjKiPjEz95oTntah9431QcLtbZx1Gp7nm9iEmGOGh9kc0FegDwTJI08Vvff9gI+QckuN4uW2A5VJ+tOwZN1sRoiIAEFy5mwSQidMnWjSFIg6irClhcC9MOAC9iGEnDV71mzUls2x3yd6grJ8KzdXjBGiwu1iUnDjghg9ulJVY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=Q+he/qon; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 203261BF20E; Mon, 4 Mar 2024 15:36:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1709566587; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZY4zwQDv37yWJBGtlc4HVZQiyWGnejxAqR+BxRsb2To=; b=Q+he/qonM7ce+3DcO7pg2cLmmB2q17k26lCCSFkwtjGa5ylJuU59mevM2Qvtcb8PVuFEHy Q1sTqNqifckyCGoQuPW1izOlHIMCR4bbcsOOv/NcRFU3eM7iS8eMFBNC14VMGrfxr4R9n/ ZvchPop/U9fSn4YT3Gr6Ebjj22hiRGuGiuq90/oQ8NZXHdM1Ul17kDCjfyR6UWJtqBLmrs rtZp6uR83vPpeH5ZqPf+eDnjPPMPt2EDVQd7ZhVlProjbqimFEnUX64LZ8Q/KKk6YmALdy 6AARmY9OozTj8oklubGUHFRfiibRXsDrBr9hUDQaQ+CZtHolyXzZ3q0TMMJTmg== From: Thomas Richard Date: Mon, 04 Mar 2024 16:35:53 +0100 Subject: [PATCH v4 10/18] phy: cadence-torrent: register resets even if the phy is already configured Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240102-j7200-pcie-s2r-v4-10-6f1f53390c85@bootlin.com> References: <20240102-j7200-pcie-s2r-v4-0-6f1f53390c85@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v4-0-6f1f53390c85@bootlin.com> To: Linus Walleij , Bartosz Golaszewski , Andy Shevchenko , Tony Lindgren , Haojian Zhuang , Vignesh R , Aaro Koskinen , Janusz Krzysztofik , Andi Shyti , Peter Rosin , Vinod Koul , Kishon Vijay Abraham I , Philipp Zabel , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org, linux-i2c@vger.kernel.org, linux-phy@lists.infradead.org, linux-pci@vger.kernel.org, gregory.clement@bootlin.com, theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com, u-kumar1@ti.com, Thomas Richard X-Mailer: b4 0.12.0 X-GND-Sasl: thomas.richard@bootlin.com Resets are needed during suspend and resume stages. So they shall be registered during the probe even the phy is already initialized. The function cdns_torrent_reset is renamed cdns_torrent_of_get_reset() to make it clear. Signed-off-by: Thomas Richard --- drivers/phy/cadence/phy-cadence-torrent.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c index 803a76acf2fd..bba10ca0bfdd 100644 --- a/drivers/phy/cadence/phy-cadence-torrent.c +++ b/drivers/phy/cadence/phy-cadence-torrent.c @@ -2660,7 +2660,7 @@ static int cdns_torrent_clk_register(struct cdns_torrent_phy *cdns_phy) return 0; } -static int cdns_torrent_reset(struct cdns_torrent_phy *cdns_phy) +static int cdns_torrent_of_get_reset(struct cdns_torrent_phy *cdns_phy) { struct device *dev = cdns_phy->dev; @@ -2779,6 +2779,10 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) if (ret) return ret; + ret = cdns_torrent_of_get_reset(cdns_phy); + if (ret) + goto clk_cleanup; + ret = cdns_torrent_of_get_clk(cdns_phy); if (ret) goto clk_cleanup; @@ -2786,10 +2790,6 @@ static int cdns_torrent_phy_probe(struct platform_device *pdev) regmap_field_read(cdns_phy->phy_pma_cmn_ctrl_1, &already_configured); if (!already_configured) { - ret = cdns_torrent_reset(cdns_phy); - if (ret) - goto clk_cleanup; - ret = cdns_torrent_clk(cdns_phy); if (ret) goto clk_cleanup; -- 2.39.2