Lines Matching full:phydev

78 static int vsc824x_add_skew(struct phy_device *phydev)  in vsc824x_add_skew()  argument
83 extcon = phy_read(phydev, MII_VSC8244_EXT_CON1); in vsc824x_add_skew()
94 err = phy_write(phydev, MII_VSC8244_EXT_CON1, extcon); in vsc824x_add_skew()
99 static int vsc824x_config_init(struct phy_device *phydev) in vsc824x_config_init() argument
103 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, in vsc824x_config_init()
108 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) in vsc824x_config_init()
109 err = vsc824x_add_skew(phydev); in vsc824x_config_init()
116 static int vsc73xx_read_page(struct phy_device *phydev) in vsc73xx_read_page() argument
118 return __phy_read(phydev, VSC73XX_EXT_PAGE_ACCESS); in vsc73xx_read_page()
121 static int vsc73xx_write_page(struct phy_device *phydev, int page) in vsc73xx_write_page() argument
123 return __phy_write(phydev, VSC73XX_EXT_PAGE_ACCESS, page); in vsc73xx_write_page()
126 static void vsc73xx_config_init(struct phy_device *phydev) in vsc73xx_config_init() argument
129 phy_write(phydev, 0x1f, 0x2a30); in vsc73xx_config_init()
130 phy_modify(phydev, 0x0c, 0x0300, 0x0200); in vsc73xx_config_init()
131 phy_write(phydev, 0x1f, 0x0000); in vsc73xx_config_init()
134 phy_modify(phydev, MII_TPISTATUS, 0xff00, 0x0061); in vsc73xx_config_init()
137 static int vsc738x_config_init(struct phy_device *phydev) in vsc738x_config_init() argument
145 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
146 phy_modify(phydev, 0x08, 0x0200, 0x0200); in vsc738x_config_init()
147 phy_write(phydev, 0x1f, 0x52b5); in vsc738x_config_init()
148 phy_write(phydev, 0x10, 0xb68a); in vsc738x_config_init()
149 phy_modify(phydev, 0x12, 0xff07, 0x0003); in vsc738x_config_init()
150 phy_modify(phydev, 0x11, 0x00ff, 0x00a2); in vsc738x_config_init()
151 phy_write(phydev, 0x10, 0x968a); in vsc738x_config_init()
152 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
153 phy_modify(phydev, 0x08, 0x0200, 0x0000); in vsc738x_config_init()
154 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
157 rev = phy_read(phydev, MII_PHYSID2); in vsc738x_config_init()
162 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
163 phy_modify(phydev, 0x08, 0x0200, 0x0200); in vsc738x_config_init()
164 phy_write(phydev, 0x1f, 0x52b5); in vsc738x_config_init()
165 phy_write(phydev, 0x12, 0x0000); in vsc738x_config_init()
166 phy_write(phydev, 0x11, 0x0689); in vsc738x_config_init()
167 phy_write(phydev, 0x10, 0x8f92); in vsc738x_config_init()
168 phy_write(phydev, 0x1f, 0x52b5); in vsc738x_config_init()
169 phy_write(phydev, 0x12, 0x0000); in vsc738x_config_init()
170 phy_write(phydev, 0x11, 0x0e35); in vsc738x_config_init()
171 phy_write(phydev, 0x10, 0x9786); in vsc738x_config_init()
172 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
173 phy_modify(phydev, 0x08, 0x0200, 0x0000); in vsc738x_config_init()
174 phy_write(phydev, 0x17, 0xff80); in vsc738x_config_init()
175 phy_write(phydev, 0x17, 0x0000); in vsc738x_config_init()
178 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
179 phy_write(phydev, 0x12, 0x0048); in vsc738x_config_init()
182 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
183 phy_write(phydev, 0x14, 0x6600); in vsc738x_config_init()
184 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
185 phy_write(phydev, 0x18, 0xa24e); in vsc738x_config_init()
187 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
188 phy_modify(phydev, 0x16, 0x0fc0, 0x0240); in vsc738x_config_init()
189 phy_modify(phydev, 0x14, 0x6000, 0x4000); in vsc738x_config_init()
193 phy_write(phydev, 0x1f, 0x0001); in vsc738x_config_init()
194 phy_modify(phydev, 0x14, 0xe000, 0x6000); in vsc738x_config_init()
195 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
198 vsc73xx_config_init(phydev); in vsc738x_config_init()
203 static int vsc739x_config_init(struct phy_device *phydev) in vsc739x_config_init() argument
210 phy_write(phydev, 0x1f, 0x2a30); in vsc739x_config_init()
211 phy_modify(phydev, 0x08, 0x0200, 0x0200); in vsc739x_config_init()
212 phy_write(phydev, 0x1f, 0x52b5); in vsc739x_config_init()
213 phy_write(phydev, 0x10, 0xb68a); in vsc739x_config_init()
214 phy_modify(phydev, 0x12, 0xff07, 0x0003); in vsc739x_config_init()
215 phy_modify(phydev, 0x11, 0x00ff, 0x00a2); in vsc739x_config_init()
216 phy_write(phydev, 0x10, 0x968a); in vsc739x_config_init()
217 phy_write(phydev, 0x1f, 0x2a30); in vsc739x_config_init()
218 phy_modify(phydev, 0x08, 0x0200, 0x0000); in vsc739x_config_init()
219 phy_write(phydev, 0x1f, 0x0000); in vsc739x_config_init()
221 phy_write(phydev, 0x1f, 0x0000); in vsc739x_config_init()
222 phy_write(phydev, 0x12, 0x0048); in vsc739x_config_init()
223 phy_write(phydev, 0x1f, 0x2a30); in vsc739x_config_init()
224 phy_modify(phydev, 0x16, 0x0fc0, 0x0240); in vsc739x_config_init()
225 phy_modify(phydev, 0x14, 0x6000, 0x4000); in vsc739x_config_init()
226 phy_write(phydev, 0x1f, 0x0001); in vsc739x_config_init()
227 phy_modify(phydev, 0x14, 0xe000, 0x6000); in vsc739x_config_init()
228 phy_write(phydev, 0x1f, 0x0000); in vsc739x_config_init()
230 vsc73xx_config_init(phydev); in vsc739x_config_init()
235 static int vsc73xx_config_aneg(struct phy_device *phydev) in vsc73xx_config_aneg() argument
248 static int vsc8601_add_skew(struct phy_device *phydev) in vsc8601_add_skew() argument
252 ret = phy_read(phydev, MII_VSC8601_EPHY_CTL); in vsc8601_add_skew()
257 return phy_write(phydev, MII_VSC8601_EPHY_CTL, ret); in vsc8601_add_skew()
260 static int vsc8601_config_init(struct phy_device *phydev) in vsc8601_config_init() argument
264 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) in vsc8601_config_init()
265 ret = vsc8601_add_skew(phydev); in vsc8601_config_init()
273 static int vsc824x_ack_interrupt(struct phy_device *phydev) in vsc824x_ack_interrupt() argument
281 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in vsc824x_ack_interrupt()
282 err = phy_read(phydev, MII_VSC8244_ISTAT); in vsc824x_ack_interrupt()
287 static int vsc82xx_config_intr(struct phy_device *phydev) in vsc82xx_config_intr() argument
291 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in vsc82xx_config_intr()
292 err = phy_write(phydev, MII_VSC8244_IMASK, in vsc82xx_config_intr()
293 (phydev->drv->phy_id == PHY_ID_VSC8234 || in vsc82xx_config_intr()
294 phydev->drv->phy_id == PHY_ID_VSC8244 || in vsc82xx_config_intr()
295 phydev->drv->phy_id == PHY_ID_VSC8572 || in vsc82xx_config_intr()
296 phydev->drv->phy_id == PHY_ID_VSC8601) ? in vsc82xx_config_intr()
303 err = phy_read(phydev, MII_VSC8244_ISTAT); in vsc82xx_config_intr()
308 err = phy_write(phydev, MII_VSC8244_IMASK, 0); in vsc82xx_config_intr()
314 static int vsc8221_config_init(struct phy_device *phydev) in vsc8221_config_init() argument
318 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, in vsc8221_config_init()
328 * @phydev: target phy_device struct
333 static int vsc82x4_config_autocross_enable(struct phy_device *phydev) in vsc82x4_config_autocross_enable() argument
337 if (phydev->autoneg == AUTONEG_ENABLE || phydev->speed > SPEED_100) in vsc82x4_config_autocross_enable()
341 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x52b5); in vsc82x4_config_autocross_enable()
343 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_18E, 0x0012); in vsc82x4_config_autocross_enable()
345 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_17E, 0x2803); in vsc82x4_config_autocross_enable()
347 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_16E, 0x87fa); in vsc82x4_config_autocross_enable()
350 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); in vsc82x4_config_autocross_enable()
352 phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); in vsc82x4_config_autocross_enable()
358 * @phydev: target phy_device struct
365 static int vsc82x4_config_aneg(struct phy_device *phydev) in vsc82x4_config_aneg() argument
372 if (phydev->autoneg != AUTONEG_ENABLE && phydev->speed <= SPEED_100) { in vsc82x4_config_aneg()
373 ret = genphy_setup_forced(phydev); in vsc82x4_config_aneg()
378 return vsc82x4_config_autocross_enable(phydev); in vsc82x4_config_aneg()
381 return genphy_config_aneg(phydev); in vsc82x4_config_aneg()