0016-phy-mdio-bitbang-ignore-TA-value.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. From e73f7d9a658c7fc693a9b9c45a1f65c014dd6e40 Mon Sep 17 00:00:00 2001
  2. From: Phil Sutter <phil@nwl.cc>
  3. Date: Tue, 13 May 2014 01:17:38 +0200
  4. Subject: [PATCH] phy: mdio-bitbang: ignore TA value
  5. This is necessary on rb493g to make the kernel detect the second switch.
  6. ---
  7. drivers/net/phy/mdio-bitbang.c | 13 ++-----------
  8. 1 file changed, 2 insertions(+), 11 deletions(-)
  9. diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c
  10. index daec9b0..4fa2be0 100644
  11. --- a/drivers/net/phy/mdio-bitbang.c
  12. +++ b/drivers/net/phy/mdio-bitbang.c
  13. @@ -155,7 +155,7 @@ static int mdiobb_cmd_addr(struct mdiobb_ctrl *ctrl, int phy, u32 addr)
  14. static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
  15. {
  16. struct mdiobb_ctrl *ctrl = bus->priv;
  17. - int ret, i;
  18. + int ret;
  19. if (reg & MII_ADDR_C45) {
  20. reg = mdiobb_cmd_addr(ctrl, phy, reg);
  21. @@ -165,16 +165,7 @@ static int mdiobb_read(struct mii_bus *bus, int phy, int reg)
  22. ctrl->ops->set_mdio_dir(ctrl, 0);
  23. - /* check the turnaround bit: the PHY should be driving it to zero */
  24. - if (mdiobb_get_bit(ctrl) != 0) {
  25. - /* PHY didn't drive TA low -- flush any bits it
  26. - * may be trying to send.
  27. - */
  28. - for (i = 0; i < 32; i++)
  29. - mdiobb_get_bit(ctrl);
  30. -
  31. - return 0xffff;
  32. - }
  33. + mdiobb_get_bit(ctrl);
  34. ret = mdiobb_get_num(ctrl, 16);
  35. mdiobb_get_bit(ctrl);
  36. --
  37. 1.8.5.3