Florian Fainelli 87aa9f9c61 net: phy: consolidate PHY reset in phy_init_hw()
There are quite a lot of drivers touching a PHY device MII_BMCR
register to reset the PHY without taking care of:

1) ensuring that BMCR_RESET is cleared after a given timeout
2) the PHY state machine resuming to the proper state and re-applying
potentially changed settings such as auto-negotiation

Introduce phy_poll_reset() which will take care of polling the MII_BMCR
for the BMCR_RESET bit to be cleared after a given timeout or return a
timeout error code.

In order to make sure the PHY is in a correct state, phy_init_hw() first
issues a software reset through MII_BMCR and then applies any fixups.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-09 20:38:59 -05:00
..
2012-06-11 16:58:24 -07:00
2013-11-07 15:37:09 -05:00
2013-03-09 16:09:17 -05:00
2013-11-07 15:37:09 -05:00
2013-11-07 15:37:09 -05:00
2012-06-11 16:58:24 -07:00
2012-12-07 14:26:15 -05:00
2013-11-28 18:30:54 -05:00