]> www.infradead.org Git - users/willy/linux.git/commitdiff
phy: cadence-torrent: register resets even if the phy is already configured
authorThomas Richard <thomas.richard@bootlin.com>
Tue, 16 Apr 2024 12:52:34 +0000 (14:52 +0200)
committerVinod Koul <vkoul@kernel.org>
Mon, 3 Jun 2024 13:47:01 +0000 (19:17 +0530)
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 <thomas.richard@bootlin.com>
Link: https://lore.kernel.org/r/20240412-j7200-phy-s2r-v1-5-f15815833974@bootlin.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/cadence/phy-cadence-torrent.c

index bf1923919d7bda288b8efcf03dca585483bc7a9a..1b0394ca741b4cf948f0e7ffe40188acce8bca97 100644 (file)
@@ -2678,7 +2678,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;
 
@@ -2847,6 +2847,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;
@@ -2854,10 +2858,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;