From patchwork Fri Jan 26 14:36:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Richard X-Patchwork-Id: 13532862 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id D3CBDC47DDF for ; Fri, 26 Jan 2024 15:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XFIfJb12BR1DYP0/A3Sm3rrC3ZNe1IDHwQme6ReS5po=; b=3lygYq1/HTJpJe glBI1z7wmLkhKx/6wOGs01JjRNnwDPUjcdgBd7G6NpJnPsuZFtISu6EP8jXXfgHTG5xwVnlfhQsBX dF/8kU8qJNauBL9EoTkWKALBySZTMtuFjq4zG/6XBd7r+pmzHm5iDEOFprd2kehdfJqN+Tm5owhij 9pBeuionwC8a8oSw8W5z0O1ED74xnqZmen5UiaWNBJcIHk2CbfibIMyDl/wSyaL5XRsWbDvIC1aHD TF4fXCJoodVzWQzCwQnNQkMbRolVjb5zsq8/gSDVgZI9Vkhy87e6iD+UER03DrZZRrG8EqssTW5O3 TVtephIbF0MNL4LQKIwQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTOSq-00000004aEX-06G6; Fri, 26 Jan 2024 15:49:56 +0000 Received: from relay2-d.mail.gandi.net ([2001:4b98:dc4:8::222]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rTNLD-00000004N7S-2Nwo; Fri, 26 Jan 2024 14:38:04 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id 53AE940010; Fri, 26 Jan 2024 14:37:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1706279877; 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=N4pB3p7l4Wmx1B5ikJiVEe+u1C2q0FduhxiC+T5adXA=; b=TeN/aDnJfTUIuoo9ivm9jVMsuO/VzY5HtvEAR7CtPNYbwre0S2xufDx1v4ZsqQWH/2dZeM fCIPcmyZFEJJ7ToNTW/PEKXq8Kbga6jQtXGrJjQ+JsmcXeNhJZQxP7+keT6Y7wGBAl6WuV HwgBbvlQ/ZKjDFPb24/n2VNyfXoZJnKjDZ5YueNMeiKKj3mLNiE/tP0tgdYaVrS/1+mxE/ 60asLrVla4YCkFaPdXr71TSE7713QC64S8tLbramUvYfxMCvxhCvFCcaFfPQbdCKcIyaIO g34ogRTUB7BTdUrSrrgtxy0PXFTAW4Lin9X6fI3X/ZCeD6k5QfILOeIZBKVjRA== From: Thomas Richard Date: Fri, 26 Jan 2024 15:36:51 +0100 Subject: [PATCH v2 09/15] phy: cadence-torrent: register resets even if the phy is already configured MIME-Version: 1.0 Message-Id: <20240102-j7200-pcie-s2r-v2-9-8e4f7d228ec2@bootlin.com> References: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@bootlin.com> In-Reply-To: <20240102-j7200-pcie-s2r-v2-0-8e4f7d228ec2@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 , Tom Joseph , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240126_063800_249394_8DA67837 X-CRM114-Status: GOOD ( 14.03 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 94298ad9f875..100b58965558 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; @@ -2780,6 +2780,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; @@ -2787,10 +2791,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;