725830e769d61a880914150f1c6e00f6e4054d79
[openwrt/staging/neocturne.git] /
1 From fcbc5d900fa53f79963fe4626069739ee5567b4b Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Ar=C4=B1n=C3=A7=20=C3=9CNAL?= <arinc.unal@arinc9.com>
3 Date: Tue, 6 Feb 2024 01:08:06 +0300
4 Subject: [PATCH 34/48] net: dsa: mt7530: remove pad_setup function pointer
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 The pad_setup function pointer was introduced with 88bdef8be9f6 ("net: dsa:
10 mt7530: Extend device data ready for adding a new hardware"). It was being
11 used to set up the core clock and port 6 of the MT7530 switch, and pll of
12 the MT7531 switch.
13
14 All of these were moved to more appropriate locations, and it was never
15 used for the switch on the MT7988 SoC. Therefore, this function pointer
16 hasn't got a use anymore. Remove it.
17
18 Acked-by: Daniel Golle <daniel@makrotopia.org>
19 Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
20 Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
21 Signed-off-by: Arınç ÜNAL <arinc.unal@arinc9.com>
22 Link: https://lore.kernel.org/r/20240206-for-netnext-mt7530-improvements-2-v5-5-d7d92a185cb1@arinc9.com
23 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
24 ---
25 drivers/net/dsa/mt7530.c | 36 ++----------------------------------
26 drivers/net/dsa/mt7530.h | 3 ---
27 2 files changed, 2 insertions(+), 37 deletions(-)
28
29 --- a/drivers/net/dsa/mt7530.c
30 +++ b/drivers/net/dsa/mt7530.c
31 @@ -467,18 +467,6 @@ mt7530_setup_port6(struct dsa_switch *ds
32 core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_TRGMIICK_EN);
33 }
34
35 -static int
36 -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
37 -{
38 - return 0;
39 -}
40 -
41 -static int
42 -mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
43 -{
44 - return 0;
45 -}
46 -
47 static void
48 mt7531_pll_setup(struct mt7530_priv *priv)
49 {
50 @@ -2820,14 +2808,6 @@ static void mt7988_mac_port_get_caps(str
51 }
52
53 static int
54 -mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
55 -{
56 - struct mt7530_priv *priv = ds->priv;
57 -
58 - return priv->info->pad_setup(ds, state->interface);
59 -}
60 -
61 -static int
62 mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
63 phy_interface_t interface)
64 {
65 @@ -2992,8 +2972,6 @@ mt753x_phylink_mac_config(struct dsa_swi
66 if (priv->p6_interface == state->interface)
67 break;
68
69 - mt753x_pad_setup(ds, state);
70 -
71 if (mt753x_mac_config(ds, port, mode, state) < 0)
72 goto unsupported;
73
74 @@ -3316,11 +3294,6 @@ mt753x_conduit_state_change(struct dsa_s
75 mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
76 }
77
78 -static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
79 -{
80 - return 0;
81 -}
82 -
83 static int mt7988_setup(struct dsa_switch *ds)
84 {
85 struct mt7530_priv *priv = ds->priv;
86 @@ -3382,7 +3355,6 @@ const struct mt753x_info mt753x_table[]
87 .sw_setup = mt7530_setup,
88 .phy_read = mt7530_phy_read,
89 .phy_write = mt7530_phy_write,
90 - .pad_setup = mt7530_pad_clk_setup,
91 .mac_port_get_caps = mt7530_mac_port_get_caps,
92 .mac_port_config = mt7530_mac_config,
93 },
94 @@ -3392,7 +3364,6 @@ const struct mt753x_info mt753x_table[]
95 .sw_setup = mt7530_setup,
96 .phy_read = mt7530_phy_read,
97 .phy_write = mt7530_phy_write,
98 - .pad_setup = mt7530_pad_clk_setup,
99 .mac_port_get_caps = mt7530_mac_port_get_caps,
100 .mac_port_config = mt7530_mac_config,
101 },
102 @@ -3402,7 +3373,6 @@ const struct mt753x_info mt753x_table[]
103 .sw_setup = mt7531_setup,
104 .phy_read = mt7531_ind_phy_read,
105 .phy_write = mt7531_ind_phy_write,
106 - .pad_setup = mt7531_pad_setup,
107 .cpu_port_config = mt7531_cpu_port_config,
108 .mac_port_get_caps = mt7531_mac_port_get_caps,
109 .mac_port_config = mt7531_mac_config,
110 @@ -3413,7 +3383,6 @@ const struct mt753x_info mt753x_table[]
111 .sw_setup = mt7988_setup,
112 .phy_read = mt7531_ind_phy_read,
113 .phy_write = mt7531_ind_phy_write,
114 - .pad_setup = mt7988_pad_setup,
115 .cpu_port_config = mt7988_cpu_port_config,
116 .mac_port_get_caps = mt7988_mac_port_get_caps,
117 .mac_port_config = mt7988_mac_config,
118 @@ -3443,9 +3412,8 @@ mt7530_probe_common(struct mt7530_priv *
119 /* Sanity check if these required device operations are filled
120 * properly.
121 */
122 - if (!priv->info->sw_setup || !priv->info->pad_setup ||
123 - !priv->info->phy_read || !priv->info->phy_write ||
124 - !priv->info->mac_port_get_caps ||
125 + if (!priv->info->sw_setup || !priv->info->phy_read ||
126 + !priv->info->phy_write || !priv->info->mac_port_get_caps ||
127 !priv->info->mac_port_config)
128 return -EINVAL;
129
130 --- a/drivers/net/dsa/mt7530.h
131 +++ b/drivers/net/dsa/mt7530.h
132 @@ -732,8 +732,6 @@ struct mt753x_pcs {
133 * @sw_setup: Holding the handler to a device initialization
134 * @phy_read: Holding the way reading PHY port
135 * @phy_write: Holding the way writing PHY port
136 - * @pad_setup: Holding the way setting up the bus pad for a certain
137 - * MAC port
138 * @phy_mode_supported: Check if the PHY type is being supported on a certain
139 * port
140 * @mac_port_validate: Holding the way to set addition validate type for a
141 @@ -749,7 +747,6 @@ struct mt753x_info {
142 int (*sw_setup)(struct dsa_switch *ds);
143 int (*phy_read)(struct mt7530_priv *priv, int port, int regnum);
144 int (*phy_write)(struct mt7530_priv *priv, int port, int regnum, u16 val);
145 - int (*pad_setup)(struct dsa_switch *ds, phy_interface_t interface);
146 int (*cpu_port_config)(struct dsa_switch *ds, int port);
147 void (*mac_port_get_caps)(struct dsa_switch *ds, int port,
148 struct phylink_config *config);