[Feature][T108] [task-view-1618] config power_en gpio pull-up and sleep/wake-up function

Only Configure: No
Affected branch: GSW_V1453
Affected module: phy
Self-test: yes
Doc Update: no
:

Change-Id: Id6ec8539ffd19ee14e81c54d4e783a85a200e633
diff --git a/marvell/linux/drivers/net/ethernet/asr/emac_eth.c b/marvell/linux/drivers/net/ethernet/asr/emac_eth.c
index c90d0b1..b392f6e 100755
--- a/marvell/linux/drivers/net/ethernet/asr/emac_eth.c
+++ b/marvell/linux/drivers/net/ethernet/asr/emac_eth.c
@@ -4010,6 +4010,10 @@
 	struct device_node *mii_np;
 	struct device *dev = &priv->pdev->dev;
 	int ret;
+	//#LYNQ_MODFIY modify for task-1618 2025/6/19 start
+	struct device_node *phy_np;
+	int phy_power_en_gpio;
+	//#LYNQ_MODFIY modify for task-1618 2025/6/19 end
 
 	mii_np = of_get_child_by_name(dev->of_node, "mdio-bus");
 	if (!mii_np) {
@@ -4037,6 +4041,24 @@
 			mii_np);
 	priv->mii->parent = dev;
 	priv->mii->phy_mask = 0xffffffff;
+	
+	//#LYNQ_MODFIY modify for task-1618 2025/6/19 start
+	phy_np = of_parse_phandle(dev->of_node, "phy-handle", 0);
+	if (!phy_np) {
+		dev_err(dev, "Failed to find PHY node via phy-handle\n");
+		return -ENODEV;
+	}
+ 	phy_power_en_gpio = of_get_named_gpio(phy_np, "power-en-gpio", 0);
+	if (phy_power_en_gpio < 0) {
+		dev_err(dev, "Failed to get power_en gpio: %d\n", phy_power_en_gpio);
+		return phy_power_en_gpio;
+	}
+	gpio_request(phy_power_en_gpio, "phy_power_en");
+	gpio_direction_output(phy_power_en_gpio, 1);
+	msleep(30);
+	gpio_free(phy_power_en_gpio);
+	//#LYNQ_MODFIY modify for task-1618 2025/6/19 end
+
 	ret = of_mdiobus_register(priv->mii, mii_np);
 
 err_put_node: