107107/* ch_addr = 0x0, node_addr = 0xf, data_addr = 0x3c */
108108#define AUTO_NP_10XEN BIT(6)
109109
110+ struct mtk_i2p5ge_phy_priv {
111+ bool fw_loaded ;
112+ };
113+
110114enum {
111115 PHY_AUX_SPD_10 = 0 ,
112116 PHY_AUX_SPD_100 ,
@@ -562,9 +566,18 @@ static int mt798x_2p5ge_phy_get_rate_matching(struct phy_device *phydev,
562566
563567static int mt798x_2p5ge_phy_probe (struct phy_device * phydev )
564568{
569+ struct mtk_i2p5ge_phy_priv * priv ;
565570 struct pinctrl * pinctrl ;
566571 int ret ;
567572
573+ priv = devm_kzalloc (& phydev -> mdio .dev ,
574+ sizeof (struct mtk_i2p5ge_phy_priv ), GFP_KERNEL );
575+ if (!priv )
576+ return - ENOMEM ;
577+
578+ priv -> fw_loaded = false;
579+ phydev -> priv = priv ;
580+
568581 switch (phydev -> drv -> phy_id ) {
569582 case MTK_2P5GPHY_ID_MT7987 :
570583 case MTK_2P5GPHY_ID_MT7988 :
@@ -614,11 +627,18 @@ static int mt798x_2p5ge_phy_probe(struct phy_device *phydev)
614627 return 0 ;
615628}
616629
630+ static void mt798x_2p5ge_phy_remove (struct phy_device * phydev )
631+ {
632+ struct mtk_i2p5ge_phy_priv * priv = phydev -> priv ;
633+ kfree (priv );
634+ }
635+
617636static struct phy_driver mtk_2p5gephy_driver [] = {
618637 {
619638 PHY_ID_MATCH_MODEL (MTK_2P5GPHY_ID_MT7987 ),
620639 .name = "MediaTek MT7987 2.5GbE PHY" ,
621640 .probe = mt798x_2p5ge_phy_probe ,
641+ .remove = mt798x_2p5ge_phy_remove ,
622642 .config_init = mt798x_2p5ge_phy_config_init ,
623643 .config_aneg = mt798x_2p5ge_phy_config_aneg ,
624644 .get_features = mt798x_2p5ge_phy_get_features ,
@@ -633,6 +653,7 @@ static struct phy_driver mtk_2p5gephy_driver[] = {
633653 PHY_ID_MATCH_MODEL (MTK_2P5GPHY_ID_MT7988 ),
634654 .name = "MediaTek MT7988 2.5GbE PHY" ,
635655 .probe = mt798x_2p5ge_phy_probe ,
656+ .remove = mt798x_2p5ge_phy_remove ,
636657 .config_init = mt798x_2p5ge_phy_config_init ,
637658 .config_aneg = mt798x_2p5ge_phy_config_aneg ,
638659 .get_features = mt798x_2p5ge_phy_get_features ,
0 commit comments