1 From af83e0c7d766078fcd5580c0c81b9e5b55ff5906 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 16/30] net: dsa: mt7530: remove pad_setup function pointer
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
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
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.
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>
25 drivers/net/dsa/mt7530.c | 36 ++----------------------------------
26 drivers/net/dsa/mt7530.h | 3 ---
27 2 files changed, 2 insertions(+), 37 deletions(-)
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);
36 -mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface)
42 -mt7531_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
48 mt7531_pll_setup(struct mt7530_priv *priv)
50 @@ -2640,14 +2628,6 @@ static void mt7988_mac_port_get_caps(str
54 -mt753x_pad_setup(struct dsa_switch *ds, const struct phylink_link_state *state)
56 - struct mt7530_priv *priv = ds->priv;
58 - return priv->info->pad_setup(ds, state->interface);
62 mt7530_mac_config(struct dsa_switch *ds, int port, unsigned int mode,
63 phy_interface_t interface)
65 @@ -2812,8 +2792,6 @@ mt753x_phylink_mac_config(struct dsa_swi
66 if (priv->p6_interface == state->interface)
69 - mt753x_pad_setup(ds, state);
71 if (mt753x_mac_config(ds, port, mode, state) < 0)
74 @@ -3130,11 +3108,6 @@ mt753x_conduit_state_change(struct dsa_s
75 mt7530_rmw(priv, MT7530_MFC, CPU_EN | CPU_PORT_MASK, val);
78 -static int mt7988_pad_setup(struct dsa_switch *ds, phy_interface_t interface)
83 static int mt7988_setup(struct dsa_switch *ds)
85 struct mt7530_priv *priv = ds->priv;
86 @@ -3198,7 +3171,6 @@ const struct mt753x_info mt753x_table[]
87 .phy_write_c22 = mt7530_phy_write_c22,
88 .phy_read_c45 = mt7530_phy_read_c45,
89 .phy_write_c45 = mt7530_phy_write_c45,
90 - .pad_setup = mt7530_pad_clk_setup,
91 .mac_port_get_caps = mt7530_mac_port_get_caps,
92 .mac_port_config = mt7530_mac_config,
94 @@ -3210,7 +3182,6 @@ const struct mt753x_info mt753x_table[]
95 .phy_write_c22 = mt7530_phy_write_c22,
96 .phy_read_c45 = mt7530_phy_read_c45,
97 .phy_write_c45 = mt7530_phy_write_c45,
98 - .pad_setup = mt7530_pad_clk_setup,
99 .mac_port_get_caps = mt7530_mac_port_get_caps,
100 .mac_port_config = mt7530_mac_config,
102 @@ -3222,7 +3193,6 @@ const struct mt753x_info mt753x_table[]
103 .phy_write_c22 = mt7531_ind_c22_phy_write,
104 .phy_read_c45 = mt7531_ind_c45_phy_read,
105 .phy_write_c45 = mt7531_ind_c45_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 @@ -3235,7 +3205,6 @@ const struct mt753x_info mt753x_table[]
111 .phy_write_c22 = mt7531_ind_c22_phy_write,
112 .phy_read_c45 = mt7531_ind_c45_phy_read,
113 .phy_write_c45 = mt7531_ind_c45_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 @@ -3265,9 +3234,8 @@ mt7530_probe_common(struct mt7530_priv *
119 /* Sanity check if these required device operations are filled
122 - if (!priv->info->sw_setup || !priv->info->pad_setup ||
123 - !priv->info->phy_read_c22 || !priv->info->phy_write_c22 ||
124 - !priv->info->mac_port_get_caps ||
125 + if (!priv->info->sw_setup || !priv->info->phy_read_c22 ||
126 + !priv->info->phy_write_c22 || !priv->info->mac_port_get_caps ||
127 !priv->info->mac_port_config)
130 --- a/drivers/net/dsa/mt7530.h
131 +++ b/drivers/net/dsa/mt7530.h
132 @@ -724,8 +724,6 @@ struct mt753x_pcs {
133 * @phy_write_c22: Holding the way writing PHY port using C22
134 * @phy_read_c45: Holding the way reading PHY port using C45
135 * @phy_write_c45: Holding the way writing PHY port using C45
136 - * @pad_setup: Holding the way setting up the bus pad for a certain
138 * @phy_mode_supported: Check if the PHY type is being supported on a certain
140 * @mac_port_validate: Holding the way to set addition validate type for a
141 @@ -746,7 +744,6 @@ struct mt753x_info {
143 int (*phy_write_c45)(struct mt7530_priv *priv, int port, int devad,
144 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);