mtd: fix build with GCC 14
[openwrt/openwrt.git] / target / linux / generic / backport-5.15 / 793-v6.6-net-pcs-lynxi-implement-pcs_disable-op.patch
1 From e4ccdfb78a47132f2d215658aab8902fc457c4b4 Mon Sep 17 00:00:00 2001
2 From: Daniel Golle <daniel@makrotopia.org>
3 Date: Fri, 18 Aug 2023 04:07:46 +0100
4 Subject: [PATCH 082/125] net: pcs: lynxi: implement pcs_disable op
5
6 When switching from 10GBase-R/5GBase-R/USXGMII to one of the interface
7 modes provided by mtk-pcs-lynxi we need to make sure to always perform
8 a full configuration of the PHYA.
9
10 Implement pcs_disable op which resets the stored interface mode to
11 PHY_INTERFACE_MODE_NA to trigger a full reconfiguration once the LynxI
12 PCS driver had previously been deselected in favor of another PCS
13 driver such as the to-be-added driver for the USXGMII PCS found in
14 MT7988.
15
16 Signed-off-by: Daniel Golle <daniel@makrotopia.org>
17 Link: https://lore.kernel.org/r/f23d1a60d2c9d2fb72e32dcb0eaa5f7e867a3d68.1692327891.git.daniel@makrotopia.org
18 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
19 ---
20 drivers/net/pcs/pcs-mtk-lynxi.c | 8 ++++++++
21 1 file changed, 8 insertions(+)
22
23 --- a/drivers/net/pcs/pcs-mtk-lynxi.c
24 +++ b/drivers/net/pcs/pcs-mtk-lynxi.c
25 @@ -241,11 +241,19 @@ static void mtk_pcs_lynxi_link_up(struct
26 }
27 }
28
29 +static void mtk_pcs_lynxi_disable(struct phylink_pcs *pcs)
30 +{
31 + struct mtk_pcs_lynxi *mpcs = pcs_to_mtk_pcs_lynxi(pcs);
32 +
33 + mpcs->interface = PHY_INTERFACE_MODE_NA;
34 +}
35 +
36 static const struct phylink_pcs_ops mtk_pcs_lynxi_ops = {
37 .pcs_get_state = mtk_pcs_lynxi_get_state,
38 .pcs_config = mtk_pcs_lynxi_config,
39 .pcs_an_restart = mtk_pcs_lynxi_restart_an,
40 .pcs_link_up = mtk_pcs_lynxi_link_up,
41 + .pcs_disable = mtk_pcs_lynxi_disable,
42 };
43
44 struct phylink_pcs *mtk_pcs_lynxi_create(struct device *dev,