mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-16 08:44:21 +08:00
net: phy: at803x: Disable phy delay for RGMII mode
For RGMII mode, phy delay should be disabled. Add this case along with disable delay routines. Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
83c177aea4
commit
cd28d1d6e5
@ -110,16 +110,16 @@ static int at803x_debug_reg_mask(struct phy_device *phydev, u16 reg,
|
||||
return phy_write(phydev, AT803X_DEBUG_DATA, val);
|
||||
}
|
||||
|
||||
static inline int at803x_enable_rx_delay(struct phy_device *phydev)
|
||||
static inline int at803x_disable_rx_delay(struct phy_device *phydev)
|
||||
{
|
||||
return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0, 0,
|
||||
AT803X_DEBUG_RX_CLK_DLY_EN);
|
||||
return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_0,
|
||||
AT803X_DEBUG_RX_CLK_DLY_EN, 0);
|
||||
}
|
||||
|
||||
static inline int at803x_enable_tx_delay(struct phy_device *phydev)
|
||||
static inline int at803x_disable_tx_delay(struct phy_device *phydev)
|
||||
{
|
||||
return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5, 0,
|
||||
AT803X_DEBUG_TX_CLK_DLY_EN);
|
||||
return at803x_debug_reg_mask(phydev, AT803X_DEBUG_REG_5,
|
||||
AT803X_DEBUG_TX_CLK_DLY_EN, 0);
|
||||
}
|
||||
|
||||
/* save relevant PHY registers to private copy */
|
||||
@ -256,15 +256,17 @@ static int at803x_config_init(struct phy_device *phydev)
|
||||
return ret;
|
||||
|
||||
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_RXID ||
|
||||
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
|
||||
ret = at803x_enable_rx_delay(phydev);
|
||||
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
|
||||
phydev->interface == PHY_INTERFACE_MODE_RGMII) {
|
||||
ret = at803x_disable_rx_delay(phydev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID ||
|
||||
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID) {
|
||||
ret = at803x_enable_tx_delay(phydev);
|
||||
phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
|
||||
phydev->interface == PHY_INTERFACE_MODE_RGMII) {
|
||||
ret = at803x_disable_tx_delay(phydev);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user