Lines Matching refs:phydev
51 static int dp83td510_config_intr(struct phy_device *phydev) in dp83td510_config_intr() argument
55 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in dp83td510_config_intr()
57 ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TD510E_PHY_STS, in dp83td510_config_intr()
62 ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, in dp83td510_config_intr()
68 ret = phy_set_bits_mmd(phydev, MDIO_MMD_VEND2, in dp83td510_config_intr()
74 ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, in dp83td510_config_intr()
79 ret = phy_clear_bits_mmd(phydev, MDIO_MMD_VEND2, in dp83td510_config_intr()
86 ret = phy_write_mmd(phydev, MDIO_MMD_VEND2, DP83TD510E_PHY_STS, in dp83td510_config_intr()
93 static irqreturn_t dp83td510_handle_interrupt(struct phy_device *phydev) in dp83td510_handle_interrupt() argument
97 ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, DP83TD510E_PHY_STS); in dp83td510_handle_interrupt()
99 phy_error(phydev); in dp83td510_handle_interrupt()
106 ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, DP83TD510E_INTERRUPT_REG_1); in dp83td510_handle_interrupt()
108 phy_error(phydev); in dp83td510_handle_interrupt()
115 phy_trigger_machine(phydev); in dp83td510_handle_interrupt()
120 static int dp83td510_read_status(struct phy_device *phydev) in dp83td510_read_status() argument
125 phydev->speed = SPEED_UNKNOWN; in dp83td510_read_status()
126 phydev->duplex = DUPLEX_UNKNOWN; in dp83td510_read_status()
127 phydev->pause = 0; in dp83td510_read_status()
128 phydev->asym_pause = 0; in dp83td510_read_status()
129 linkmode_zero(phydev->lp_advertising); in dp83td510_read_status()
131 phy_sts = phy_read(phydev, DP83TD510E_PHY_STS); in dp83td510_read_status()
133 phydev->link = !!(phy_sts & DP83TD510E_LINK_STATUS); in dp83td510_read_status()
134 if (phydev->link) { in dp83td510_read_status()
136 phydev->duplex = DUPLEX_FULL; in dp83td510_read_status()
137 phydev->speed = SPEED_10; in dp83td510_read_status()
139 if (phydev->autoneg == AUTONEG_ENABLE) { in dp83td510_read_status()
140 ret = genphy_c45_read_lpa(phydev); in dp83td510_read_status()
144 phy_resolve_aneg_linkmode(phydev); in dp83td510_read_status()
148 if (phydev->autoneg == AUTONEG_ENABLE) { in dp83td510_read_status()
149 ret = genphy_c45_baset1_read_status(phydev); in dp83td510_read_status()
153 ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, in dp83td510_read_status()
159 phydev->master_slave_state = MASTER_SLAVE_STATE_ERR; in dp83td510_read_status()
161 return genphy_c45_pma_baset1_read_master_slave(phydev); in dp83td510_read_status()
167 static int dp83td510_config_aneg(struct phy_device *phydev) in dp83td510_config_aneg() argument
172 ret = genphy_c45_pma_baset1_setup_master_slave(phydev); in dp83td510_config_aneg()
176 if (phydev->autoneg == AUTONEG_DISABLE) in dp83td510_config_aneg()
177 return genphy_c45_an_disable_aneg(phydev); in dp83td510_config_aneg()
179 ret = genphy_c45_an_config_aneg(phydev); in dp83td510_config_aneg()
185 return genphy_c45_check_and_restart_aneg(phydev, changed); in dp83td510_config_aneg()
188 static int dp83td510_get_sqi(struct phy_device *phydev) in dp83td510_get_sqi() argument
193 if (!phydev->link) in dp83td510_get_sqi()
196 ret = phy_read_mmd(phydev, MDIO_MMD_VEND2, DP83TD510E_MSE_DETECT); in dp83td510_get_sqi()
209 static int dp83td510_get_sqi_max(struct phy_device *phydev) in dp83td510_get_sqi_max() argument
214 static int dp83td510_get_features(struct phy_device *phydev) in dp83td510_get_features() argument
223 linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, phydev->supported); in dp83td510_get_features()
224 linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, phydev->supported); in dp83td510_get_features()
225 linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, phydev->supported); in dp83td510_get_features()
227 phydev->supported); in dp83td510_get_features()