mirror of
				https://github.com/torvalds/linux.git
				synced 2025-10-31 08:38:45 +02:00 
			
		
		
		
	net: dsa: lantiq_gswip: support model-specific mac_select_pcs()
Call mac_select_pcs() function if provided in struct gswip_hwinfo. The MaxLinear GSW1xx series got one port wired to a SerDes PCS and PHY which can do 1000Base-X, 2500Base-X and SGMII. Support for the SerDes port will be provided using phylink_pcs, so provide a convenient way for mac_select_pcs() to differ based on the hardware model. Signed-off-by: Daniel Golle <daniel@makrotopia.org> Reviewed-by: Hauke Mehrtens <hauke@hauke-m.de> Link: https://patch.msgid.link/7668666aa51e43e7f2a6cbcf36eb5a0a3020998f.1756520811.git.daniel@makrotopia.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
		
							parent
							
								
									cb477c3051
								
							
						
					
					
						commit
						7a1eaef0a7
					
				
					 2 changed files with 19 additions and 3 deletions
				
			
		|  | @ -1592,10 +1592,23 @@ static int gswip_get_sset_count(struct dsa_switch *ds, int port, int sset) | |||
| 	return ARRAY_SIZE(gswip_rmon_cnt); | ||||
| } | ||||
| 
 | ||||
| static struct phylink_pcs *gswip_phylink_mac_select_pcs(struct phylink_config *config, | ||||
| 							phy_interface_t interface) | ||||
| { | ||||
| 	struct dsa_port *dp = dsa_phylink_to_port(config); | ||||
| 	struct gswip_priv *priv = dp->ds->priv; | ||||
| 
 | ||||
| 	if (priv->hw_info->mac_select_pcs) | ||||
| 		return priv->hw_info->mac_select_pcs(config, interface); | ||||
| 
 | ||||
| 	return NULL; | ||||
| } | ||||
| 
 | ||||
| static const struct phylink_mac_ops gswip_phylink_mac_ops = { | ||||
| 	.mac_config	= gswip_phylink_mac_config, | ||||
| 	.mac_link_down	= gswip_phylink_mac_link_down, | ||||
| 	.mac_link_up	= gswip_phylink_mac_link_up, | ||||
| 	.mac_config		= gswip_phylink_mac_config, | ||||
| 	.mac_link_down		= gswip_phylink_mac_link_down, | ||||
| 	.mac_link_up		= gswip_phylink_mac_link_up, | ||||
| 	.mac_select_pcs		= gswip_phylink_mac_select_pcs, | ||||
| }; | ||||
| 
 | ||||
| static const struct dsa_switch_ops gswip_switch_ops = { | ||||
|  |  | |||
|  | @ -4,6 +4,7 @@ | |||
| 
 | ||||
| #include <linux/clk.h> | ||||
| #include <linux/mutex.h> | ||||
| #include <linux/phylink.h> | ||||
| #include <linux/platform_device.h> | ||||
| #include <linux/regmap.h> | ||||
| #include <linux/reset.h> | ||||
|  | @ -237,6 +238,8 @@ struct gswip_hw_info { | |||
| 	enum dsa_tag_protocol tag_protocol; | ||||
| 	void (*phylink_get_caps)(struct dsa_switch *ds, int port, | ||||
| 				 struct phylink_config *config); | ||||
| 	struct phylink_pcs *(*mac_select_pcs)(struct phylink_config *config, | ||||
| 					      phy_interface_t interface); | ||||
| }; | ||||
| 
 | ||||
| struct gswip_gphy_fw { | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 Daniel Golle
						Daniel Golle