net: phy: at803x: Disable phy delay for RGMII mode
authorVinod Koul <vkoul@kernel.org>
Mon, 21 Jan 2019 09:13:17 +0000 (14:43 +0530)
committerDavid S. Miller <davem@davemloft.net>
Wed, 23 Jan 2019 03:37:59 +0000 (19:37 -0800)
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>
drivers/net/phy/at803x.c

index f9432d053a22a71916eba970deb9a7b358bd83e2..8ff12938ab476e295c5e46f020a55ae78580facb 100644 (file)
@@ -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;
        }