Lines Matching refs:bus
128 static int xgmac_mdio_write(struct mii_bus *bus, int phy_id, int regnum, u16 value) in xgmac_mdio_write() argument
130 struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv; in xgmac_mdio_write()
150 ret = xgmac_wait_until_free(&bus->dev, regs, endian); in xgmac_mdio_write()
162 ret = xgmac_wait_until_free(&bus->dev, regs, endian); in xgmac_mdio_write()
170 ret = xgmac_wait_until_done(&bus->dev, regs, endian); in xgmac_mdio_write()
182 static int xgmac_mdio_read(struct mii_bus *bus, int phy_id, int regnum) in xgmac_mdio_read() argument
184 struct mdio_fsl_priv *priv = (struct mdio_fsl_priv *)bus->priv; in xgmac_mdio_read()
204 ret = xgmac_wait_until_free(&bus->dev, regs, endian); in xgmac_mdio_read()
216 ret = xgmac_wait_until_free(&bus->dev, regs, endian); in xgmac_mdio_read()
224 ret = xgmac_wait_until_done(&bus->dev, regs, endian); in xgmac_mdio_read()
230 dev_err(&bus->dev, in xgmac_mdio_read()
237 dev_dbg(&bus->dev, "read %04x\n", value); in xgmac_mdio_read()
245 struct mii_bus *bus; in xgmac_mdio_probe() local
256 bus = mdiobus_alloc_size(sizeof(struct mdio_fsl_priv)); in xgmac_mdio_probe()
257 if (!bus) in xgmac_mdio_probe()
260 bus->name = "Freescale XGMAC MDIO Bus"; in xgmac_mdio_probe()
261 bus->read = xgmac_mdio_read; in xgmac_mdio_probe()
262 bus->write = xgmac_mdio_write; in xgmac_mdio_probe()
263 bus->parent = &pdev->dev; in xgmac_mdio_probe()
264 snprintf(bus->id, MII_BUS_ID_SIZE, "%llx", (unsigned long long)res.start); in xgmac_mdio_probe()
267 priv = bus->priv; in xgmac_mdio_probe()
280 ret = of_mdiobus_register(bus, np); in xgmac_mdio_probe()
286 platform_set_drvdata(pdev, bus); in xgmac_mdio_probe()
294 mdiobus_free(bus); in xgmac_mdio_probe()
301 struct mii_bus *bus = platform_get_drvdata(pdev); in xgmac_mdio_remove() local
303 mdiobus_unregister(bus); in xgmac_mdio_remove()
304 iounmap(bus->priv); in xgmac_mdio_remove()
305 mdiobus_free(bus); in xgmac_mdio_remove()