aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorFrank Wunderlich <frank-w@public-files.de>2025-05-10 19:49:32 +0200
committerJakub Kicinski <kuba@kernel.org>2025-05-16 15:40:51 -0700
commit15d7b3dfafa98270eade6c77d2336790dde0a40d (patch)
treef65dc2800e9abe2fc47cfd0016acc624862b8045
parentnet: stmmac: convert to ndo_hwtstamp_get() and ndo_hwtstamp_set() (diff)
downloadwireguard-linux-15d7b3dfafa98270eade6c77d2336790dde0a40d.tar.xz
wireguard-linux-15d7b3dfafa98270eade6c77d2336790dde0a40d.zip
net: phy: mediatek: do not require syscon compatible for pio property
Current implementation requires syscon compatible for pio property which is used for driving the switch leds on mt7988. Replace syscon_regmap_lookup_by_phandle with of_parse_phandle and device_node_to_regmap to get the regmap already assigned by pinctrl driver. Signed-off-by: Frank Wunderlich <frank-w@public-files.de> Link: https://patch.msgid.link/20250510174933.154589-1-linux@fw-web.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
-rw-r--r--drivers/net/phy/mediatek/mtk-ge-soc.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/net/phy/mediatek/mtk-ge-soc.c b/drivers/net/phy/mediatek/mtk-ge-soc.c
index cd09684780a4..a284e8435cb6 100644
--- a/drivers/net/phy/mediatek/mtk-ge-soc.c
+++ b/drivers/net/phy/mediatek/mtk-ge-soc.c
@@ -7,6 +7,7 @@
#include <linux/pinctrl/consumer.h>
#include <linux/phy.h>
#include <linux/regmap.h>
+#include <linux/of.h>
#include "../phylib.h"
#include "mtk.h"
@@ -1322,6 +1323,7 @@ static int mt7988_phy_probe_shared(struct phy_device *phydev)
{
struct device_node *np = dev_of_node(&phydev->mdio.bus->dev);
struct mtk_socphy_shared *shared = phy_package_get_priv(phydev);
+ struct device_node *pio_np;
struct regmap *regmap;
u32 reg;
int ret;
@@ -1339,7 +1341,13 @@ static int mt7988_phy_probe_shared(struct phy_device *phydev)
* The 4 bits in TPBANK0 are kept as package shared data and are used to
* set LED polarity for each of the LED0.
*/
- regmap = syscon_regmap_lookup_by_phandle(np, "mediatek,pio");
+ pio_np = of_parse_phandle(np, "mediatek,pio", 0);
+ if (!pio_np)
+ return -ENODEV;
+
+ regmap = device_node_to_regmap(pio_np);
+ of_node_put(pio_np);
+
if (IS_ERR(regmap))
return PTR_ERR(regmap);