From 6e9ec5ade644eeb136c6b827d72fac80bf2c3817 Mon Sep 17 00:00:00 2001
From: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
Date: Fri, 9 May 2025 13:22:14 +0800
Subject: [PATCH] net: pcs: mtk_lynxi add mt7987 support

Signed-off-by: Bo-Cun Chen <bc-bocun.chen@mediatek.com>
---
 drivers/net/pcs/pcs-mtk-lynxi.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

--- a/drivers/net/pcs/pcs-mtk-lynxi.c
+++ b/drivers/net/pcs/pcs-mtk-lynxi.c
@@ -413,9 +413,12 @@ static int mtk_pcs_lynxi_probe(struct pl
 	if (of_property_read_bool(np->parent, "mediatek,pnswap"))
 		flags |= MTK_SGMII_FLAG_PN_SWAP;
 
-	mpcs->rstc = of_reset_control_get_shared(np->parent, NULL);
-	if (IS_ERR(mpcs->rstc))
-		return PTR_ERR(mpcs->rstc);
+	if (of_parse_phandle(np->parent, "resets", 0)) {
+		mpcs->rstc = of_reset_control_get_shared(np->parent, NULL);
+		if (IS_ERR(mpcs->rstc))
+			return PTR_ERR(mpcs->rstc);
+	} else
+		mpcs->rstc = NULL;
 
 	reset_control_deassert(mpcs->rstc);
 	mpcs->sgmii_sel = devm_clk_get_enabled(dev, "sgmii_sel");
@@ -462,6 +465,7 @@ static void mtk_pcs_lynxi_remove(struct
 }
 
 static const struct of_device_id mtk_pcs_lynxi_of_match[] = {
+	{ .compatible = "mediatek,mt7987-sgmii", .data = (void *)MTK_NETSYS_V3_AMA_RGC3 },
 	{ .compatible = "mediatek,mt7988-sgmii", .data = (void *)MTK_NETSYS_V3_AMA_RGC3 },
 	{ /* sentinel */ },
 };
