forked from mirrors/linux
		
	 1d7b2ce43d
			
		
	
	
		1d7b2ce43d
		
	
	
	
	
		
			
			Fix the build warnings when CONFIG_FSL_ENETC_MDIO is not enabled.
The detailed warnings are shown as follows.
include/linux/fsl/enetc_mdio.h:62:18: warning: no previous prototype for function 'enetc_hw_alloc' [-Wmissing-prototypes]
      62 | struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs)
         |                  ^
include/linux/fsl/enetc_mdio.h:62:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
      62 | struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs)
         | ^
         | static
8 warnings generated.
Fixes: 6517798dd3 ("enetc: Make MDIO accessors more generic and export to include/linux/fsl")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202410102136.jQHZOcS4-lkp@intel.com/
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Claudiu Manoil <claudiu.manoil@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241011030103.392362-1-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
		
	
			
		
			
				
	
	
		
			68 lines
		
	
	
	
		
			2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
			
		
		
	
	
			68 lines
		
	
	
	
		
			2 KiB
		
	
	
	
		
			C
		
	
	
	
	
	
| /* SPDX-License-Identifier: (GPL-2.0+ OR BSD-3-Clause) */
 | |
| /* Copyright 2019 NXP */
 | |
| 
 | |
| #ifndef _FSL_ENETC_MDIO_H_
 | |
| #define _FSL_ENETC_MDIO_H_
 | |
| 
 | |
| #include <linux/phy.h>
 | |
| 
 | |
| /* PCS registers */
 | |
| #define ENETC_PCS_LINK_TIMER1			0x12
 | |
| #define ENETC_PCS_LINK_TIMER1_VAL		0x06a0
 | |
| #define ENETC_PCS_LINK_TIMER2			0x13
 | |
| #define ENETC_PCS_LINK_TIMER2_VAL		0x0003
 | |
| #define ENETC_PCS_IF_MODE			0x14
 | |
| #define ENETC_PCS_IF_MODE_SGMII_EN		BIT(0)
 | |
| #define ENETC_PCS_IF_MODE_USE_SGMII_AN		BIT(1)
 | |
| #define ENETC_PCS_IF_MODE_SGMII_SPEED(x)	(((x) << 2) & GENMASK(3, 2))
 | |
| #define ENETC_PCS_IF_MODE_DUPLEX_HALF		BIT(3)
 | |
| 
 | |
| /* Not a mistake, the SerDes PLL needs to be set at 3.125 GHz by Reset
 | |
|  * Configuration Word (RCW, outside Linux control) for 2.5G SGMII mode. The PCS
 | |
|  * still thinks it's at gigabit.
 | |
|  */
 | |
| enum enetc_pcs_speed {
 | |
| 	ENETC_PCS_SPEED_10	= 0,
 | |
| 	ENETC_PCS_SPEED_100	= 1,
 | |
| 	ENETC_PCS_SPEED_1000	= 2,
 | |
| 	ENETC_PCS_SPEED_2500	= 2,
 | |
| };
 | |
| 
 | |
| struct enetc_hw;
 | |
| 
 | |
| struct enetc_mdio_priv {
 | |
| 	struct enetc_hw *hw;
 | |
| 	int mdio_base;
 | |
| };
 | |
| 
 | |
| #if IS_REACHABLE(CONFIG_FSL_ENETC_MDIO)
 | |
| 
 | |
| int enetc_mdio_read_c22(struct mii_bus *bus, int phy_id, int regnum);
 | |
| int enetc_mdio_write_c22(struct mii_bus *bus, int phy_id, int regnum,
 | |
| 			 u16 value);
 | |
| int enetc_mdio_read_c45(struct mii_bus *bus, int phy_id, int devad, int regnum);
 | |
| int enetc_mdio_write_c45(struct mii_bus *bus, int phy_id, int devad, int regnum,
 | |
| 			 u16 value);
 | |
| struct enetc_hw *enetc_hw_alloc(struct device *dev, void __iomem *port_regs);
 | |
| 
 | |
| #else
 | |
| 
 | |
| static inline int enetc_mdio_read_c22(struct mii_bus *bus, int phy_id,
 | |
| 				      int regnum)
 | |
| { return -EINVAL; }
 | |
| static inline int enetc_mdio_write_c22(struct mii_bus *bus, int phy_id,
 | |
| 				       int regnum, u16 value)
 | |
| { return -EINVAL; }
 | |
| static inline int enetc_mdio_read_c45(struct mii_bus *bus, int phy_id,
 | |
| 				      int devad, int regnum)
 | |
| { return -EINVAL; }
 | |
| static inline int enetc_mdio_write_c45(struct mii_bus *bus, int phy_id,
 | |
| 				       int devad, int regnum, u16 value)
 | |
| { return -EINVAL; }
 | |
| static inline struct enetc_hw *enetc_hw_alloc(struct device *dev,
 | |
| 					      void __iomem *port_regs)
 | |
| { return ERR_PTR(-EINVAL); }
 | |
| 
 | |
| #endif
 | |
| 
 | |
| #endif
 |