Lines Matching refs:bus
175 static int hns_mdio_wait_ready(struct mii_bus *bus) in hns_mdio_wait_ready() argument
177 struct hns_mdio_device *mdio_dev = bus->priv; in hns_mdio_wait_ready()
219 static int hns_mdio_write(struct mii_bus *bus, in hns_mdio_write() argument
223 struct hns_mdio_device *mdio_dev = (struct hns_mdio_device *)bus->priv; in hns_mdio_write()
230 dev_dbg(&bus->dev, "mdio write %s,base is %p\n", in hns_mdio_write()
231 bus->id, mdio_dev->vbase); in hns_mdio_write()
232 dev_dbg(&bus->dev, "phy id=%d, is_c45=%d, devad=%d, reg=%#x, write data=%d\n", in hns_mdio_write()
236 ret = hns_mdio_wait_ready(bus); in hns_mdio_write()
238 dev_err(&bus->dev, "MDIO bus is busy\n"); in hns_mdio_write()
254 ret = hns_mdio_wait_ready(bus); in hns_mdio_write()
256 dev_err(&bus->dev, "MDIO bus is busy\n"); in hns_mdio_write()
282 static int hns_mdio_read(struct mii_bus *bus, int phy_id, int regnum) in hns_mdio_read() argument
289 struct hns_mdio_device *mdio_dev = (struct hns_mdio_device *)bus->priv; in hns_mdio_read()
291 dev_dbg(&bus->dev, "mdio read %s,base is %p\n", in hns_mdio_read()
292 bus->id, mdio_dev->vbase); in hns_mdio_read()
293 dev_dbg(&bus->dev, "phy id=%d, is_c45=%d, devad=%d, reg=%#x!\n", in hns_mdio_read()
297 ret = hns_mdio_wait_ready(bus); in hns_mdio_read()
299 dev_err(&bus->dev, "MDIO bus is busy\n"); in hns_mdio_read()
315 ret = hns_mdio_wait_ready(bus); in hns_mdio_read()
317 dev_err(&bus->dev, "MDIO bus is busy\n"); in hns_mdio_read()
327 ret = hns_mdio_wait_ready(bus); in hns_mdio_read()
329 dev_err(&bus->dev, "MDIO bus is busy\n"); in hns_mdio_read()
335 dev_err(&bus->dev, " ERROR! MDIO Read failed!\n"); in hns_mdio_read()
352 static int hns_mdio_reset(struct mii_bus *bus) in hns_mdio_reset() argument
354 struct hns_mdio_device *mdio_dev = (struct hns_mdio_device *)bus->priv; in hns_mdio_reset()
358 dev_err(&bus->dev, "mdio sys ctl reg has not maped\n"); in hns_mdio_reset()
367 dev_err(&bus->dev, "MDIO reset fail\n"); in hns_mdio_reset()
376 dev_err(&bus->dev, "MDIO dis clk fail\n"); in hns_mdio_reset()
385 dev_err(&bus->dev, "MDIO dis clk fail\n"); in hns_mdio_reset()
394 dev_err(&bus->dev, "MDIO en clk fail\n"); in hns_mdio_reset()
492 struct mii_bus *bus; in hns_mdio_remove() local
494 bus = platform_get_drvdata(pdev); in hns_mdio_remove()
496 mdiobus_unregister(bus); in hns_mdio_remove()