Lines Matching refs:phydev
77 static int vsc824x_add_skew(struct phy_device *phydev) in vsc824x_add_skew() argument
82 extcon = phy_read(phydev, MII_VSC8244_EXT_CON1); in vsc824x_add_skew()
93 err = phy_write(phydev, MII_VSC8244_EXT_CON1, extcon); in vsc824x_add_skew()
98 static int vsc824x_config_init(struct phy_device *phydev) in vsc824x_config_init() argument
102 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, in vsc824x_config_init()
107 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) in vsc824x_config_init()
108 err = vsc824x_add_skew(phydev); in vsc824x_config_init()
113 static int vsc824x_ack_interrupt(struct phy_device *phydev) in vsc824x_ack_interrupt() argument
121 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in vsc824x_ack_interrupt()
122 err = phy_read(phydev, MII_VSC8244_ISTAT); in vsc824x_ack_interrupt()
127 static int vsc82xx_config_intr(struct phy_device *phydev) in vsc82xx_config_intr() argument
131 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in vsc82xx_config_intr()
132 err = phy_write(phydev, MII_VSC8244_IMASK, in vsc82xx_config_intr()
133 (phydev->drv->phy_id == PHY_ID_VSC8234 || in vsc82xx_config_intr()
134 phydev->drv->phy_id == PHY_ID_VSC8244 || in vsc82xx_config_intr()
135 phydev->drv->phy_id == PHY_ID_VSC8514 || in vsc82xx_config_intr()
136 phydev->drv->phy_id == PHY_ID_VSC8574) ? in vsc82xx_config_intr()
143 err = phy_read(phydev, MII_VSC8244_ISTAT); in vsc82xx_config_intr()
148 err = phy_write(phydev, MII_VSC8244_IMASK, 0); in vsc82xx_config_intr()
154 static int vsc8221_config_init(struct phy_device *phydev) in vsc8221_config_init() argument
158 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, in vsc8221_config_init()
173 static int vsc82x4_config_autocross_enable(struct phy_device *phydev) in vsc82x4_config_autocross_enable() argument
177 if (phydev->autoneg == AUTONEG_ENABLE || phydev->speed > SPEED_100) in vsc82x4_config_autocross_enable()
181 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x52b5); in vsc82x4_config_autocross_enable()
183 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_18E, 0x0012); in vsc82x4_config_autocross_enable()
185 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_17E, 0x2803); in vsc82x4_config_autocross_enable()
187 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_16E, 0x87fa); in vsc82x4_config_autocross_enable()
190 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); in vsc82x4_config_autocross_enable()
192 phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); in vsc82x4_config_autocross_enable()
205 static int vsc82x4_config_aneg(struct phy_device *phydev) in vsc82x4_config_aneg() argument
212 if (phydev->autoneg != AUTONEG_ENABLE && phydev->speed <= SPEED_100) { in vsc82x4_config_aneg()
213 ret = genphy_setup_forced(phydev); in vsc82x4_config_aneg()
218 return vsc82x4_config_autocross_enable(phydev); in vsc82x4_config_aneg()
221 return genphy_config_aneg(phydev); in vsc82x4_config_aneg()