Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nanopi R5S: proper pci phy reset - fixing missing LAN1 #7721

Merged
merged 1 commit into from
Jan 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 1/1] phy: rockchip: naneng-combphy: compatible reset with old DT
From: Chukun Pan <[email protected]>
Date: Mon, 06 Jan 2025 18:00:01 +0800
Message-Id: <[email protected]>
To: Vinod Koul <[email protected]>
Cc: Heiko Stuebner <[email protected]>, Philipp Zabel <[email protected]>, Kishon Vijay Abraham I <[email protected]>, Jianfeng Liu <[email protected]>, [email protected], [email protected], [email protected], [email protected], Chukun Pan <[email protected]>
In-Reply-To: <[email protected]>
References: <[email protected]>
List-Id: <linux-kernel.vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

The device tree of RK3568 did not specify reset-names before.
So add fallback to old behaviour to be compatible with old DT.

Fixes: fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset")
Cc: Jianfeng Liu <[email protected]>
Signed-off-by: Chukun Pan <[email protected]>
Reviewed-by: Jonas Karlman <[email protected]>
---
drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
index a1532ef8bbe9..8c3ce57f8915 100644
--- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
@@ -324,7 +324,10 @@ static int rockchip_combphy_parse_dt(struct device *dev, struct rockchip_combphy

priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk");

- priv->phy_rst = devm_reset_control_get(dev, "phy");
+ priv->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
+ /* fallback to old behaviour */
+ if (PTR_ERR(priv->phy_rst) == -ENOENT)
+ priv->phy_rst = devm_reset_control_array_get_exclusive(dev);
if (IS_ERR(priv->phy_rst))
return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n");


--
2.25.1


Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
From git@z Thu Jan 1 00:00:00 1970
Subject: [PATCH v2 1/1] phy: rockchip: naneng-combphy: compatible reset with old DT
From: Chukun Pan <[email protected]>
Date: Mon, 06 Jan 2025 18:00:01 +0800
Message-Id: <[email protected]>
To: Vinod Koul <[email protected]>
Cc: Heiko Stuebner <[email protected]>, Philipp Zabel <[email protected]>, Kishon Vijay Abraham I <[email protected]>, Jianfeng Liu <[email protected]>, [email protected], [email protected], [email protected], [email protected], Chukun Pan <[email protected]>
In-Reply-To: <[email protected]>
References: <[email protected]>
List-Id: <linux-kernel.vger.kernel.org>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit

The device tree of RK3568 did not specify reset-names before.
So add fallback to old behaviour to be compatible with old DT.

Fixes: fbcbffbac994 ("phy: rockchip: naneng-combphy: fix phy reset")
Cc: Jianfeng Liu <[email protected]>
Signed-off-by: Chukun Pan <[email protected]>
Reviewed-by: Jonas Karlman <[email protected]>
---
drivers/phy/rockchip/phy-rockchip-naneng-combphy.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
index a1532ef8bbe9..8c3ce57f8915 100644
--- a/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
+++ b/drivers/phy/rockchip/phy-rockchip-naneng-combphy.c
@@ -324,7 +324,10 @@ static int rockchip_combphy_parse_dt(struct device *dev, struct rockchip_combphy

priv->ext_refclk = device_property_present(dev, "rockchip,ext-refclk");

- priv->phy_rst = devm_reset_control_get(dev, "phy");
+ priv->phy_rst = devm_reset_control_get_exclusive(dev, "phy");
+ /* fallback to old behaviour */
+ if (PTR_ERR(priv->phy_rst) == -ENOENT)
+ priv->phy_rst = devm_reset_control_array_get_exclusive(dev);
if (IS_ERR(priv->phy_rst))
return dev_err_probe(dev, PTR_ERR(priv->phy_rst), "failed to get phy reset\n");


--
2.25.1