707-v6.8-02-net-phy-at803x-move-disable-WOL-to-specific-at8031-p.patch 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. From 6a3b8c573b5a152a6aa7a0b54c5e18b84c6ba6f5 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Fri, 8 Dec 2023 15:51:49 +0100
  4. Subject: [PATCH 02/13] net: phy: at803x: move disable WOL to specific at8031
  5. probe
  6. Move the WOL disable call to specific at8031 probe to make at803x_probe
  7. more generic and drop extra check for PHY ID.
  8. Keep the same previous behaviour by first calling at803x_probe and then
  9. disabling WOL.
  10. Signed-off-by: Christian Marangi <[email protected]>
  11. Reviewed-by: Andrew Lunn <[email protected]>
  12. Signed-off-by: David S. Miller <[email protected]>
  13. ---
  14. drivers/net/phy/at803x.c | 27 +++++++++++++++++----------
  15. 1 file changed, 17 insertions(+), 10 deletions(-)
  16. --- a/drivers/net/phy/at803x.c
  17. +++ b/drivers/net/phy/at803x.c
  18. @@ -886,15 +886,6 @@ static int at803x_probe(struct phy_devic
  19. priv->is_fiber = true;
  20. break;
  21. }
  22. -
  23. - /* Disable WoL in 1588 register which is enabled
  24. - * by default
  25. - */
  26. - ret = phy_modify_mmd(phydev, MDIO_MMD_PCS,
  27. - AT803X_PHY_MMD3_WOL_CTRL,
  28. - AT803X_WOL_EN, 0);
  29. - if (ret)
  30. - return ret;
  31. }
  32. return 0;
  33. @@ -1591,6 +1582,22 @@ static int at803x_cable_test_start(struc
  34. return 0;
  35. }
  36. +static int at8031_probe(struct phy_device *phydev)
  37. +{
  38. + int ret;
  39. +
  40. + ret = at803x_probe(phydev);
  41. + if (ret)
  42. + return ret;
  43. +
  44. + /* Disable WoL in 1588 register which is enabled
  45. + * by default
  46. + */
  47. + return phy_modify_mmd(phydev, MDIO_MMD_PCS,
  48. + AT803X_PHY_MMD3_WOL_CTRL,
  49. + AT803X_WOL_EN, 0);
  50. +}
  51. +
  52. static int qca83xx_config_init(struct phy_device *phydev)
  53. {
  54. u8 switch_revision;
  55. @@ -2092,7 +2099,7 @@ static struct phy_driver at803x_driver[]
  56. PHY_ID_MATCH_EXACT(ATH8031_PHY_ID),
  57. .name = "Qualcomm Atheros AR8031/AR8033",
  58. .flags = PHY_POLL_CABLE_TEST,
  59. - .probe = at803x_probe,
  60. + .probe = at8031_probe,
  61. .config_init = at803x_config_init,
  62. .config_aneg = at803x_config_aneg,
  63. .soft_reset = genphy_soft_reset,