Lines Matching full:phydev
76 /* RTL822X_VND2_XXXXX registers are only accessible when phydev->is_c45
112 static int rtl821x_read_page(struct phy_device *phydev) in rtl821x_read_page() argument
114 return __phy_read(phydev, RTL821x_PAGE_SELECT); in rtl821x_read_page()
117 static int rtl821x_write_page(struct phy_device *phydev, int page) in rtl821x_write_page() argument
119 return __phy_write(phydev, RTL821x_PAGE_SELECT, page); in rtl821x_write_page()
122 static int rtl821x_probe(struct phy_device *phydev) in rtl821x_probe() argument
124 struct device *dev = &phydev->mdio.dev; in rtl821x_probe()
126 u32 phy_id = phydev->drv->phy_id; in rtl821x_probe()
138 ret = phy_read_paged(phydev, 0xa43, RTL8211F_PHYCR1); in rtl821x_probe()
148 ret = phy_read_paged(phydev, 0xa43, RTL8211F_PHYCR2); in rtl821x_probe()
157 phydev->priv = priv; in rtl821x_probe()
162 static int rtl8201_ack_interrupt(struct phy_device *phydev) in rtl8201_ack_interrupt() argument
166 err = phy_read(phydev, RTL8201F_ISR); in rtl8201_ack_interrupt()
171 static int rtl821x_ack_interrupt(struct phy_device *phydev) in rtl821x_ack_interrupt() argument
175 err = phy_read(phydev, RTL821x_INSR); in rtl821x_ack_interrupt()
180 static int rtl8211f_ack_interrupt(struct phy_device *phydev) in rtl8211f_ack_interrupt() argument
184 err = phy_read_paged(phydev, 0xa43, RTL8211F_INSR); in rtl8211f_ack_interrupt()
189 static int rtl8201_config_intr(struct phy_device *phydev) in rtl8201_config_intr() argument
194 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8201_config_intr()
195 err = rtl8201_ack_interrupt(phydev); in rtl8201_config_intr()
200 err = phy_write_paged(phydev, 0x7, RTL8201F_IER, val); in rtl8201_config_intr()
203 err = phy_write_paged(phydev, 0x7, RTL8201F_IER, val); in rtl8201_config_intr()
207 err = rtl8201_ack_interrupt(phydev); in rtl8201_config_intr()
213 static int rtl8211b_config_intr(struct phy_device *phydev) in rtl8211b_config_intr() argument
217 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211b_config_intr()
218 err = rtl821x_ack_interrupt(phydev); in rtl8211b_config_intr()
222 err = phy_write(phydev, RTL821x_INER, in rtl8211b_config_intr()
225 err = phy_write(phydev, RTL821x_INER, 0); in rtl8211b_config_intr()
229 err = rtl821x_ack_interrupt(phydev); in rtl8211b_config_intr()
235 static int rtl8211e_config_intr(struct phy_device *phydev) in rtl8211e_config_intr() argument
239 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211e_config_intr()
240 err = rtl821x_ack_interrupt(phydev); in rtl8211e_config_intr()
244 err = phy_write(phydev, RTL821x_INER, in rtl8211e_config_intr()
247 err = phy_write(phydev, RTL821x_INER, 0); in rtl8211e_config_intr()
251 err = rtl821x_ack_interrupt(phydev); in rtl8211e_config_intr()
257 static int rtl8211f_config_intr(struct phy_device *phydev) in rtl8211f_config_intr() argument
262 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl8211f_config_intr()
263 err = rtl8211f_ack_interrupt(phydev); in rtl8211f_config_intr()
268 err = phy_write_paged(phydev, 0xa42, RTL821x_INER, val); in rtl8211f_config_intr()
271 err = phy_write_paged(phydev, 0xa42, RTL821x_INER, val); in rtl8211f_config_intr()
275 err = rtl8211f_ack_interrupt(phydev); in rtl8211f_config_intr()
281 static irqreturn_t rtl8201_handle_interrupt(struct phy_device *phydev) in rtl8201_handle_interrupt() argument
285 irq_status = phy_read(phydev, RTL8201F_ISR); in rtl8201_handle_interrupt()
287 phy_error(phydev); in rtl8201_handle_interrupt()
294 phy_trigger_machine(phydev); in rtl8201_handle_interrupt()
299 static irqreturn_t rtl821x_handle_interrupt(struct phy_device *phydev) in rtl821x_handle_interrupt() argument
303 irq_status = phy_read(phydev, RTL821x_INSR); in rtl821x_handle_interrupt()
305 phy_error(phydev); in rtl821x_handle_interrupt()
309 irq_enabled = phy_read(phydev, RTL821x_INER); in rtl821x_handle_interrupt()
311 phy_error(phydev); in rtl821x_handle_interrupt()
318 phy_trigger_machine(phydev); in rtl821x_handle_interrupt()
323 static irqreturn_t rtl8211f_handle_interrupt(struct phy_device *phydev) in rtl8211f_handle_interrupt() argument
327 irq_status = phy_read_paged(phydev, 0xa43, RTL8211F_INSR); in rtl8211f_handle_interrupt()
329 phy_error(phydev); in rtl8211f_handle_interrupt()
336 phy_trigger_machine(phydev); in rtl8211f_handle_interrupt()
341 static int rtl8211_config_aneg(struct phy_device *phydev) in rtl8211_config_aneg() argument
345 ret = genphy_config_aneg(phydev); in rtl8211_config_aneg()
352 if (phydev->speed == SPEED_100 && phydev->autoneg == AUTONEG_DISABLE) { in rtl8211_config_aneg()
353 phy_write(phydev, 0x17, 0x2138); in rtl8211_config_aneg()
354 phy_write(phydev, 0x0e, 0x0260); in rtl8211_config_aneg()
356 phy_write(phydev, 0x17, 0x2108); in rtl8211_config_aneg()
357 phy_write(phydev, 0x0e, 0x0000); in rtl8211_config_aneg()
363 static int rtl8211c_config_init(struct phy_device *phydev) in rtl8211c_config_init() argument
366 return phy_set_bits(phydev, MII_CTRL1000, in rtl8211c_config_init()
370 static int rtl8211f_config_init(struct phy_device *phydev) in rtl8211f_config_init() argument
372 struct rtl821x_priv *priv = phydev->priv; in rtl8211f_config_init()
373 struct device *dev = &phydev->mdio.dev; in rtl8211f_config_init()
377 ret = phy_modify_paged_changed(phydev, 0xa43, RTL8211F_PHYCR1, in rtl8211f_config_init()
386 switch (phydev->interface) { in rtl8211f_config_init()
411 ret = phy_modify_paged_changed(phydev, 0xd08, 0x11, RTL8211F_TX_DELAY, in rtl8211f_config_init()
426 ret = phy_modify_paged_changed(phydev, 0xd08, 0x15, RTL8211F_RX_DELAY, in rtl8211f_config_init()
442 ret = phy_modify_paged(phydev, 0xa43, RTL8211F_PHYCR2, in rtl8211f_config_init()
450 return genphy_soft_reset(phydev); in rtl8211f_config_init()
456 static int rtl821x_suspend(struct phy_device *phydev) in rtl821x_suspend() argument
458 struct rtl821x_priv *priv = phydev->priv; in rtl821x_suspend()
461 if (!phydev->wol_enabled) { in rtl821x_suspend()
462 ret = genphy_suspend(phydev); in rtl821x_suspend()
473 static int rtl821x_resume(struct phy_device *phydev) in rtl821x_resume() argument
475 struct rtl821x_priv *priv = phydev->priv; in rtl821x_resume()
478 if (!phydev->wol_enabled) in rtl821x_resume()
481 ret = genphy_resume(phydev); in rtl821x_resume()
490 static int rtl8211f_led_hw_is_supported(struct phy_device *phydev, u8 index, in rtl8211f_led_hw_is_supported() argument
525 static int rtl8211f_led_hw_control_get(struct phy_device *phydev, u8 index, in rtl8211f_led_hw_control_get() argument
533 val = phy_read_paged(phydev, 0xd04, RTL8211F_LEDCR); in rtl8211f_led_hw_control_get()
557 static int rtl8211f_led_hw_control_set(struct phy_device *phydev, u8 index, in rtl8211f_led_hw_control_set() argument
583 return phy_modify_paged(phydev, 0xd04, RTL8211F_LEDCR, mask, reg); in rtl8211f_led_hw_control_set()
586 static int rtl8211e_config_init(struct phy_device *phydev) in rtl8211e_config_init() argument
592 switch (phydev->interface) { in rtl8211e_config_init()
618 oldpage = phy_select_page(phydev, 0x7); in rtl8211e_config_init()
622 ret = __phy_write(phydev, RTL821x_EXT_PAGE_SELECT, 0xa4); in rtl8211e_config_init()
626 ret = __phy_modify(phydev, 0x1c, RTL8211E_CTRL_DELAY in rtl8211e_config_init()
631 return phy_restore_page(phydev, oldpage, ret); in rtl8211e_config_init()
634 static int rtl8211b_suspend(struct phy_device *phydev) in rtl8211b_suspend() argument
636 phy_write(phydev, MII_MMD_DATA, BIT(9)); in rtl8211b_suspend()
638 return genphy_suspend(phydev); in rtl8211b_suspend()
641 static int rtl8211b_resume(struct phy_device *phydev) in rtl8211b_resume() argument
643 phy_write(phydev, MII_MMD_DATA, 0); in rtl8211b_resume()
645 return genphy_resume(phydev); in rtl8211b_resume()
648 static int rtl8366rb_config_init(struct phy_device *phydev) in rtl8366rb_config_init() argument
652 ret = phy_set_bits(phydev, RTL8366RB_POWER_SAVE, in rtl8366rb_config_init()
655 dev_err(&phydev->mdio.dev, in rtl8366rb_config_init()
663 static void rtlgen_decode_speed(struct phy_device *phydev, int val) in rtlgen_decode_speed() argument
667 phydev->speed = SPEED_10; in rtlgen_decode_speed()
670 phydev->speed = SPEED_100; in rtlgen_decode_speed()
673 phydev->speed = SPEED_1000; in rtlgen_decode_speed()
676 phydev->speed = SPEED_10000; in rtlgen_decode_speed()
679 phydev->speed = SPEED_2500; in rtlgen_decode_speed()
682 phydev->speed = SPEED_5000; in rtlgen_decode_speed()
689 static int rtlgen_read_status(struct phy_device *phydev) in rtlgen_read_status() argument
693 ret = genphy_read_status(phydev); in rtlgen_read_status()
697 if (!phydev->link) in rtlgen_read_status()
700 val = phy_read_paged(phydev, 0xa43, 0x12); in rtlgen_read_status()
704 rtlgen_decode_speed(phydev, val); in rtlgen_read_status()
709 static int rtlgen_read_mmd(struct phy_device *phydev, int devnum, u16 regnum) in rtlgen_read_mmd() argument
714 rtl821x_write_page(phydev, 0xa5c); in rtlgen_read_mmd()
715 ret = __phy_read(phydev, 0x12); in rtlgen_read_mmd()
716 rtl821x_write_page(phydev, 0); in rtlgen_read_mmd()
718 rtl821x_write_page(phydev, 0xa5d); in rtlgen_read_mmd()
719 ret = __phy_read(phydev, 0x10); in rtlgen_read_mmd()
720 rtl821x_write_page(phydev, 0); in rtlgen_read_mmd()
722 rtl821x_write_page(phydev, 0xa5d); in rtlgen_read_mmd()
723 ret = __phy_read(phydev, 0x11); in rtlgen_read_mmd()
724 rtl821x_write_page(phydev, 0); in rtlgen_read_mmd()
732 static int rtlgen_write_mmd(struct phy_device *phydev, int devnum, u16 regnum, in rtlgen_write_mmd() argument
738 rtl821x_write_page(phydev, 0xa5d); in rtlgen_write_mmd()
739 ret = __phy_write(phydev, 0x10, val); in rtlgen_write_mmd()
740 rtl821x_write_page(phydev, 0); in rtlgen_write_mmd()
748 static int rtl822x_read_mmd(struct phy_device *phydev, int devnum, u16 regnum) in rtl822x_read_mmd() argument
750 int ret = rtlgen_read_mmd(phydev, devnum, regnum); in rtl822x_read_mmd()
756 rtl821x_write_page(phydev, 0xa6e); in rtl822x_read_mmd()
757 ret = __phy_read(phydev, 0x16); in rtl822x_read_mmd()
758 rtl821x_write_page(phydev, 0); in rtl822x_read_mmd()
760 rtl821x_write_page(phydev, 0xa6d); in rtl822x_read_mmd()
761 ret = __phy_read(phydev, 0x12); in rtl822x_read_mmd()
762 rtl821x_write_page(phydev, 0); in rtl822x_read_mmd()
764 rtl821x_write_page(phydev, 0xa6d); in rtl822x_read_mmd()
765 ret = __phy_read(phydev, 0x10); in rtl822x_read_mmd()
766 rtl821x_write_page(phydev, 0); in rtl822x_read_mmd()
772 static int rtl822x_write_mmd(struct phy_device *phydev, int devnum, u16 regnum, in rtl822x_write_mmd() argument
775 int ret = rtlgen_write_mmd(phydev, devnum, regnum, val); in rtl822x_write_mmd()
781 rtl821x_write_page(phydev, 0xa6d); in rtl822x_write_mmd()
782 ret = __phy_write(phydev, 0x12, val); in rtl822x_write_mmd()
783 rtl821x_write_page(phydev, 0); in rtl822x_write_mmd()
789 static int rtl822xb_config_init(struct phy_device *phydev) in rtl822xb_config_init() argument
796 phydev->host_interfaces) || in rtl822xb_config_init()
797 phydev->interface == PHY_INTERFACE_MODE_2500BASEX; in rtl822xb_config_init()
800 phydev->host_interfaces) || in rtl822xb_config_init()
801 phydev->interface == PHY_INTERFACE_MODE_SGMII; in rtl822xb_config_init()
804 __assign_bit(PHY_INTERFACE_MODE_2500BASEX, phydev->possible_interfaces, in rtl822xb_config_init()
806 __assign_bit(PHY_INTERFACE_MODE_SGMII, phydev->possible_interfaces, in rtl822xb_config_init()
815 phydev->rate_matching = RATE_MATCH_PAUSE; in rtl822xb_config_init()
818 phydev->rate_matching = RATE_MATCH_NONE; in rtl822xb_config_init()
824 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x75f3, 0); in rtl822xb_config_init()
828 ret = phy_modify_mmd_changed(phydev, MDIO_MMD_VEND1, in rtl822xb_config_init()
835 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x6a04, 0x0503); in rtl822xb_config_init()
839 ret = phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x6f10, 0xd455); in rtl822xb_config_init()
843 return phy_write_mmd(phydev, MDIO_MMD_VEND1, 0x6f11, 0x8020); in rtl822xb_config_init()
846 static int rtl822xb_get_rate_matching(struct phy_device *phydev, in rtl822xb_get_rate_matching() argument
855 val = phy_read_mmd(phydev, MDIO_MMD_VEND1, RTL822X_VND1_SERDES_OPTION); in rtl822xb_get_rate_matching()
867 static int rtl822x_get_features(struct phy_device *phydev) in rtl822x_get_features() argument
871 val = phy_read_paged(phydev, 0xa61, 0x13); in rtl822x_get_features()
876 phydev->supported, val & MDIO_PMA_SPEED_2_5G); in rtl822x_get_features()
878 phydev->supported, val & MDIO_PMA_SPEED_5G); in rtl822x_get_features()
880 phydev->supported, val & MDIO_SPEED_10G); in rtl822x_get_features()
882 return genphy_read_abilities(phydev); in rtl822x_get_features()
885 static int rtl822x_config_aneg(struct phy_device *phydev) in rtl822x_config_aneg() argument
889 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_config_aneg()
890 u16 adv = linkmode_adv_to_mii_10gbt_adv_t(phydev->advertising); in rtl822x_config_aneg()
892 ret = phy_modify_paged_changed(phydev, 0xa5d, 0x12, in rtl822x_config_aneg()
900 return __genphy_config_aneg(phydev, ret); in rtl822x_config_aneg()
903 static void rtl822xb_update_interface(struct phy_device *phydev) in rtl822xb_update_interface() argument
907 if (!phydev->link) in rtl822xb_update_interface()
911 val = phy_read_mmd(phydev, MDIO_MMD_VEND1, RTL822X_VND1_SERDES_CTRL3); in rtl822xb_update_interface()
917 phydev->interface = PHY_INTERFACE_MODE_2500BASEX; in rtl822xb_update_interface()
920 phydev->interface = PHY_INTERFACE_MODE_SGMII; in rtl822xb_update_interface()
925 static int rtl822x_read_status(struct phy_device *phydev) in rtl822x_read_status() argument
927 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_read_status()
928 int lpadv = phy_read_paged(phydev, 0xa5d, 0x13); in rtl822x_read_status()
933 mii_10gbt_stat_mod_linkmode_lpa_t(phydev->lp_advertising, in rtl822x_read_status()
937 return rtlgen_read_status(phydev); in rtl822x_read_status()
940 static int rtl822xb_read_status(struct phy_device *phydev) in rtl822xb_read_status() argument
944 ret = rtl822x_read_status(phydev); in rtl822xb_read_status()
948 rtl822xb_update_interface(phydev); in rtl822xb_read_status()
953 static int rtl822x_c45_get_features(struct phy_device *phydev) in rtl822x_c45_get_features() argument
956 phydev->supported); in rtl822x_c45_get_features()
958 return genphy_c45_pma_read_abilities(phydev); in rtl822x_c45_get_features()
961 static int rtl822x_c45_config_aneg(struct phy_device *phydev) in rtl822x_c45_config_aneg() argument
966 if (phydev->autoneg == AUTONEG_DISABLE) in rtl822x_c45_config_aneg()
967 return genphy_c45_pma_setup_forced(phydev); in rtl822x_c45_config_aneg()
969 ret = genphy_c45_an_config_aneg(phydev); in rtl822x_c45_config_aneg()
975 val = linkmode_adv_to_mii_ctrl1000_t(phydev->advertising); in rtl822x_c45_config_aneg()
978 ret = phy_modify_mmd_changed(phydev, MDIO_MMD_VEND2, RTL822X_VND2_GBCR, in rtl822x_c45_config_aneg()
985 return genphy_c45_check_and_restart_aneg(phydev, changed); in rtl822x_c45_config_aneg()
988 static int rtl822x_c45_read_status(struct phy_device *phydev) in rtl822x_c45_read_status() argument
992 ret = genphy_c45_read_status(phydev); in rtl822x_c45_read_status()
997 if (phydev->autoneg == AUTONEG_ENABLE) { in rtl822x_c45_read_status()
998 val = phy_read_mmd(phydev, MDIO_MMD_VEND2, in rtl822x_c45_read_status()
1003 mii_stat1000_mod_linkmode_lpa_t(phydev->lp_advertising, val); in rtl822x_c45_read_status()
1006 if (!phydev->link) in rtl822x_c45_read_status()
1010 val = phy_read_mmd(phydev, MDIO_MMD_VEND2, RTL822X_VND2_PHYSR); in rtl822x_c45_read_status()
1014 rtlgen_decode_speed(phydev, val); in rtl822x_c45_read_status()
1019 static int rtl822xb_c45_read_status(struct phy_device *phydev) in rtl822xb_c45_read_status() argument
1023 ret = rtl822x_c45_read_status(phydev); in rtl822xb_c45_read_status()
1027 rtl822xb_update_interface(phydev); in rtl822xb_c45_read_status()
1032 static bool rtlgen_supports_2_5gbps(struct phy_device *phydev) in rtlgen_supports_2_5gbps() argument
1036 phy_write(phydev, RTL821x_PAGE_SELECT, 0xa61); in rtlgen_supports_2_5gbps()
1037 val = phy_read(phydev, 0x13); in rtlgen_supports_2_5gbps()
1038 phy_write(phydev, RTL821x_PAGE_SELECT, 0); in rtlgen_supports_2_5gbps()
1043 static int rtlgen_match_phy_device(struct phy_device *phydev) in rtlgen_match_phy_device() argument
1045 return phydev->phy_id == RTL_GENERIC_PHYID && in rtlgen_match_phy_device()
1046 !rtlgen_supports_2_5gbps(phydev); in rtlgen_match_phy_device()
1049 static int rtl8226_match_phy_device(struct phy_device *phydev) in rtl8226_match_phy_device() argument
1051 return phydev->phy_id == RTL_GENERIC_PHYID && in rtl8226_match_phy_device()
1052 rtlgen_supports_2_5gbps(phydev); in rtl8226_match_phy_device()
1055 static int rtlgen_is_c45_match(struct phy_device *phydev, unsigned int id, in rtlgen_is_c45_match() argument
1058 if (phydev->is_c45) in rtlgen_is_c45_match()
1059 return is_c45 && (id == phydev->c45_ids.device_ids[1]); in rtlgen_is_c45_match()
1061 return !is_c45 && (id == phydev->phy_id); in rtlgen_is_c45_match()
1064 static int rtl8221b_vb_cg_c22_match_phy_device(struct phy_device *phydev) in rtl8221b_vb_cg_c22_match_phy_device() argument
1066 return rtlgen_is_c45_match(phydev, RTL_8221B_VB_CG, false); in rtl8221b_vb_cg_c22_match_phy_device()
1069 static int rtl8221b_vb_cg_c45_match_phy_device(struct phy_device *phydev) in rtl8221b_vb_cg_c45_match_phy_device() argument
1071 return rtlgen_is_c45_match(phydev, RTL_8221B_VB_CG, true); in rtl8221b_vb_cg_c45_match_phy_device()
1074 static int rtl8221b_vn_cg_c22_match_phy_device(struct phy_device *phydev) in rtl8221b_vn_cg_c22_match_phy_device() argument
1076 return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, false); in rtl8221b_vn_cg_c22_match_phy_device()
1079 static int rtl8221b_vn_cg_c45_match_phy_device(struct phy_device *phydev) in rtl8221b_vn_cg_c45_match_phy_device() argument
1081 return rtlgen_is_c45_match(phydev, RTL_8221B_VN_CG, true); in rtl8221b_vn_cg_c45_match_phy_device()
1084 static int rtl8251b_c22_match_phy_device(struct phy_device *phydev) in rtl8251b_c22_match_phy_device() argument
1086 return rtlgen_is_c45_match(phydev, RTL_8251B, false); in rtl8251b_c22_match_phy_device()
1089 static int rtl8251b_c45_match_phy_device(struct phy_device *phydev) in rtl8251b_c45_match_phy_device() argument
1091 return rtlgen_is_c45_match(phydev, RTL_8251B, true); in rtl8251b_c45_match_phy_device()
1094 static int rtlgen_resume(struct phy_device *phydev) in rtlgen_resume() argument
1096 int ret = genphy_resume(phydev); in rtlgen_resume()
1104 static int rtlgen_c45_resume(struct phy_device *phydev) in rtlgen_c45_resume() argument
1106 int ret = genphy_c45_pma_resume(phydev); in rtlgen_c45_resume()
1113 static int rtl9000a_config_init(struct phy_device *phydev) in rtl9000a_config_init() argument
1115 phydev->autoneg = AUTONEG_DISABLE; in rtl9000a_config_init()
1116 phydev->speed = SPEED_100; in rtl9000a_config_init()
1117 phydev->duplex = DUPLEX_FULL; in rtl9000a_config_init()
1122 static int rtl9000a_config_aneg(struct phy_device *phydev) in rtl9000a_config_aneg() argument
1127 switch (phydev->master_slave_set) { in rtl9000a_config_aneg()
1137 phydev_warn(phydev, "Unsupported Master/Slave mode\n"); in rtl9000a_config_aneg()
1141 ret = phy_modify_changed(phydev, MII_CTRL1000, CTL1000_AS_MASTER, ctl); in rtl9000a_config_aneg()
1143 ret = genphy_soft_reset(phydev); in rtl9000a_config_aneg()
1148 static int rtl9000a_read_status(struct phy_device *phydev) in rtl9000a_read_status() argument
1152 phydev->master_slave_get = MASTER_SLAVE_CFG_UNKNOWN; in rtl9000a_read_status()
1153 phydev->master_slave_state = MASTER_SLAVE_STATE_UNKNOWN; in rtl9000a_read_status()
1155 ret = genphy_update_link(phydev); in rtl9000a_read_status()
1159 ret = phy_read(phydev, MII_CTRL1000); in rtl9000a_read_status()
1163 phydev->master_slave_get = MASTER_SLAVE_CFG_MASTER_FORCE; in rtl9000a_read_status()
1165 phydev->master_slave_get = MASTER_SLAVE_CFG_SLAVE_FORCE; in rtl9000a_read_status()
1167 ret = phy_read(phydev, MII_STAT1000); in rtl9000a_read_status()
1171 phydev->master_slave_state = MASTER_SLAVE_STATE_MASTER; in rtl9000a_read_status()
1173 phydev->master_slave_state = MASTER_SLAVE_STATE_SLAVE; in rtl9000a_read_status()
1178 static int rtl9000a_ack_interrupt(struct phy_device *phydev) in rtl9000a_ack_interrupt() argument
1182 err = phy_read(phydev, RTL8211F_INSR); in rtl9000a_ack_interrupt()
1187 static int rtl9000a_config_intr(struct phy_device *phydev) in rtl9000a_config_intr() argument
1192 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in rtl9000a_config_intr()
1193 err = rtl9000a_ack_interrupt(phydev); in rtl9000a_config_intr()
1198 err = phy_write_paged(phydev, 0xa42, RTL9000A_GINMR, val); in rtl9000a_config_intr()
1201 err = phy_write_paged(phydev, 0xa42, RTL9000A_GINMR, val); in rtl9000a_config_intr()
1205 err = rtl9000a_ack_interrupt(phydev); in rtl9000a_config_intr()
1208 return phy_write_paged(phydev, 0xa42, RTL9000A_GINMR, val); in rtl9000a_config_intr()
1211 static irqreturn_t rtl9000a_handle_interrupt(struct phy_device *phydev) in rtl9000a_handle_interrupt() argument
1215 irq_status = phy_read(phydev, RTL8211F_INSR); in rtl9000a_handle_interrupt()
1217 phy_error(phydev); in rtl9000a_handle_interrupt()
1224 phy_trigger_machine(phydev); in rtl9000a_handle_interrupt()