@@ -2179,10 +2179,22 @@ static void qca808x_link_change_notify(struct phy_device *phydev)
QCA8081_PHY_FIFO_RSTN, phydev->link ? QCA8081_PHY_FIFO_RSTN : 0);
}
+static void qca808x_fill_possible_interfaces(struct phy_device *phydev)
+{
+ unsigned long *possible = phydev->possible_interfaces;
+
+ if (phydev->interface != PHY_INTERFACE_MODE_10G_QXGMII) {
+ __set_bit(PHY_INTERFACE_MODE_2500BASEX, possible);
+ __set_bit(PHY_INTERFACE_MODE_SGMII, possible);
+ }
+}
+
static int qca8084_config_init(struct phy_device *phydev)
{
int ret;
+ qca808x_fill_possible_interfaces(phydev);
+
/* Invert ADC clock edge */
ret = at803x_debug_reg_mask(phydev, QCA8084_ADC_CLK_SEL,
QCA8084_ADC_CLK_SEL_ACLK,
When qca808x works on the interface mode sgmii or 2500base-x, the interface mode can be switched according to the PHY link speed. Signed-off-by: Luo Jie <quic_luoj@quicinc.com> --- drivers/net/phy/at803x.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)