diff mbox series

[net-next,v2,3/6] net: stmmac: add support to provide pcs from platform data

Message ID 20230208164203.378153-4-clement.leger@bootlin.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series net: stmmac: add renesas,rzn1-gmac support | expand

Commit Message

Clément Léger Feb. 8, 2023, 4:42 p.m. UTC
Add a pcs field in platform_data to allow providing platform data. This is
gonig to be used by the renesas,rzn1-gmac compatible driver which can make
use of a PCS.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
---
 drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 3 +++
 include/linux/stmmac.h                            | 1 +
 2 files changed, 4 insertions(+)

Comments

Sergey Shtylyov Feb. 8, 2023, 6:21 p.m. UTC | #1
Hello!

On 2/8/23 7:42 PM, Clément Léger wrote:

> Add a pcs field in platform_data to allow providing platform data. This is
> gonig to be used by the renesas,rzn1-gmac compatible driver which can make

   s/gonig/going/ :-)

> use of a PCS.
> 
> Signed-off-by: Clément Léger <clement.leger@bootlin.com>
[...]

MBR, Sergey
diff mbox series

Patch

diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 9a8721227b17..8bf5f73eb4c8 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -7295,6 +7295,9 @@  int stmmac_dvr_probe(struct device *device,
 			goto error_xpcs_setup;
 	}
 
+	if (priv->plat->pcs)
+		priv->hw->phylink_pcs = priv->plat->pcs;
+
 	ret = stmmac_phy_setup(priv);
 	if (ret) {
 		netdev_err(ndev, "failed to setup phy (%d)\n", ret);
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index a152678b82b7..104b3d1101c0 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -273,5 +273,6 @@  struct plat_stmmacenet_data {
 	bool use_phy_wol;
 	bool sph_disable;
 	bool serdes_up_after_phy_linkup;
+	struct phylink_pcs *pcs;
 };
 #endif