kernel: 5.15: update Aquantia PHY driver to v6.1 code
[openwrt/staging/dangole.git] / target / linux / generic / hack-5.15 / 720-net-phy-add-aqr-phys.patch
index 29050d38ea22b065b719b7e94c0bd9f53277f87f..d8ec95b37478abe08f98e7a4b8e5f456d8ae9125 100644 (file)
@@ -9,18 +9,15 @@ Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
 
 --- a/drivers/net/phy/aquantia_main.c
 +++ b/drivers/net/phy/aquantia_main.c
-@@ -20,8 +20,10 @@
- #define PHY_ID_AQR105 0x03a1b4a2
- #define PHY_ID_AQR106 0x03a1b4d0
- #define PHY_ID_AQR107 0x03a1b4e0
-+#define PHY_ID_AQR113C        0x31c31c12
+@@ -23,6 +23,7 @@
  #define PHY_ID_AQCS109        0x03a1b5c2
  #define PHY_ID_AQR405 0x03a1b4b0
+ #define PHY_ID_AQR113C        0x31c31c12
 +#define PHY_ID_AQR813 0x31c31cb2
  
  #define MDIO_PHYXS_VEND_IF_STATUS             0xe812
  #define MDIO_PHYXS_VEND_IF_STATUS_TYPE_MASK   GENMASK(7, 3)
-@@ -381,6 +383,49 @@ static int aqr107_read_rate(struct phy_d
+@@ -415,6 +416,49 @@ static int aqr107_read_rate(struct phy_d
        return 0;
  }
  
@@ -70,7 +67,7 @@ Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
  static int aqr107_read_status(struct phy_device *phydev)
  {
        int val, ret;
-@@ -511,7 +556,7 @@ static void aqr107_chip_info(struct phy_
+@@ -554,7 +598,7 @@ static void aqr107_chip_info(struct phy_
        build_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_FW_BUILD_ID, val);
        prov_id = FIELD_GET(VEND1_GLOBAL_RSVD_STAT1_PROV_ID, val);
  
@@ -79,35 +76,19 @@ Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
                   fw_major, fw_minor, build_id, prov_id);
  }
  
-@@ -719,6 +764,24 @@ static struct phy_driver aqr_driver[] =
+@@ -811,7 +855,7 @@ static struct phy_driver aqr_driver[] =
+       .config_aneg    = aqr_config_aneg,
+       .config_intr    = aqr_config_intr,
+       .handle_interrupt       = aqr_handle_interrupt,
+-      .read_status    = aqr107_read_status,
++      .read_status    = aqr113c_read_status,
+       .get_tunable    = aqr107_get_tunable,
+       .set_tunable    = aqr107_set_tunable,
+       .suspend        = aqr107_suspend,
+@@ -821,6 +865,24 @@ static struct phy_driver aqr_driver[] =
+       .get_stats      = aqr107_get_stats,
        .link_change_notify = aqr107_link_change_notify,
  },
- {
-+      PHY_ID_MATCH_MODEL(PHY_ID_AQR113C),
-+      .name           = "Aquantia AQR113C",
-+      .probe          = aqr107_probe,
-+      .config_init    = aqr107_config_init,
-+      .config_aneg    = aqr_config_aneg,
-+      .config_intr    = aqr_config_intr,
-+      .handle_interrupt = aqr_handle_interrupt,
-+      .read_status    = aqr113c_read_status,
-+      .get_tunable    = aqr107_get_tunable,
-+      .set_tunable    = aqr107_set_tunable,
-+      .suspend        = aqr107_suspend,
-+      .resume         = aqr107_resume,
-+      .get_sset_count = aqr107_get_sset_count,
-+      .get_strings    = aqr107_get_strings,
-+      .get_stats      = aqr107_get_stats,
-+      .link_change_notify = aqr107_link_change_notify,
-+},
-+{
-       PHY_ID_MATCH_MODEL(PHY_ID_AQCS109),
-       .name           = "Aquantia AQCS109",
-       .probe          = aqr107_probe,
-@@ -744,6 +807,24 @@ static struct phy_driver aqr_driver[] =
-       .handle_interrupt = aqr_handle_interrupt,
-       .read_status    = aqr_read_status,
- },
 +{
 +      PHY_ID_MATCH_MODEL(PHY_ID_AQR813),
 +      .name           = "Aquantia AQR813",
@@ -129,13 +110,10 @@ Signed-off-by: Birger Koblitz <git@birger-koblitz.de>
  };
  
  module_phy_driver(aqr_driver);
-@@ -754,8 +835,10 @@ static struct mdio_device_id __maybe_unu
-       { PHY_ID_MATCH_MODEL(PHY_ID_AQR105) },
-       { PHY_ID_MATCH_MODEL(PHY_ID_AQR106) },
-       { PHY_ID_MATCH_MODEL(PHY_ID_AQR107) },
-+      { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
+@@ -834,6 +896,7 @@ static struct mdio_device_id __maybe_unu
        { PHY_ID_MATCH_MODEL(PHY_ID_AQCS109) },
        { PHY_ID_MATCH_MODEL(PHY_ID_AQR405) },
+       { PHY_ID_MATCH_MODEL(PHY_ID_AQR113C) },
 +      { PHY_ID_MATCH_MODEL(PHY_ID_AQR813) },
        { }
  };