net: phy: realtek: Change TX-delay setting for RGMII modes only
[linux-2.6-block.git] / drivers / net / phy / realtek.c
index cfbc0ca61123fee6ab5b9ccdcef5e72154968360..761ce3b1e7bdba4687ef62d8c33151a99e78f5ac 100644 (file)
@@ -161,12 +161,23 @@ static int rtl8211c_config_init(struct phy_device *phydev)
 
 static int rtl8211f_config_init(struct phy_device *phydev)
 {
-       u16 val = 0;
+       u16 val;
 
-       /* enable TX-delay for rgmii-id and rgmii-txid, otherwise disable it */
-       if (phydev->interface == PHY_INTERFACE_MODE_RGMII_ID ||
-           phydev->interface == PHY_INTERFACE_MODE_RGMII_TXID)
+       /* enable TX-delay for rgmii-{id,txid}, and disable it for rgmii and
+        * rgmii-rxid. The RX-delay can be enabled by the external RXDLY pin.
+        */
+       switch (phydev->interface) {
+       case PHY_INTERFACE_MODE_RGMII:
+       case PHY_INTERFACE_MODE_RGMII_RXID:
+               val = 0;
+               break;
+       case PHY_INTERFACE_MODE_RGMII_ID:
+       case PHY_INTERFACE_MODE_RGMII_TXID:
                val = RTL8211F_TX_DELAY;
+               break;
+       default: /* the rest of the modes imply leaving delay as is. */
+               return 0;
+       }
 
        return phy_modify_paged(phydev, 0xd08, 0x11, RTL8211F_TX_DELAY, val);
 }