Lines Matching refs:sbus
246 struct mii_bus *sbus; /* mdio slave */ member
836 static int __ar9331_mdio_write(struct mii_bus *sbus, u8 mode, u16 reg, u16 val) in __ar9331_mdio_write() argument
844 return __mdiobus_write(sbus, p, r, val); in __ar9331_mdio_write()
847 static int __ar9331_mdio_read(struct mii_bus *sbus, u16 reg) in __ar9331_mdio_read() argument
855 return __mdiobus_read(sbus, p, r); in __ar9331_mdio_read()
862 struct mii_bus *sbus = priv->sbus; in ar9331_mdio_read() local
875 mutex_lock_nested(&sbus->mdio_lock, MDIO_MUTEX_NESTED); in ar9331_mdio_read()
877 ret = __ar9331_mdio_read(sbus, reg); in ar9331_mdio_read()
882 ret = __ar9331_mdio_read(sbus, reg + 2); in ar9331_mdio_read()
888 mutex_unlock(&sbus->mdio_lock); in ar9331_mdio_read()
892 mutex_unlock(&sbus->mdio_lock); in ar9331_mdio_read()
893 dev_err_ratelimited(&sbus->dev, "Bus error. Failed to read register.\n"); in ar9331_mdio_read()
901 struct mii_bus *sbus = priv->sbus; in ar9331_mdio_write() local
904 mutex_lock_nested(&sbus->mdio_lock, MDIO_MUTEX_NESTED); in ar9331_mdio_write()
906 ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_PAGE, in ar9331_mdio_write()
911 mutex_unlock(&sbus->mdio_lock); in ar9331_mdio_write()
923 ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg + 2, in ar9331_mdio_write()
928 ret = __ar9331_mdio_write(sbus, AR9331_SW_MDIO_PHY_MODE_REG, reg, val); in ar9331_mdio_write()
932 mutex_unlock(&sbus->mdio_lock); in ar9331_mdio_write()
937 mutex_unlock(&sbus->mdio_lock); in ar9331_mdio_write()
938 dev_err_ratelimited(&sbus->dev, "Bus error. Failed to write register.\n"); in ar9331_mdio_write()
1055 priv->sbus = mdiodev->bus; in ar9331_sw_probe()