• Home
  • Raw
  • Download

Lines Matching full:phydev

87 static int vsc824x_add_skew(struct phy_device *phydev)  in vsc824x_add_skew()  argument
92 extcon = phy_read(phydev, MII_VSC8244_EXT_CON1); in vsc824x_add_skew()
103 err = phy_write(phydev, MII_VSC8244_EXT_CON1, extcon); in vsc824x_add_skew()
108 static int vsc824x_config_init(struct phy_device *phydev) in vsc824x_config_init() argument
112 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, in vsc824x_config_init()
117 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) in vsc824x_config_init()
118 err = vsc824x_add_skew(phydev); in vsc824x_config_init()
125 static int vsc73xx_read_page(struct phy_device *phydev) in vsc73xx_read_page() argument
127 return __phy_read(phydev, VSC73XX_EXT_PAGE_ACCESS); in vsc73xx_read_page()
130 static int vsc73xx_write_page(struct phy_device *phydev, int page) in vsc73xx_write_page() argument
132 return __phy_write(phydev, VSC73XX_EXT_PAGE_ACCESS, page); in vsc73xx_write_page()
135 static void vsc73xx_config_init(struct phy_device *phydev) in vsc73xx_config_init() argument
138 phy_write(phydev, 0x1f, 0x2a30); in vsc73xx_config_init()
139 phy_modify(phydev, 0x0c, 0x0300, 0x0200); in vsc73xx_config_init()
140 phy_write(phydev, 0x1f, 0x0000); in vsc73xx_config_init()
143 phy_modify(phydev, MII_TPISTATUS, 0xff00, 0x0061); in vsc73xx_config_init()
146 static int vsc738x_config_init(struct phy_device *phydev) in vsc738x_config_init() argument
154 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
155 phy_modify(phydev, 0x08, 0x0200, 0x0200); in vsc738x_config_init()
156 phy_write(phydev, 0x1f, 0x52b5); in vsc738x_config_init()
157 phy_write(phydev, 0x10, 0xb68a); in vsc738x_config_init()
158 phy_modify(phydev, 0x12, 0xff07, 0x0003); in vsc738x_config_init()
159 phy_modify(phydev, 0x11, 0x00ff, 0x00a2); in vsc738x_config_init()
160 phy_write(phydev, 0x10, 0x968a); in vsc738x_config_init()
161 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
162 phy_modify(phydev, 0x08, 0x0200, 0x0000); in vsc738x_config_init()
163 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
166 rev = phy_read(phydev, MII_PHYSID2); in vsc738x_config_init()
171 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
172 phy_modify(phydev, 0x08, 0x0200, 0x0200); in vsc738x_config_init()
173 phy_write(phydev, 0x1f, 0x52b5); in vsc738x_config_init()
174 phy_write(phydev, 0x12, 0x0000); in vsc738x_config_init()
175 phy_write(phydev, 0x11, 0x0689); in vsc738x_config_init()
176 phy_write(phydev, 0x10, 0x8f92); in vsc738x_config_init()
177 phy_write(phydev, 0x1f, 0x52b5); in vsc738x_config_init()
178 phy_write(phydev, 0x12, 0x0000); in vsc738x_config_init()
179 phy_write(phydev, 0x11, 0x0e35); in vsc738x_config_init()
180 phy_write(phydev, 0x10, 0x9786); in vsc738x_config_init()
181 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
182 phy_modify(phydev, 0x08, 0x0200, 0x0000); in vsc738x_config_init()
183 phy_write(phydev, 0x17, 0xff80); in vsc738x_config_init()
184 phy_write(phydev, 0x17, 0x0000); in vsc738x_config_init()
187 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
188 phy_write(phydev, 0x12, 0x0048); in vsc738x_config_init()
191 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
192 phy_write(phydev, 0x14, 0x6600); in vsc738x_config_init()
193 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
194 phy_write(phydev, 0x18, 0xa24e); in vsc738x_config_init()
196 phy_write(phydev, 0x1f, 0x2a30); in vsc738x_config_init()
197 phy_modify(phydev, 0x16, 0x0fc0, 0x0240); in vsc738x_config_init()
198 phy_modify(phydev, 0x14, 0x6000, 0x4000); in vsc738x_config_init()
202 phy_write(phydev, 0x1f, 0x0001); in vsc738x_config_init()
203 phy_modify(phydev, 0x14, 0xe000, 0x6000); in vsc738x_config_init()
204 phy_write(phydev, 0x1f, 0x0000); in vsc738x_config_init()
207 vsc73xx_config_init(phydev); in vsc738x_config_init()
209 return genphy_config_init(phydev); in vsc738x_config_init()
212 static int vsc739x_config_init(struct phy_device *phydev) in vsc739x_config_init() argument
219 phy_write(phydev, 0x1f, 0x2a30); in vsc739x_config_init()
220 phy_modify(phydev, 0x08, 0x0200, 0x0200); in vsc739x_config_init()
221 phy_write(phydev, 0x1f, 0x52b5); in vsc739x_config_init()
222 phy_write(phydev, 0x10, 0xb68a); in vsc739x_config_init()
223 phy_modify(phydev, 0x12, 0xff07, 0x0003); in vsc739x_config_init()
224 phy_modify(phydev, 0x11, 0x00ff, 0x00a2); in vsc739x_config_init()
225 phy_write(phydev, 0x10, 0x968a); in vsc739x_config_init()
226 phy_write(phydev, 0x1f, 0x2a30); in vsc739x_config_init()
227 phy_modify(phydev, 0x08, 0x0200, 0x0000); in vsc739x_config_init()
228 phy_write(phydev, 0x1f, 0x0000); in vsc739x_config_init()
230 phy_write(phydev, 0x1f, 0x0000); in vsc739x_config_init()
231 phy_write(phydev, 0x12, 0x0048); in vsc739x_config_init()
232 phy_write(phydev, 0x1f, 0x2a30); in vsc739x_config_init()
233 phy_modify(phydev, 0x16, 0x0fc0, 0x0240); in vsc739x_config_init()
234 phy_modify(phydev, 0x14, 0x6000, 0x4000); in vsc739x_config_init()
235 phy_write(phydev, 0x1f, 0x0001); in vsc739x_config_init()
236 phy_modify(phydev, 0x14, 0xe000, 0x6000); in vsc739x_config_init()
237 phy_write(phydev, 0x1f, 0x0000); in vsc739x_config_init()
239 vsc73xx_config_init(phydev); in vsc739x_config_init()
241 return genphy_config_init(phydev); in vsc739x_config_init()
244 static int vsc73xx_config_aneg(struct phy_device *phydev) in vsc73xx_config_aneg() argument
257 static int vsc8601_add_skew(struct phy_device *phydev) in vsc8601_add_skew() argument
261 ret = phy_read(phydev, MII_VSC8601_EPHY_CTL); in vsc8601_add_skew()
266 return phy_write(phydev, MII_VSC8601_EPHY_CTL, ret); in vsc8601_add_skew()
269 static int vsc8601_config_init(struct phy_device *phydev) in vsc8601_config_init() argument
273 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) in vsc8601_config_init()
274 ret = vsc8601_add_skew(phydev); in vsc8601_config_init()
279 return genphy_config_init(phydev); in vsc8601_config_init()
282 static int vsc824x_ack_interrupt(struct phy_device *phydev) in vsc824x_ack_interrupt() argument
290 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in vsc824x_ack_interrupt()
291 err = phy_read(phydev, MII_VSC8244_ISTAT); in vsc824x_ack_interrupt()
296 static int vsc82xx_config_intr(struct phy_device *phydev) in vsc82xx_config_intr() argument
300 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) in vsc82xx_config_intr()
301 err = phy_write(phydev, MII_VSC8244_IMASK, in vsc82xx_config_intr()
302 (phydev->drv->phy_id == PHY_ID_VSC8234 || in vsc82xx_config_intr()
303 phydev->drv->phy_id == PHY_ID_VSC8244 || in vsc82xx_config_intr()
304 phydev->drv->phy_id == PHY_ID_VSC8514 || in vsc82xx_config_intr()
305 phydev->drv->phy_id == PHY_ID_VSC8572 || in vsc82xx_config_intr()
306 phydev->drv->phy_id == PHY_ID_VSC8574 || in vsc82xx_config_intr()
307 phydev->drv->phy_id == PHY_ID_VSC8601) ? in vsc82xx_config_intr()
314 err = phy_read(phydev, MII_VSC8244_ISTAT); in vsc82xx_config_intr()
319 err = phy_write(phydev, MII_VSC8244_IMASK, 0); in vsc82xx_config_intr()
325 static int vsc8221_config_init(struct phy_device *phydev) in vsc8221_config_init() argument
329 err = phy_write(phydev, MII_VSC8244_AUX_CONSTAT, in vsc8221_config_init()
339 * @phydev: target phy_device struct
344 static int vsc82x4_config_autocross_enable(struct phy_device *phydev) in vsc82x4_config_autocross_enable() argument
348 if (phydev->autoneg == AUTONEG_ENABLE || phydev->speed > SPEED_100) in vsc82x4_config_autocross_enable()
352 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x52b5); in vsc82x4_config_autocross_enable()
354 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_18E, 0x0012); in vsc82x4_config_autocross_enable()
356 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_17E, 0x2803); in vsc82x4_config_autocross_enable()
358 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_16E, 0x87fa); in vsc82x4_config_autocross_enable()
361 ret = phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); in vsc82x4_config_autocross_enable()
363 phy_write(phydev, MII_VSC82X4_EXT_PAGE_ACCESS, 0x0000); in vsc82x4_config_autocross_enable()
369 * @phydev: target phy_device struct
376 static int vsc82x4_config_aneg(struct phy_device *phydev) in vsc82x4_config_aneg() argument
383 if (phydev->autoneg != AUTONEG_ENABLE && phydev->speed <= SPEED_100) { in vsc82x4_config_aneg()
384 ret = genphy_setup_forced(phydev); in vsc82x4_config_aneg()
389 return vsc82x4_config_autocross_enable(phydev); in vsc82x4_config_aneg()
392 return genphy_config_aneg(phydev); in vsc82x4_config_aneg()