diff mbox series

[net-next,v2,2/2] net: phy: qcom: qca808x: fill in possible_interfaces

Message ID 20240228172452.2456842-3-robimarko@gmail.com (mailing list archive)
State Accepted
Commit cb28f702960695e26597c332b0e46776e825cc34
Delegated to: Netdev Maintainers
Headers show
Series net: phy: qcom: qca808x: fill in possible_interfaces | expand

Checks

Context Check Description
netdev/series_format success Posting correctly formatted
netdev/tree_selection success Clearly marked for net-next
netdev/ynl success Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present success Fixes tag not required for -next series
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 940 this patch: 940
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 10 of 10 maintainers
netdev/build_clang success Errors and warnings before: 957 this patch: 957
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 957 this patch: 957
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 24 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-02-29--21-00 (tests: 885)

Commit Message

Robert Marko Feb. 28, 2024, 5:24 p.m. UTC
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>
---
 drivers/net/phy/qcom/qca808x.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Russell King (Oracle) Feb. 28, 2024, 6:04 p.m. UTC | #1
On Wed, Feb 28, 2024 at 06:24:10PM +0100, Robert Marko wrote:
> 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>

Thanks!
diff mbox series

Patch

diff --git a/drivers/net/phy/qcom/qca808x.c b/drivers/net/phy/qcom/qca808x.c
index a4c61a8e07c3..5048304ccc9e 100644
--- a/drivers/net/phy/qcom/qca808x.c
+++ b/drivers/net/phy/qcom/qca808x.c
@@ -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;
@@ -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,