ar71xx: implement callback in mdio reset
authorGabor Juhos <juhosg@openwrt.org>
Tue, 17 Dec 2013 22:14:10 +0000 (22:14 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Tue, 17 Dec 2013 22:14:10 +0000 (22:14 +0000)
This enables us to add fixups to the board specific code for boards that
require special treatment of PHYs on mdio bus reset.

Signed-off-by: Felix Kaechele <heffer@fedoraproject.org>
http://patchwork.openwrt.org/patch/4614/
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 39127

target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h
target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c

index 656a6ef860a16580bdb1d0f5aefa6c280498890c..68aea202bd5ec4e191e8c0444f97505fbcb86026 100644 (file)
@@ -55,6 +55,8 @@ struct ag71xx_mdio_platform_data {
        u8              is_ar934x:1;
        unsigned long   mdio_clock;
        unsigned long   ref_clock;
+
+       void            (*reset)(struct mii_bus *bus);
 };
 
 #endif /* __ASM_MACH_ATH79_PLATFORM_H */
index ec8823341e6607f4fcddbfddaf0206674c4dec38..71ae8258b2ef20f7d20ceacec59011ab3babfe23 100644 (file)
@@ -181,6 +181,9 @@ static int ag71xx_mdio_reset(struct mii_bus *bus)
        ag71xx_mdio_wr(am, AG71XX_REG_MII_CFG, t);
        udelay(100);
 
+       if (am->pdata->reset)
+               am->pdata->reset(bus);
+
        return 0;
 }