Lines Matching full:phydev
315 static int marvell_read_page(struct phy_device *phydev) in marvell_read_page() argument
317 return __phy_read(phydev, MII_MARVELL_PHY_PAGE); in marvell_read_page()
320 static int marvell_write_page(struct phy_device *phydev, int page) in marvell_write_page() argument
322 return __phy_write(phydev, MII_MARVELL_PHY_PAGE, page); in marvell_write_page()
325 static int marvell_set_page(struct phy_device *phydev, int page) in marvell_set_page() argument
327 return phy_write(phydev, MII_MARVELL_PHY_PAGE, page); in marvell_set_page()
330 static int marvell_ack_interrupt(struct phy_device *phydev) in marvell_ack_interrupt() argument
335 err = phy_read(phydev, MII_M1011_IEVENT); in marvell_ack_interrupt()
343 static int marvell_config_intr(struct phy_device *phydev) in marvell_config_intr() argument
347 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in marvell_config_intr()
348 err = marvell_ack_interrupt(phydev); in marvell_config_intr()
352 err = phy_write(phydev, MII_M1011_IMASK, in marvell_config_intr()
355 err = phy_write(phydev, MII_M1011_IMASK, in marvell_config_intr()
360 err = marvell_ack_interrupt(phydev); in marvell_config_intr()
366 static irqreturn_t marvell_handle_interrupt(struct phy_device *phydev) in marvell_handle_interrupt() argument
370 irq_status = phy_read(phydev, MII_M1011_IEVENT); in marvell_handle_interrupt()
372 phy_error(phydev); in marvell_handle_interrupt()
379 phy_trigger_machine(phydev); in marvell_handle_interrupt()
384 static int marvell_set_polarity(struct phy_device *phydev, int polarity) in marvell_set_polarity() argument
402 return phy_modify_changed(phydev, MII_M1011_PHY_SCR, in marvell_set_polarity()
406 static int marvell_config_aneg(struct phy_device *phydev) in marvell_config_aneg() argument
411 err = marvell_set_polarity(phydev, phydev->mdix_ctrl); in marvell_config_aneg()
417 err = phy_write(phydev, MII_M1111_PHY_LED_CONTROL, in marvell_config_aneg()
422 err = genphy_config_aneg(phydev); in marvell_config_aneg()
426 if (phydev->autoneg != AUTONEG_ENABLE || changed) { in marvell_config_aneg()
431 err = genphy_soft_reset(phydev); in marvell_config_aneg()
439 static int m88e1101_config_aneg(struct phy_device *phydev) in m88e1101_config_aneg() argument
447 err = genphy_soft_reset(phydev); in m88e1101_config_aneg()
451 err = phy_write(phydev, 0x1d, 0x1f); in m88e1101_config_aneg()
455 err = phy_write(phydev, 0x1e, 0x200c); in m88e1101_config_aneg()
459 err = phy_write(phydev, 0x1d, 0x5); in m88e1101_config_aneg()
463 err = phy_write(phydev, 0x1e, 0); in m88e1101_config_aneg()
467 err = phy_write(phydev, 0x1e, 0x100); in m88e1101_config_aneg()
471 return marvell_config_aneg(phydev); in m88e1101_config_aneg()
476 * marvell,reg-init property stored in the of_node for the phydev.
488 static int marvell_of_reg_init(struct phy_device *phydev) in marvell_of_reg_init() argument
493 if (!phydev->mdio.dev.of_node) in marvell_of_reg_init()
496 paddr = of_get_property(phydev->mdio.dev.of_node, in marvell_of_reg_init()
501 saved_page = phy_save_page(phydev); in marvell_of_reg_init()
516 ret = marvell_write_page(phydev, page); in marvell_of_reg_init()
523 val = __phy_read(phydev, reg); in marvell_of_reg_init()
532 ret = __phy_write(phydev, reg, val); in marvell_of_reg_init()
537 return phy_restore_page(phydev, saved_page, ret); in marvell_of_reg_init()
540 static int marvell_of_reg_init(struct phy_device *phydev) in marvell_of_reg_init() argument
546 static int m88e1121_config_aneg_rgmii_delays(struct phy_device *phydev) in m88e1121_config_aneg_rgmii_delays() argument
550 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) in m88e1121_config_aneg_rgmii_delays()
553 else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID) in m88e1121_config_aneg_rgmii_delays()
555 else if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID) in m88e1121_config_aneg_rgmii_delays()
560 return phy_modify_paged_changed(phydev, MII_MARVELL_MSCR_PAGE, in m88e1121_config_aneg_rgmii_delays()
565 static int m88e1121_config_aneg(struct phy_device *phydev) in m88e1121_config_aneg() argument
570 if (phy_interface_is_rgmii(phydev)) { in m88e1121_config_aneg()
571 err = m88e1121_config_aneg_rgmii_delays(phydev); in m88e1121_config_aneg()
578 err = marvell_set_polarity(phydev, phydev->mdix_ctrl); in m88e1121_config_aneg()
584 err = genphy_config_aneg(phydev); in m88e1121_config_aneg()
588 if (phydev->autoneg != AUTONEG_ENABLE || changed) { in m88e1121_config_aneg()
592 err = genphy_soft_reset(phydev); in m88e1121_config_aneg()
600 static int m88e1318_config_aneg(struct phy_device *phydev) in m88e1318_config_aneg() argument
604 err = phy_modify_paged(phydev, MII_MARVELL_MSCR_PAGE, in m88e1318_config_aneg()
610 return m88e1121_config_aneg(phydev); in m88e1318_config_aneg()
641 * @phydev: target phy_device struct
648 static int marvell_config_aneg_fiber(struct phy_device *phydev) in marvell_config_aneg_fiber() argument
654 if (phydev->autoneg != AUTONEG_ENABLE) in marvell_config_aneg_fiber()
655 return genphy_setup_forced(phydev); in marvell_config_aneg_fiber()
658 linkmode_and(phydev->advertising, phydev->advertising, in marvell_config_aneg_fiber()
659 phydev->supported); in marvell_config_aneg_fiber()
661 adv = linkmode_adv_to_fiber_adv_t(phydev->advertising); in marvell_config_aneg_fiber()
664 err = phy_modify_changed(phydev, MII_ADVERTISE, in marvell_config_aneg_fiber()
673 return genphy_check_and_restart_aneg(phydev, changed); in marvell_config_aneg_fiber()
676 static int m88e1111_config_aneg(struct phy_device *phydev) in m88e1111_config_aneg() argument
678 int extsr = phy_read(phydev, MII_M1111_PHY_EXT_SR); in m88e1111_config_aneg()
687 if (phydev->interface != PHY_INTERFACE_MODE_SGMII && in m88e1111_config_aneg()
690 return marvell_config_aneg(phydev); in m88e1111_config_aneg()
692 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1111_config_aneg()
697 err = marvell_config_aneg(phydev); in m88e1111_config_aneg()
702 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); in m88e1111_config_aneg()
706 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) in m88e1111_config_aneg()
711 err = genphy_check_and_restart_aneg(phydev, false); in m88e1111_config_aneg()
713 err = marvell_config_aneg_fiber(phydev); in m88e1111_config_aneg()
717 return marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1111_config_aneg()
720 marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1111_config_aneg()
724 static int m88e1510_config_aneg(struct phy_device *phydev) in m88e1510_config_aneg() argument
728 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1510_config_aneg()
733 err = m88e1318_config_aneg(phydev); in m88e1510_config_aneg()
738 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) in m88e1510_config_aneg()
742 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); in m88e1510_config_aneg()
746 err = marvell_config_aneg_fiber(phydev); in m88e1510_config_aneg()
750 return marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1510_config_aneg()
753 marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1510_config_aneg()
757 static void marvell_config_led(struct phy_device *phydev) in marvell_config_led() argument
762 switch (MARVELL_PHY_FAMILY_ID(phydev->phy_id)) { in marvell_config_led()
774 if (phydev->dev_flags & MARVELL_PHY_LED0_LINK_LED1_ACTIVE) in marvell_config_led()
783 err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, MII_PHY_LED_CTRL, in marvell_config_led()
786 phydev_warn(phydev, "Fail to config marvell phy LED.\n"); in marvell_config_led()
789 static int marvell_config_init(struct phy_device *phydev) in marvell_config_init() argument
792 marvell_config_led(phydev); in marvell_config_init()
795 return marvell_of_reg_init(phydev); in marvell_config_init()
798 static int m88e3016_config_init(struct phy_device *phydev) in m88e3016_config_init() argument
803 ret = phy_modify(phydev, MII_88E3016_PHY_SPEC_CTRL, in m88e3016_config_init()
809 return marvell_config_init(phydev); in m88e3016_config_init()
812 static int m88e1111_config_init_hwcfg_mode(struct phy_device *phydev, in m88e1111_config_init_hwcfg_mode() argument
819 return phy_modify(phydev, MII_M1111_PHY_EXT_SR, in m88e1111_config_init_hwcfg_mode()
826 static int m88e1111_config_init_rgmii_delays(struct phy_device *phydev) in m88e1111_config_init_rgmii_delays() argument
830 switch (phydev->interface) { in m88e1111_config_init_rgmii_delays()
845 return phy_modify(phydev, MII_M1111_PHY_EXT_CR, in m88e1111_config_init_rgmii_delays()
850 static int m88e1111_config_init_rgmii(struct phy_device *phydev) in m88e1111_config_init_rgmii() argument
855 err = m88e1111_config_init_rgmii_delays(phydev); in m88e1111_config_init_rgmii()
859 temp = phy_read(phydev, MII_M1111_PHY_EXT_SR); in m88e1111_config_init_rgmii()
870 return phy_write(phydev, MII_M1111_PHY_EXT_SR, temp); in m88e1111_config_init_rgmii()
873 static int m88e1111_config_init_sgmii(struct phy_device *phydev) in m88e1111_config_init_sgmii() argument
878 phydev, in m88e1111_config_init_sgmii()
885 return marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1111_config_init_sgmii()
888 static int m88e1111_config_init_rtbi(struct phy_device *phydev) in m88e1111_config_init_rtbi() argument
892 err = m88e1111_config_init_rgmii_delays(phydev); in m88e1111_config_init_rtbi()
897 phydev, in m88e1111_config_init_rtbi()
904 err = genphy_soft_reset(phydev); in m88e1111_config_init_rtbi()
909 phydev, in m88e1111_config_init_rtbi()
914 static int m88e1111_config_init_1000basex(struct phy_device *phydev) in m88e1111_config_init_1000basex() argument
916 int extsr = phy_read(phydev, MII_M1111_PHY_EXT_SR); in m88e1111_config_init_1000basex()
925 err = phy_modify(phydev, MII_M1111_PHY_EXT_SR, in m88e1111_config_init_1000basex()
936 static int m88e1111_config_init(struct phy_device *phydev) in m88e1111_config_init() argument
940 if (phy_interface_is_rgmii(phydev)) { in m88e1111_config_init()
941 err = m88e1111_config_init_rgmii(phydev); in m88e1111_config_init()
946 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { in m88e1111_config_init()
947 err = m88e1111_config_init_sgmii(phydev); in m88e1111_config_init()
952 if (phydev->interface == PHY_INTERFACE_MODE_RTBI) { in m88e1111_config_init()
953 err = m88e1111_config_init_rtbi(phydev); in m88e1111_config_init()
958 if (phydev->interface == PHY_INTERFACE_MODE_1000BASEX) { in m88e1111_config_init()
959 err = m88e1111_config_init_1000basex(phydev); in m88e1111_config_init()
964 err = marvell_of_reg_init(phydev); in m88e1111_config_init()
968 err = genphy_soft_reset(phydev); in m88e1111_config_init()
972 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { in m88e1111_config_init()
978 err = genphy_read_abilities(phydev); in m88e1111_config_init()
979 linkmode_or(phydev->advertising, phydev->advertising, in m88e1111_config_init()
980 phydev->supported); in m88e1111_config_init()
985 static int m88e1111_get_downshift(struct phy_device *phydev, u8 *data) in m88e1111_get_downshift() argument
989 val = phy_read(phydev, MII_M1111_PHY_EXT_CR); in m88e1111_get_downshift()
1001 static int m88e1111_set_downshift(struct phy_device *phydev, u8 cnt) in m88e1111_set_downshift() argument
1009 err = phy_clear_bits(phydev, MII_M1111_PHY_EXT_CR, in m88e1111_set_downshift()
1015 err = phy_modify(phydev, MII_M1111_PHY_EXT_CR, in m88e1111_set_downshift()
1024 return genphy_soft_reset(phydev); in m88e1111_set_downshift()
1027 static int m88e1111_get_tunable(struct phy_device *phydev, in m88e1111_get_tunable() argument
1032 return m88e1111_get_downshift(phydev, data); in m88e1111_get_tunable()
1038 static int m88e1111_set_tunable(struct phy_device *phydev, in m88e1111_set_tunable() argument
1043 return m88e1111_set_downshift(phydev, *(const u8 *)data); in m88e1111_set_tunable()
1049 static int m88e1011_get_downshift(struct phy_device *phydev, u8 *data) in m88e1011_get_downshift() argument
1053 val = phy_read(phydev, MII_M1011_PHY_SCR); in m88e1011_get_downshift()
1065 static int m88e1011_set_downshift(struct phy_device *phydev, u8 cnt) in m88e1011_set_downshift() argument
1073 err = phy_clear_bits(phydev, MII_M1011_PHY_SCR, in m88e1011_set_downshift()
1079 err = phy_modify(phydev, MII_M1011_PHY_SCR, in m88e1011_set_downshift()
1088 return genphy_soft_reset(phydev); in m88e1011_set_downshift()
1091 static int m88e1011_get_tunable(struct phy_device *phydev, in m88e1011_get_tunable() argument
1096 return m88e1011_get_downshift(phydev, data); in m88e1011_get_tunable()
1102 static int m88e1011_set_tunable(struct phy_device *phydev, in m88e1011_set_tunable() argument
1107 return m88e1011_set_downshift(phydev, *(const u8 *)data); in m88e1011_set_tunable()
1113 static int m88e1112_config_init(struct phy_device *phydev) in m88e1112_config_init() argument
1117 err = m88e1011_set_downshift(phydev, 3); in m88e1112_config_init()
1121 return m88e1111_config_init(phydev); in m88e1112_config_init()
1124 static int m88e1111gbe_config_init(struct phy_device *phydev) in m88e1111gbe_config_init() argument
1128 err = m88e1111_set_downshift(phydev, 3); in m88e1111gbe_config_init()
1132 return m88e1111_config_init(phydev); in m88e1111gbe_config_init()
1135 static int marvell_1011gbe_config_init(struct phy_device *phydev) in marvell_1011gbe_config_init() argument
1139 err = m88e1011_set_downshift(phydev, 3); in marvell_1011gbe_config_init()
1143 return marvell_config_init(phydev); in marvell_1011gbe_config_init()
1145 static int m88e1116r_config_init(struct phy_device *phydev) in m88e1116r_config_init() argument
1149 err = genphy_soft_reset(phydev); in m88e1116r_config_init()
1155 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1116r_config_init()
1159 err = marvell_set_polarity(phydev, phydev->mdix_ctrl); in m88e1116r_config_init()
1163 err = m88e1011_set_downshift(phydev, 8); in m88e1116r_config_init()
1167 if (phy_interface_is_rgmii(phydev)) { in m88e1116r_config_init()
1168 err = m88e1121_config_aneg_rgmii_delays(phydev); in m88e1116r_config_init()
1173 err = genphy_soft_reset(phydev); in m88e1116r_config_init()
1177 return marvell_config_init(phydev); in m88e1116r_config_init()
1180 static int m88e1318_config_init(struct phy_device *phydev) in m88e1318_config_init() argument
1182 if (phy_interrupt_is_valid(phydev)) { in m88e1318_config_init()
1184 phydev, MII_MARVELL_LED_PAGE, in m88e1318_config_init()
1193 return marvell_config_init(phydev); in m88e1318_config_init()
1196 static int m88e1510_config_init(struct phy_device *phydev) in m88e1510_config_init() argument
1214 err = marvell_set_page(phydev, 0x00FF); in m88e1510_config_init()
1219 err = phy_write(phydev, 17, errata_vals[i].reg17); in m88e1510_config_init()
1222 err = phy_write(phydev, 16, errata_vals[i].reg16); in m88e1510_config_init()
1227 err = marvell_set_page(phydev, 0x00FB); in m88e1510_config_init()
1230 err = phy_write(phydev, 07, 0xC00D); in m88e1510_config_init()
1233 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1510_config_init()
1238 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { in m88e1510_config_init()
1240 err = marvell_set_page(phydev, 18); in m88e1510_config_init()
1245 err = phy_modify(phydev, MII_88E1510_GEN_CTRL_REG_1, in m88e1510_config_init()
1252 err = phy_set_bits(phydev, MII_88E1510_GEN_CTRL_REG_1, in m88e1510_config_init()
1258 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1510_config_init()
1262 err = m88e1011_set_downshift(phydev, 3); in m88e1510_config_init()
1266 return m88e1318_config_init(phydev); in m88e1510_config_init()
1269 static int m88e1118_config_aneg(struct phy_device *phydev) in m88e1118_config_aneg() argument
1273 err = marvell_set_polarity(phydev, phydev->mdix_ctrl); in m88e1118_config_aneg()
1277 err = genphy_config_aneg(phydev); in m88e1118_config_aneg()
1281 return genphy_soft_reset(phydev); in m88e1118_config_aneg()
1284 static int m88e1118_config_init(struct phy_device *phydev) in m88e1118_config_init() argument
1290 err = phy_write_paged(phydev, MII_MARVELL_MSCR_PAGE, in m88e1118_config_init()
1295 if (phy_interface_is_rgmii(phydev)) { in m88e1118_config_init()
1296 err = m88e1121_config_aneg_rgmii_delays(phydev); in m88e1118_config_init()
1302 if (phydev->dev_flags & MARVELL_PHY_M1118_DNS323_LEDS) in m88e1118_config_init()
1307 err = phy_write_paged(phydev, MII_MARVELL_LED_PAGE, 0x10, leds); in m88e1118_config_init()
1311 err = marvell_of_reg_init(phydev); in m88e1118_config_init()
1316 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1118_config_init()
1320 return genphy_soft_reset(phydev); in m88e1118_config_init()
1323 static int m88e1149_config_init(struct phy_device *phydev) in m88e1149_config_init() argument
1328 err = marvell_set_page(phydev, MII_MARVELL_MSCR_PAGE); in m88e1149_config_init()
1333 err = phy_write(phydev, 0x15, 0x1048); in m88e1149_config_init()
1337 err = marvell_of_reg_init(phydev); in m88e1149_config_init()
1342 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1149_config_init()
1346 return genphy_soft_reset(phydev); in m88e1149_config_init()
1349 static int m88e1145_config_init_rgmii(struct phy_device *phydev) in m88e1145_config_init_rgmii() argument
1353 err = m88e1111_config_init_rgmii_delays(phydev); in m88e1145_config_init_rgmii()
1357 if (phydev->dev_flags & MARVELL_PHY_M1145_FLAGS_RESISTANCE) { in m88e1145_config_init_rgmii()
1358 err = phy_write(phydev, 0x1d, 0x0012); in m88e1145_config_init_rgmii()
1362 err = phy_modify(phydev, 0x1e, 0x0fc0, in m88e1145_config_init_rgmii()
1368 err = phy_write(phydev, 0x1d, 0x3); in m88e1145_config_init_rgmii()
1372 err = phy_write(phydev, 0x1e, 0x8000); in m88e1145_config_init_rgmii()
1377 static int m88e1145_config_init_sgmii(struct phy_device *phydev) in m88e1145_config_init_sgmii() argument
1380 phydev, MII_M1111_HWCFG_MODE_SGMII_NO_CLK, in m88e1145_config_init_sgmii()
1384 static int m88e1145_config_init(struct phy_device *phydev) in m88e1145_config_init() argument
1389 err = phy_write(phydev, 0x1d, 0x001b); in m88e1145_config_init()
1393 err = phy_write(phydev, 0x1e, 0x418f); in m88e1145_config_init()
1397 err = phy_write(phydev, 0x1d, 0x0016); in m88e1145_config_init()
1401 err = phy_write(phydev, 0x1e, 0xa2da); in m88e1145_config_init()
1405 if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) { in m88e1145_config_init()
1406 err = m88e1145_config_init_rgmii(phydev); in m88e1145_config_init()
1411 if (phydev->interface == PHY_INTERFACE_MODE_SGMII) { in m88e1145_config_init()
1412 err = m88e1145_config_init_sgmii(phydev); in m88e1145_config_init()
1416 err = m88e1111_set_downshift(phydev, 3); in m88e1145_config_init()
1420 err = marvell_of_reg_init(phydev); in m88e1145_config_init()
1427 static int m88e1540_get_fld(struct phy_device *phydev, u8 *msecs) in m88e1540_get_fld() argument
1431 val = phy_read(phydev, MII_88E1540_COPPER_CTRL3); in m88e1540_get_fld()
1462 static int m88e1540_set_fld(struct phy_device *phydev, const u8 *msecs) in m88e1540_set_fld() argument
1468 return phy_clear_bits(phydev, MII_88E1540_COPPER_CTRL3, in m88e1540_set_fld()
1474 ret = genphy_c45_ethtool_get_eee(phydev, &eee); in m88e1540_set_fld()
1476 phydev_warn(phydev, "Fast Link Down detection requires EEE to be disabled!\n"); in m88e1540_set_fld()
1491 ret = phy_modify(phydev, MII_88E1540_COPPER_CTRL3, in m88e1540_set_fld()
1496 return phy_set_bits(phydev, MII_88E1540_COPPER_CTRL3, in m88e1540_set_fld()
1500 static int m88e1540_get_tunable(struct phy_device *phydev, in m88e1540_get_tunable() argument
1505 return m88e1540_get_fld(phydev, data); in m88e1540_get_tunable()
1507 return m88e1011_get_downshift(phydev, data); in m88e1540_get_tunable()
1513 static int m88e1540_set_tunable(struct phy_device *phydev, in m88e1540_set_tunable() argument
1518 return m88e1540_set_fld(phydev, data); in m88e1540_set_tunable()
1520 return m88e1011_set_downshift(phydev, *(const u8 *)data); in m88e1540_set_tunable()
1530 static int m88e6390_errata(struct phy_device *phydev) in m88e6390_errata() argument
1534 err = phy_write(phydev, MII_BMCR, in m88e6390_errata()
1541 err = phy_write_paged(phydev, 0xf8, 0x08, 0x36); in m88e6390_errata()
1545 return genphy_soft_reset(phydev); in m88e6390_errata()
1548 static int m88e6390_config_aneg(struct phy_device *phydev) in m88e6390_config_aneg() argument
1552 err = m88e6390_errata(phydev); in m88e6390_config_aneg()
1556 return m88e1510_config_aneg(phydev); in m88e6390_config_aneg()
1577 static int marvell_read_status_page_an(struct phy_device *phydev, in marvell_read_status_page_an() argument
1584 phydev->link = 0; in marvell_read_status_page_an()
1589 phydev->duplex = DUPLEX_FULL; in marvell_read_status_page_an()
1591 phydev->duplex = DUPLEX_HALF; in marvell_read_status_page_an()
1595 phydev->speed = SPEED_1000; in marvell_read_status_page_an()
1599 phydev->speed = SPEED_100; in marvell_read_status_page_an()
1603 phydev->speed = SPEED_10; in marvell_read_status_page_an()
1608 err = genphy_read_lpa(phydev); in marvell_read_status_page_an()
1612 phy_resolve_aneg_pause(phydev); in marvell_read_status_page_an()
1614 lpa = phy_read(phydev, MII_LPA); in marvell_read_status_page_an()
1619 fiber_lpa_mod_linkmode_lpa_t(phydev->lp_advertising, lpa); in marvell_read_status_page_an()
1621 if (phydev->duplex == DUPLEX_FULL) { in marvell_read_status_page_an()
1623 phydev->pause = 0; in marvell_read_status_page_an()
1624 phydev->asym_pause = 0; in marvell_read_status_page_an()
1626 phydev->pause = 1; in marvell_read_status_page_an()
1627 phydev->asym_pause = 1; in marvell_read_status_page_an()
1629 phydev->pause = 1; in marvell_read_status_page_an()
1630 phydev->asym_pause = 0; in marvell_read_status_page_an()
1646 static int marvell_read_status_page(struct phy_device *phydev, int page) in marvell_read_status_page() argument
1652 status = phy_read(phydev, MII_M1011_PHY_STATUS); in marvell_read_status_page()
1660 phydev->link = !!(status & MII_M1011_PHY_STATUS_LINK); in marvell_read_status_page()
1662 err = genphy_update_link(phydev); in marvell_read_status_page()
1672 linkmode_zero(phydev->lp_advertising); in marvell_read_status_page()
1673 phydev->pause = 0; in marvell_read_status_page()
1674 phydev->asym_pause = 0; in marvell_read_status_page()
1675 phydev->speed = SPEED_UNKNOWN; in marvell_read_status_page()
1676 phydev->duplex = DUPLEX_UNKNOWN; in marvell_read_status_page()
1677 phydev->port = fiber ? PORT_FIBRE : PORT_TP; in marvell_read_status_page()
1679 if (phydev->autoneg == AUTONEG_ENABLE) in marvell_read_status_page()
1680 err = marvell_read_status_page_an(phydev, fiber, status); in marvell_read_status_page()
1682 err = genphy_read_status_fixed(phydev); in marvell_read_status_page()
1696 static int marvell_read_status(struct phy_device *phydev) in marvell_read_status() argument
1702 phydev->supported) && in marvell_read_status()
1703 phydev->interface != PHY_INTERFACE_MODE_SGMII) { in marvell_read_status()
1704 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); in marvell_read_status()
1708 err = marvell_read_status_page(phydev, MII_MARVELL_FIBER_PAGE); in marvell_read_status()
1719 if (phydev->link) in marvell_read_status()
1723 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_read_status()
1728 return marvell_read_status_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_read_status()
1731 marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_read_status()
1740 static int marvell_suspend(struct phy_device *phydev) in marvell_suspend() argument
1746 phydev->supported)) { in marvell_suspend()
1747 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); in marvell_suspend()
1752 err = genphy_suspend(phydev); in marvell_suspend()
1757 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_suspend()
1763 return genphy_suspend(phydev); in marvell_suspend()
1766 marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_suspend()
1775 static int marvell_resume(struct phy_device *phydev) in marvell_resume() argument
1781 phydev->supported)) { in marvell_resume()
1782 err = marvell_set_page(phydev, MII_MARVELL_FIBER_PAGE); in marvell_resume()
1787 err = genphy_resume(phydev); in marvell_resume()
1792 err = marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_resume()
1798 return genphy_resume(phydev); in marvell_resume()
1801 marvell_set_page(phydev, MII_MARVELL_COPPER_PAGE); in marvell_resume()
1805 static int marvell_aneg_done(struct phy_device *phydev) in marvell_aneg_done() argument
1807 int retval = phy_read(phydev, MII_M1011_PHY_STATUS); in marvell_aneg_done()
1812 static void m88e1318_get_wol(struct phy_device *phydev, in m88e1318_get_wol() argument
1820 ret = phy_read_paged(phydev, MII_MARVELL_WOL_PAGE, in m88e1318_get_wol()
1832 static int m88e1318_set_wol(struct phy_device *phydev, in m88e1318_set_wol() argument
1837 oldpage = phy_save_page(phydev); in m88e1318_set_wol()
1843 err = marvell_write_page(phydev, MII_MARVELL_COPPER_PAGE); in m88e1318_set_wol()
1853 if (!phy_interrupt_is_valid(phydev)) in m88e1318_set_wol()
1854 __phy_read(phydev, MII_M1011_IEVENT); in m88e1318_set_wol()
1857 err = __phy_set_bits(phydev, MII_88E1318S_PHY_CSIER, in m88e1318_set_wol()
1862 err = marvell_write_page(phydev, MII_MARVELL_LED_PAGE); in m88e1318_set_wol()
1867 err = __phy_modify(phydev, MII_88E1318S_PHY_LED_TCR, in m88e1318_set_wol()
1876 err = marvell_write_page(phydev, MII_MARVELL_WOL_PAGE); in m88e1318_set_wol()
1881 err = __phy_write(phydev, MII_88E1318S_PHY_MAGIC_PACKET_WORD2, in m88e1318_set_wol()
1882 ((phydev->attached_dev->dev_addr[5] << 8) | in m88e1318_set_wol()
1883 phydev->attached_dev->dev_addr[4])); in m88e1318_set_wol()
1886 err = __phy_write(phydev, MII_88E1318S_PHY_MAGIC_PACKET_WORD1, in m88e1318_set_wol()
1887 ((phydev->attached_dev->dev_addr[3] << 8) | in m88e1318_set_wol()
1888 phydev->attached_dev->dev_addr[2])); in m88e1318_set_wol()
1891 err = __phy_write(phydev, MII_88E1318S_PHY_MAGIC_PACKET_WORD0, in m88e1318_set_wol()
1892 ((phydev->attached_dev->dev_addr[1] << 8) | in m88e1318_set_wol()
1893 phydev->attached_dev->dev_addr[0])); in m88e1318_set_wol()
1898 err = __phy_set_bits(phydev, MII_88E1318S_PHY_WOL_CTRL, in m88e1318_set_wol()
1904 err = marvell_write_page(phydev, MII_MARVELL_WOL_PAGE); in m88e1318_set_wol()
1909 err = __phy_modify(phydev, MII_88E1318S_PHY_WOL_CTRL, in m88e1318_set_wol()
1917 err = marvell_write_page(phydev, MII_MARVELL_WOL_PAGE); in m88e1318_set_wol()
1922 err = __phy_modify(phydev, MII_88E1318S_PHY_WOL_CTRL, 0, in m88e1318_set_wol()
1928 err = marvell_write_page(phydev, MII_MARVELL_WOL_PAGE); in m88e1318_set_wol()
1933 err = __phy_modify(phydev, MII_88E1318S_PHY_WOL_CTRL, in m88e1318_set_wol()
1941 return phy_restore_page(phydev, oldpage, err); in m88e1318_set_wol()
1944 static int marvell_get_sset_count(struct phy_device *phydev) in marvell_get_sset_count() argument
1947 phydev->supported)) in marvell_get_sset_count()
1953 static void marvell_get_strings(struct phy_device *phydev, u8 *data) in marvell_get_strings() argument
1955 int count = marvell_get_sset_count(phydev); in marvell_get_strings()
1964 static u64 marvell_get_stat(struct phy_device *phydev, int i) in marvell_get_stat() argument
1967 struct marvell_priv *priv = phydev->priv; in marvell_get_stat()
1971 val = phy_read_paged(phydev, stat.page, stat.reg); in marvell_get_stat()
1983 static void marvell_get_stats(struct phy_device *phydev, in marvell_get_stats() argument
1986 int count = marvell_get_sset_count(phydev); in marvell_get_stats()
1990 data[i] = marvell_get_stat(phydev, i); in marvell_get_stats()
1993 static int m88e1510_loopback(struct phy_device *phydev, bool enable) in m88e1510_loopback() argument
2000 bmcr_ctl = mii_bmcr_encode_fixed(phydev->speed, phydev->duplex); in m88e1510_loopback()
2002 err = phy_write(phydev, MII_BMCR, bmcr_ctl); in m88e1510_loopback()
2006 if (phydev->speed == SPEED_1000) in m88e1510_loopback()
2008 else if (phydev->speed == SPEED_100) in m88e1510_loopback()
2011 err = phy_modify_paged(phydev, MII_MARVELL_MSCR_PAGE, in m88e1510_loopback()
2018 err = genphy_soft_reset(phydev); in m88e1510_loopback()
2022 err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, in m88e1510_loopback()
2033 err = phy_modify(phydev, MII_BMCR, BMCR_LOOPBACK, 0); in m88e1510_loopback()
2037 return phy_config_aneg(phydev); in m88e1510_loopback()
2041 static int marvell_vct5_wait_complete(struct phy_device *phydev) in marvell_vct5_wait_complete() argument
2047 val = __phy_read(phydev, MII_VCT5_CTRL); in marvell_vct5_wait_complete()
2055 phydev_err(phydev, "Timeout while waiting for cable test to finish\n"); in marvell_vct5_wait_complete()
2059 static int marvell_vct5_amplitude(struct phy_device *phydev, int pair) in marvell_vct5_amplitude() argument
2066 val = __phy_read(phydev, reg); in marvell_vct5_amplitude()
2090 static int marvell_vct5_amplitude_distance(struct phy_device *phydev, in marvell_vct5_amplitude_distance() argument
2098 err = __phy_write(phydev, MII_VCT5_SAMPLE_POINT_DISTANCE, in marvell_vct5_amplitude_distance()
2108 err = __phy_write(phydev, MII_VCT5_CTRL, reg); in marvell_vct5_amplitude_distance()
2112 err = marvell_vct5_wait_complete(phydev); in marvell_vct5_amplitude_distance()
2120 mV = marvell_vct5_amplitude(phydev, i); in marvell_vct5_amplitude_distance()
2121 ethnl_cable_test_amplitude(phydev, i, mV); in marvell_vct5_amplitude_distance()
2127 static int marvell_vct5_amplitude_graph(struct phy_device *phydev) in marvell_vct5_amplitude_graph() argument
2129 struct marvell_priv *priv = phydev->priv; in marvell_vct5_amplitude_graph()
2145 err = phy_write_paged(phydev, MII_MARVELL_VCT5_PAGE, in marvell_vct5_amplitude_graph()
2156 page = phy_select_page(phydev, MII_MARVELL_VCT5_PAGE); in marvell_vct5_amplitude_graph()
2163 err = marvell_vct5_amplitude_distance(phydev, distance, in marvell_vct5_amplitude_graph()
2174 err = __phy_write(phydev, MII_VCT5_TX_PULSE_CTRL, reg); in marvell_vct5_amplitude_graph()
2181 return phy_restore_page(phydev, page, err); in marvell_vct5_amplitude_graph()
2184 static int marvell_cable_test_start_common(struct phy_device *phydev) in marvell_cable_test_start_common() argument
2191 bmcr = phy_read(phydev, MII_BMCR); in marvell_cable_test_start_common()
2195 bmsr = phy_read(phydev, MII_BMSR); in marvell_cable_test_start_common()
2201 ret = phy_clear_bits(phydev, MII_BMCR, BMCR_ANENABLE); in marvell_cable_test_start_common()
2204 ret = genphy_soft_reset(phydev); in marvell_cable_test_start_common()
2216 static int marvell_vct7_cable_test_start(struct phy_device *phydev) in marvell_vct7_cable_test_start() argument
2218 struct marvell_priv *priv = phydev->priv; in marvell_vct7_cable_test_start()
2221 ret = marvell_cable_test_start_common(phydev); in marvell_vct7_cable_test_start()
2230 ret = phy_write_paged(phydev, MII_MARVELL_VCT5_PAGE, in marvell_vct7_cable_test_start()
2239 ret = phy_write_paged(phydev, MII_MARVELL_VCT5_PAGE, in marvell_vct7_cable_test_start()
2244 return phy_write_paged(phydev, MII_MARVELL_VCT7_PAGE, in marvell_vct7_cable_test_start()
2250 static int marvell_vct5_cable_test_tdr_start(struct phy_device *phydev, in marvell_vct5_cable_test_tdr_start() argument
2253 struct marvell_priv *priv = phydev->priv; in marvell_vct5_cable_test_tdr_start()
2269 ret = phy_write_paged(phydev, MII_MARVELL_VCT7_PAGE, in marvell_vct5_cable_test_tdr_start()
2274 ret = marvell_cable_test_start_common(phydev); in marvell_vct5_cable_test_tdr_start()
2278 ret = ethnl_cable_test_pulse(phydev, 1000); in marvell_vct5_cable_test_tdr_start()
2282 return ethnl_cable_test_step(phydev, in marvell_vct5_cable_test_tdr_start()
2307 static int marvell_vct7_report_length(struct phy_device *phydev, in marvell_vct7_report_length() argument
2313 ret = phy_read_paged(phydev, MII_MARVELL_VCT7_PAGE, in marvell_vct7_report_length()
2320 ethnl_cable_test_fault_length(phydev, pair, length); in marvell_vct7_report_length()
2341 static int marvell_vct7_cable_test_report(struct phy_device *phydev) in marvell_vct7_cable_test_report() argument
2347 ret = phy_read_paged(phydev, MII_MARVELL_VCT7_PAGE, in marvell_vct7_cable_test_report()
2361 ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_A, in marvell_vct7_cable_test_report()
2363 ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_B, in marvell_vct7_cable_test_report()
2365 ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_C, in marvell_vct7_cable_test_report()
2367 ethnl_cable_test_result(phydev, ETHTOOL_A_CABLE_PAIR_D, in marvell_vct7_cable_test_report()
2370 ret = phy_read_paged(phydev, MII_MARVELL_VCT7_PAGE, MII_VCT7_CTRL); in marvell_vct7_cable_test_report()
2377 marvell_vct7_report_length(phydev, 0, meter); in marvell_vct7_cable_test_report()
2379 marvell_vct7_report_length(phydev, 1, meter); in marvell_vct7_cable_test_report()
2381 marvell_vct7_report_length(phydev, 2, meter); in marvell_vct7_cable_test_report()
2383 marvell_vct7_report_length(phydev, 3, meter); in marvell_vct7_cable_test_report()
2388 static int marvell_vct7_cable_test_get_status(struct phy_device *phydev, in marvell_vct7_cable_test_get_status() argument
2391 struct marvell_priv *priv = phydev->priv; in marvell_vct7_cable_test_get_status()
2395 ret = marvell_vct5_amplitude_graph(phydev); in marvell_vct7_cable_test_get_status()
2402 ret = phy_read_paged(phydev, MII_MARVELL_VCT7_PAGE, in marvell_vct7_cable_test_get_status()
2411 return marvell_vct7_cable_test_report(phydev); in marvell_vct7_cable_test_get_status()
2419 int (*config)(struct phy_device *phydev);
2420 int (*get_temp)(struct phy_device *phydev, long *temp);
2421 int (*get_temp_critical)(struct phy_device *phydev, long *temp);
2422 int (*set_temp_critical)(struct phy_device *phydev, long temp);
2423 int (*get_temp_alarm)(struct phy_device *phydev, long *alarm);
2427 to_marvell_hwmon_ops(const struct phy_device *phydev) in to_marvell_hwmon_ops() argument
2429 return phydev->drv->driver_data; in to_marvell_hwmon_ops()
2432 static int m88e1121_get_temp(struct phy_device *phydev, long *temp) in m88e1121_get_temp() argument
2440 oldpage = phy_select_page(phydev, MII_MARVELL_MISC_TEST_PAGE); in m88e1121_get_temp()
2445 ret = __phy_read(phydev, MII_88E1121_MISC_TEST); in m88e1121_get_temp()
2449 ret = __phy_write(phydev, MII_88E1121_MISC_TEST, in m88e1121_get_temp()
2457 val = __phy_read(phydev, MII_88E1121_MISC_TEST); in m88e1121_get_temp()
2464 ret = __phy_write(phydev, MII_88E1121_MISC_TEST, in m88e1121_get_temp()
2472 return phy_restore_page(phydev, oldpage, ret); in m88e1121_get_temp()
2475 static int m88e1510_get_temp(struct phy_device *phydev, long *temp) in m88e1510_get_temp() argument
2481 ret = phy_read_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e1510_get_temp()
2491 static int m88e1510_get_temp_critical(struct phy_device *phydev, long *temp) in m88e1510_get_temp_critical() argument
2497 ret = phy_read_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e1510_get_temp_critical()
2510 static int m88e1510_set_temp_critical(struct phy_device *phydev, long temp) in m88e1510_set_temp_critical() argument
2515 return phy_modify_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e1510_set_temp_critical()
2521 static int m88e1510_get_temp_alarm(struct phy_device *phydev, long *alarm) in m88e1510_get_temp_alarm() argument
2527 ret = phy_read_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e1510_get_temp_alarm()
2537 static int m88e6390_get_temp(struct phy_device *phydev, long *temp) in m88e6390_get_temp() argument
2546 oldpage = phy_select_page(phydev, MII_MARVELL_MISC_TEST_PAGE); in m88e6390_get_temp()
2551 ret = __phy_read(phydev, MII_88E6390_MISC_TEST); in m88e6390_get_temp()
2558 ret = __phy_write(phydev, MII_88E6390_MISC_TEST, ret); in m88e6390_get_temp()
2569 ret = __phy_read(phydev, MII_88E6390_TEMP_SENSOR); in m88e6390_get_temp()
2579 ret = __phy_read(phydev, MII_88E6390_MISC_TEST); in m88e6390_get_temp()
2586 ret = __phy_write(phydev, MII_88E6390_MISC_TEST, ret); in m88e6390_get_temp()
2589 phy_restore_page(phydev, oldpage, ret); in m88e6390_get_temp()
2594 static int m88e6393_get_temp(struct phy_device *phydev, long *temp) in m88e6393_get_temp() argument
2598 err = m88e1510_get_temp(phydev, temp); in m88e6393_get_temp()
2608 static int m88e6393_get_temp_critical(struct phy_device *phydev, long *temp) in m88e6393_get_temp_critical() argument
2614 ret = phy_read_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e6393_get_temp_critical()
2625 static int m88e6393_set_temp_critical(struct phy_device *phydev, long temp) in m88e6393_set_temp_critical() argument
2629 return phy_modify_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e6393_set_temp_critical()
2635 static int m88e6393_hwmon_config(struct phy_device *phydev) in m88e6393_hwmon_config() argument
2639 err = m88e6393_set_temp_critical(phydev, 100000); in m88e6393_hwmon_config()
2643 return phy_modify_paged(phydev, MII_MARVELL_MISC_TEST_PAGE, in m88e6393_hwmon_config()
2656 struct phy_device *phydev = dev_get_drvdata(dev); in marvell_hwmon_read() local
2657 const struct marvell_hwmon_ops *ops = to_marvell_hwmon_ops(phydev); in marvell_hwmon_read()
2663 err = ops->get_temp(phydev, temp); in marvell_hwmon_read()
2667 err = ops->get_temp_critical(phydev, temp); in marvell_hwmon_read()
2671 err = ops->get_temp_alarm(phydev, temp); in marvell_hwmon_read()
2681 struct phy_device *phydev = dev_get_drvdata(dev); in marvell_hwmon_write() local
2682 const struct marvell_hwmon_ops *ops = to_marvell_hwmon_ops(phydev); in marvell_hwmon_write()
2688 err = ops->set_temp_critical(phydev, temp); in marvell_hwmon_write()
2699 const struct phy_device *phydev = data; in marvell_hwmon_is_visible() local
2700 const struct marvell_hwmon_ops *ops = to_marvell_hwmon_ops(phydev); in marvell_hwmon_is_visible()
2759 static int marvell_hwmon_name(struct phy_device *phydev) in marvell_hwmon_name() argument
2761 struct marvell_priv *priv = phydev->priv; in marvell_hwmon_name()
2762 struct device *dev = &phydev->mdio.dev; in marvell_hwmon_name()
2779 static int marvell_hwmon_probe(struct phy_device *phydev) in marvell_hwmon_probe() argument
2781 const struct marvell_hwmon_ops *ops = to_marvell_hwmon_ops(phydev); in marvell_hwmon_probe()
2782 struct marvell_priv *priv = phydev->priv; in marvell_hwmon_probe()
2783 struct device *dev = &phydev->mdio.dev; in marvell_hwmon_probe()
2789 err = marvell_hwmon_name(phydev); in marvell_hwmon_probe()
2794 dev, priv->hwmon_name, phydev, &marvell_hwmon_chip_info, NULL); in marvell_hwmon_probe()
2799 err = ops->config(phydev); in marvell_hwmon_probe()
2833 static int marvell_hwmon_probe(struct phy_device *phydev) in marvell_hwmon_probe() argument
2839 static int m88e1318_led_brightness_set(struct phy_device *phydev, in m88e1318_led_brightness_set() argument
2844 reg = phy_read_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_brightness_set()
2863 return phy_write_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_brightness_set()
2867 static int m88e1318_led_blink_set(struct phy_device *phydev, u8 index, in m88e1318_led_blink_set() argument
2873 reg = phy_read_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_blink_set()
2892 return phy_write_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_blink_set()
3097 static int m88e1318_led_hw_is_supported(struct phy_device *phydev, u8 index, in m88e1318_led_hw_is_supported() argument
3115 static int m88e1318_led_hw_control_set(struct phy_device *phydev, u8 index, in m88e1318_led_hw_control_set() argument
3133 reg = phy_read_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_hw_control_set()
3140 return phy_write_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_hw_control_set()
3144 static int m88e1318_led_hw_control_get(struct phy_device *phydev, u8 index, in m88e1318_led_hw_control_get() argument
3152 reg = phy_read_paged(phydev, MII_MARVELL_LED_PAGE, in m88e1318_led_hw_control_get()
3162 static int marvell_probe(struct phy_device *phydev) in marvell_probe() argument
3166 priv = devm_kzalloc(&phydev->mdio.dev, sizeof(*priv), GFP_KERNEL); in marvell_probe()
3170 phydev->priv = priv; in marvell_probe()
3172 return marvell_hwmon_probe(phydev); in marvell_probe()
3178 struct phy_device *phydev = upstream; in m88e1510_sfp_insert() local
3187 dev = &phydev->mdio.dev; in m88e1510_sfp_insert()
3189 sfp_parse_support(phydev->sfp_bus, id, supported, interfaces); in m88e1510_sfp_insert()
3190 interface = sfp_select_interface(phydev->sfp_bus, supported); in m88e1510_sfp_insert()
3213 oldpage = phy_select_page(phydev, MII_MARVELL_MODE_PAGE); in m88e1510_sfp_insert()
3217 ret = __phy_modify(phydev, MII_88E1510_GEN_CTRL_REG_1, in m88e1510_sfp_insert()
3222 ret = __phy_set_bits(phydev, MII_88E1510_GEN_CTRL_REG_1, in m88e1510_sfp_insert()
3226 return phy_restore_page(phydev, oldpage, ret); in m88e1510_sfp_insert()
3231 struct phy_device *phydev = upstream; in m88e1510_sfp_remove() local
3235 oldpage = phy_select_page(phydev, MII_MARVELL_MODE_PAGE); in m88e1510_sfp_remove()
3239 ret = __phy_modify(phydev, MII_88E1510_GEN_CTRL_REG_1, in m88e1510_sfp_remove()
3245 ret = __phy_set_bits(phydev, MII_88E1510_GEN_CTRL_REG_1, in m88e1510_sfp_remove()
3249 phy_restore_page(phydev, oldpage, ret); in m88e1510_sfp_remove()
3259 static int m88e1510_probe(struct phy_device *phydev) in m88e1510_probe() argument
3263 err = marvell_probe(phydev); in m88e1510_probe()
3267 return phy_sfp_probe(phydev, &m88e1510_sfp_ops); in m88e1510_probe()