From: juhosg Date: Tue, 17 Dec 2013 22:14:10 +0000 (+0000) Subject: ar71xx: implement callback in mdio reset X-Git-Url: https://git.archive.openwrt.org/?p=openwrt.git;a=commitdiff_plain;h=48b2781cf59dc1b00cd35ec1b83bfe4beaecf092 ar71xx: implement callback in mdio reset 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 http://patchwork.openwrt.org/patch/4614/ Signed-off-by: Gabor Juhos git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39127 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h index 656a6ef860..68aea202bd 100644 --- a/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h +++ b/target/linux/ar71xx/files/arch/mips/include/asm/mach-ath79/ag71xx_platform.h @@ -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 */ diff --git a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c index ec8823341e..71ae8258b2 100644 --- a/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c +++ b/target/linux/ar71xx/files/drivers/net/ethernet/atheros/ag71xx/ag71xx_mdio.c @@ -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; }