]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: stmmac: qcom-ethqos: pass phy interface mode to configs
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 23 Feb 2026 09:34:46 +0000 (09:34 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 25 Feb 2026 01:43:22 +0000 (17:43 -0800)
Pass the current phylink phy interface mode to the RGMII and "SGMII"
configuration functions.

Reviewed-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Tested-by: Mohd Ayaan Anwar <mohd.anwar@oss.qualcomm.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vuSL0-0000000AScM-2TN0@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c

index 9b29516a5a7c708cc1a050be3556c43855559909..e2dd334ffd31cf29e966241d5aa1a1b9b44b4e1a 100644 (file)
@@ -100,7 +100,8 @@ struct ethqos_emac_driver_data {
 struct qcom_ethqos {
        struct platform_device *pdev;
        void __iomem *rgmii_base;
-       void (*configure_func)(struct qcom_ethqos *ethqos, int speed);
+       void (*configure_func)(struct qcom_ethqos *ethqos,
+                              phy_interface_t interface, int speed);
 
        unsigned int link_clk_rate;
        struct clk *link_clk;
@@ -521,7 +522,8 @@ static int ethqos_rgmii_macro_init(struct qcom_ethqos *ethqos, int speed)
        return 0;
 }
 
-static void ethqos_configure_rgmii(struct qcom_ethqos *ethqos, int speed)
+static void ethqos_configure_rgmii(struct qcom_ethqos *ethqos,
+                                  phy_interface_t interface, int speed)
 {
        struct device *dev = &ethqos->pdev->dev;
        unsigned int i;
@@ -605,7 +607,8 @@ static void ethqos_pcs_set_inband(struct stmmac_priv *priv, bool enable)
 /* On interface toggle MAC registers gets reset.
  * Configure MAC block for SGMII on ethernet phy link up
  */
-static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos, int speed)
+static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos,
+                                  phy_interface_t interface, int speed)
 {
        struct net_device *dev = platform_get_drvdata(ethqos->pdev);
        struct stmmac_priv *priv = netdev_priv(dev);
@@ -638,9 +641,10 @@ static void ethqos_configure_sgmii(struct qcom_ethqos *ethqos, int speed)
        }
 }
 
-static void ethqos_configure(struct qcom_ethqos *ethqos, int speed)
+static void ethqos_configure(struct qcom_ethqos *ethqos,
+                            phy_interface_t interface, int speed)
 {
-       return ethqos->configure_func(ethqos, speed);
+       return ethqos->configure_func(ethqos, interface, speed);
 }
 
 static void ethqos_fix_mac_speed(void *priv, phy_interface_t interface,
@@ -649,7 +653,7 @@ static void ethqos_fix_mac_speed(void *priv, phy_interface_t interface,
        struct qcom_ethqos *ethqos = priv;
 
        ethqos_update_link_clk(ethqos, speed);
-       ethqos_configure(ethqos, speed);
+       ethqos_configure(ethqos, interface, speed);
 }
 
 static int qcom_ethqos_serdes_powerup(struct net_device *ndev, void *priv)