diff options
author | Srinivas Kandagatla <srinivas.kandagatla@st.com> | 2011-11-15 12:54:15 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-11-15 22:56:17 +0100 |
commit | 64882709ef07f3eae29c7afc5aa8b84d12733a72 (patch) | |
tree | e5504eef06ec6841b429f47e4b4cddf52d9fe5fa /drivers/net/phy/mdio-bitbang.c | |
parent | IPv6: Removing unnecessary NULL checks. (diff) | |
download | linux-64882709ef07f3eae29c7afc5aa8b84d12733a72.tar.xz linux-64882709ef07f3eae29c7afc5aa8b84d12733a72.zip |
mdio-gpio: Add reset functionality to mdio-gpio driver(v2).
This patch adds phy reset functionality to mdio-gpio driver. Now
mdio_gpio_platform_data has new member as function pointer which can be
filled at the bsp level for a callback from phy infrastructure. Also the
mdio-bitbang driver fills-in the reset function of mii_bus structure.
Without this patch the bsp level code has to takecare of the reseting
PHY's on the bus, which become bit hacky for every bsp and
phy-infrastructure is ignored aswell.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@st.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/phy/mdio-bitbang.c')
-rw-r--r-- | drivers/net/phy/mdio-bitbang.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/net/phy/mdio-bitbang.c b/drivers/net/phy/mdio-bitbang.c index 65391891d8c4..daec9b05d168 100644 --- a/drivers/net/phy/mdio-bitbang.c +++ b/drivers/net/phy/mdio-bitbang.c @@ -202,6 +202,14 @@ static int mdiobb_write(struct mii_bus *bus, int phy, int reg, u16 val) return 0; } +static int mdiobb_reset(struct mii_bus *bus) +{ + struct mdiobb_ctrl *ctrl = bus->priv; + if (ctrl->reset) + ctrl->reset(bus); + return 0; +} + struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl) { struct mii_bus *bus; @@ -214,6 +222,7 @@ struct mii_bus *alloc_mdio_bitbang(struct mdiobb_ctrl *ctrl) bus->read = mdiobb_read; bus->write = mdiobb_write; + bus->reset = mdiobb_reset; bus->priv = ctrl; return bus; |