Skip to content

Commit

Permalink
ramips: make PHY initialization more descriptive
Browse files Browse the repository at this point in the history
The basic mode control register of the ESW PHYs is modified in this
codeblock. Use the respective macros to make this code more readable.

Signed-off-by: David Bauer <mail@david-bauer.net>
  • Loading branch information
blocktrron committed Jun 7, 2021
1 parent 4413537 commit 6a15abb
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -13,6 +13,7 @@
*/

#include <linux/module.h>
#include <linux/mii.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/platform_device.h>
Expand Down Expand Up @@ -168,9 +169,9 @@ static void mt7620_hw_init(struct mt7620_gsw *gsw, int mdio_mode)

/* turn on all PHYs */
for (i = 0; i <= 4; i++) {
val = _mt7620_mii_read(gsw, gsw->ephy_base + i, 0);
val &= ~BIT(11);
_mt7620_mii_write(gsw, gsw->ephy_base + i, 0, val);
val = _mt7620_mii_read(gsw, gsw->ephy_base + i, MII_BMCR);
val &= ~BMCR_PDOWN;
_mt7620_mii_write(gsw, gsw->ephy_base + i, MII_BMCR, val);
}
}

Expand Down

0 comments on commit 6a15abb

Please sign in to comment.