Skip to content

Commit

Permalink
net: phy: qcom: qca808x: fill in possible_interfaces
Browse files Browse the repository at this point in the history
Currently QCA808x driver does not fill the possible_interfaces.
2.5G QCA808x support SGMII and 2500Base-X while 1G model only supports
SGMII, so fill the possible_interfaces accordingly.

Signed-off-by: Robert Marko <robimarko@gmail.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Robert Marko authored and David S. Miller committed Mar 1, 2024
1 parent f058b2d commit cb28f70
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/net/phy/qcom/qca808x.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,16 @@ static bool qca808x_is_1g_only(struct phy_device *phydev)
return !!(QCA808X_PHY_CHIP_TYPE_1G & ret);
}

static void qca808x_fill_possible_interfaces(struct phy_device *phydev)
{
unsigned long *possible = phydev->possible_interfaces;

__set_bit(PHY_INTERFACE_MODE_SGMII, possible);

if (!qca808x_is_1g_only(phydev))
__set_bit(PHY_INTERFACE_MODE_2500BASEX, possible);
}

static int qca808x_probe(struct phy_device *phydev)
{
struct device *dev = &phydev->mdio.dev;
Expand Down Expand Up @@ -231,6 +241,8 @@ static int qca808x_config_init(struct phy_device *phydev)
}
}

qca808x_fill_possible_interfaces(phydev);

/* Configure adc threshold as 100mv for the link 10M */
return at803x_debug_reg_mask(phydev, QCA808X_PHY_DEBUG_ADC_THRESHOLD,
QCA808X_ADC_THRESHOLD_MASK,
Expand Down

0 comments on commit cb28f70

Please sign in to comment.