]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: dwmac-socfpga: get the phy_mode with the dedicated helper
authorMaxime Chevallier <maxime.chevallier@bootlin.com>
Tue, 24 Mar 2026 09:20:59 +0000 (10:20 +0100)
committerJakub Kicinski <kuba@kernel.org>
Fri, 27 Mar 2026 01:19:42 +0000 (18:19 -0700)
commitadf1536f79a5699b2fbece74d175af43320ec404
treef50c69cf0842207896471debba21b38f5889c727
parent9b04ecdfb8768a754db4bdb4a9073d0a650c0b53
net: stmmac: dwmac-socfpga: get the phy_mode with the dedicated helper

We enable/disable the sgmii_adapter in the .fix_mac_speed() ops based on
the phy_mode used in the plat_data. We currently get it with :

socfpga_dwmac
  ->dev
    ->drv_data
      ->netdev
        ->priv
  ->stmmac_priv
    ->plat
      ->phy_interface

where we can get it with :

socfpga_dwmac
  ->plat_data
    ->phy_interface (done by socfpga_get_plat_phymode)

Use that helper here.

Note that we are also being passed a phy_interface_t from the
.fix_mac_speed() callback, provided by phylink.

We can handle that in the future when dynamic interface selection is
supported. We'd need to guarantee that we have a Lynx PCS to handle it.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/20260324092102.687082-5-maxime.chevallier@bootlin.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c