2
0

715-v6.9-02-net-phy-qcom-qca808x-default-to-LED-active-High-if-n.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. From f203c8c77c7616c099647636f4c67d59a45fe8a2 Mon Sep 17 00:00:00 2001
  2. From: Christian Marangi <[email protected]>
  3. Date: Thu, 1 Feb 2024 14:46:01 +0100
  4. Subject: [PATCH 2/2] net: phy: qcom: qca808x: default to LED active High if
  5. not set
  6. qca808x PHY provide support for the led_polarity_set OP to configure
  7. and apply the active-low property but on PHY reset, the Active High bit
  8. is not set resulting in the LED driven as active-low.
  9. To fix this, check if active-low is not set in DT and enable Active High
  10. polarity by default to restore correct funcionality of the LED.
  11. Fixes: 7196062b64ee ("net: phy: at803x: add LED support for qca808x")
  12. Signed-off-by: Christian Marangi <[email protected]>
  13. Signed-off-by: David S. Miller <[email protected]>
  14. ---
  15. drivers/net/phy/qcom/qca808x.c | 10 ++++++++++
  16. 1 file changed, 10 insertions(+)
  17. --- a/drivers/net/phy/qcom/qca808x.c
  18. +++ b/drivers/net/phy/qcom/qca808x.c
  19. @@ -290,8 +290,18 @@ static int qca808x_probe(struct phy_devi
  20. static int qca808x_config_init(struct phy_device *phydev)
  21. {
  22. + struct qca808x_priv *priv = phydev->priv;
  23. int ret;
  24. + /* Default to LED Active High if active-low not in DT */
  25. + if (priv->led_polarity_mode == -1) {
  26. + ret = phy_set_bits_mmd(phydev, MDIO_MMD_AN,
  27. + QCA808X_MMD7_LED_POLARITY_CTRL,
  28. + QCA808X_LED_ACTIVE_HIGH);
  29. + if (ret)
  30. + return ret;
  31. + }
  32. +
  33. /* Active adc&vga on 802.3az for the link 1000M and 100M */
  34. ret = phy_modify_mmd(phydev, MDIO_MMD_PCS, QCA808X_PHY_MMD3_ADDR_CLD_CTRL7,
  35. QCA808X_8023AZ_AFE_CTRL_MASK, QCA808X_8023AZ_AFE_EN);