1
0

736-at803x-fix-reset-handling.patch 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
  2. Date: Wed, 23 Mar 2016 00:44:40 +0300
  3. Subject: [PATCH] at803x: fix reset handling
  4. MIME-Version: 1.0
  5. Content-Type: text/plain; charset=UTF-8
  6. Content-Transfer-Encoding: 8bit
  7. The driver of course "knows" that the chip's reset signal is active low,
  8. so it drives the GPIO to 0 to reset the PHY and to 1 otherwise; however
  9. all this will only work iff the GPIO is specified as active-high in the
  10. device tree! I think both the driver and the device trees (if there are
  11. any -- I was unable to find them) need to be fixed in this case...
  12. Fixes: 13a56b449325 ("net: phy: at803x: Add support for hardware reset")
  13. Signed-off-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
  14. Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
  15. Signed-off-by: David S. Miller <davem@davemloft.net>
  16. ---
  17. --- a/drivers/net/phy/at803x.c
  18. +++ b/drivers/net/phy/at803x.c
  19. @@ -250,7 +250,7 @@ static int at803x_probe(struct phy_devic
  20. if (!priv)
  21. return -ENOMEM;
  22. - gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
  23. + gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
  24. if (IS_ERR(gpiod_reset))
  25. return PTR_ERR(gpiod_reset);
  26. @@ -377,10 +377,10 @@ static void at803x_link_change_notify(st
  27. at803x_context_save(phydev, &context);
  28. - gpiod_set_value(priv->gpiod_reset, 0);
  29. - msleep(1);
  30. gpiod_set_value(priv->gpiod_reset, 1);
  31. msleep(1);
  32. + gpiod_set_value(priv->gpiod_reset, 0);
  33. + msleep(1);
  34. at803x_context_restore(phydev, &context);