xref: /OK3568_Linux_fs/kernel/drivers/net/ethernet/stmicro/stmmac/dwmac-rk-tool.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2 /*
3  * Copyright (c) 2020 Fuzhou Rockchip Electronics Co., Ltd
4  */
5 
6 #ifndef __DWMAC_RK_TOOL_H__
7 #define __DWMAC_RK_TOOL_H__
8 
9 #include <linux/phy.h>
10 #include "stmmac.h"
11 
12 void dwmac_rk_set_rgmii_delayline(struct stmmac_priv *priv, int tx_delay, int rx_delay);
13 void dwmac_rk_get_rgmii_delayline(struct stmmac_priv *priv, int *tx_delay, int *rx_delay);
14 int dwmac_rk_get_phy_interface(struct stmmac_priv *priv);
15 
16 #ifdef CONFIG_DWMAC_ROCKCHIP_TOOL
17 int dwmac_rk_create_loopback_sysfs(struct device *dev);
18 int dwmac_rk_remove_loopback_sysfs(struct device *device);
19 #else
dwmac_rk_create_loopback_sysfs(struct device * dev)20 static inline int dwmac_rk_create_loopback_sysfs(struct device *dev)
21 {
22 	return 0;
23 }
24 
dwmac_rk_remove_loopback_sysfs(struct device * device)25 static inline int dwmac_rk_remove_loopback_sysfs(struct device *device)
26 {
27 	return 0;
28 }
29 #endif
30 
31 #ifdef CONFIG_DWMAC_RK_AUTO_DELAYLINE
32 int dwmac_rk_get_rgmii_delayline_from_vendor(struct stmmac_priv *priv);
33 int dwmac_rk_search_rgmii_delayline(struct stmmac_priv *priv);
34 #endif
35 
36 #endif /* __DWMAC_RK_TOOL_H__ */
37 
38