kernel: bump 3.18 to 3.18.128
[openwrt/staging/chunkeey.git] / target / linux / generic / pending-3.18 / 002-phy_drivers_backport.patch
index c97c759e7ee82ac1002c0ac5f7c7b3f6ca63edad..e2ca05384a5f375baec93604158efd4951b94d5b 100644 (file)
@@ -1,6 +1,6 @@
 --- a/drivers/net/phy/adm6996.c
 +++ b/drivers/net/phy/adm6996.c
-@@ -287,7 +287,7 @@ static u16
+@@ -289,7 +289,7 @@ static u16
  adm6996_read_mii_reg(struct adm6996_priv *priv, enum admreg reg)
  {
        struct phy_device *phydev = priv->priv;
@@ -9,7 +9,7 @@
  
        return bus->read(bus, PHYADDR(reg));
  }
-@@ -296,7 +296,7 @@ static void
+@@ -298,7 +298,7 @@ static void
  adm6996_write_mii_reg(struct adm6996_priv *priv, enum admreg reg, u16 val)
  {
        struct phy_device *phydev = priv->priv;
@@ -18,7 +18,7 @@
  
        bus->write(bus, PHYADDR(reg), val);
  }
-@@ -1019,13 +1019,13 @@ static int adm6996_config_init(struct ph
+@@ -1050,13 +1050,13 @@ static int adm6996_config_init(struct ph
        pdev->supported = ADVERTISED_100baseT_Full;
        pdev->advertising = ADVERTISED_100baseT_Full;
  
@@ -35,7 +35,7 @@
        if (!priv)
                return -ENOMEM;
  
-@@ -1045,7 +1045,7 @@ static int adm6996_config_init(struct ph
+@@ -1076,7 +1076,7 @@ static int adm6996_config_init(struct ph
  }
  
  /*
@@ -44,7 +44,7 @@
   */
  static int adm6996_read_status(struct phy_device *phydev)
  {
-@@ -1061,7 +1061,7 @@ static int adm6996_read_status(struct ph
+@@ -1092,7 +1092,7 @@ static int adm6996_read_status(struct ph
  }
  
  /*
@@ -53,7 +53,7 @@
   */
  static int adm6996_config_aneg(struct phy_device *phydev)
  {
-@@ -1070,11 +1070,11 @@ static int adm6996_config_aneg(struct ph
+@@ -1101,11 +1101,11 @@ static int adm6996_config_aneg(struct ph
  
  static int adm6996_fixup(struct phy_device *dev)
  {
@@ -67,7 +67,7 @@
                return 0;
  
        /* look for the switch on the bus */
-@@ -1121,6 +1121,7 @@ static struct phy_driver adm6996_phy_dri
+@@ -1152,6 +1152,7 @@ static struct phy_driver adm6996_phy_dri
        .config_aneg    = &adm6996_config_aneg,
        .read_status    = &adm6996_read_status,
        .soft_reset     = adm6996_soft_reset,
@@ -75,7 +75,7 @@
  };
  
  static int adm6996_gpio_probe(struct platform_device *pdev)
-@@ -1193,7 +1194,7 @@ static int __init adm6996_init(void)
+@@ -1220,7 +1221,7 @@ static int __init adm6996_init(void)
        int err;
  
        phy_register_fixup_for_id(PHY_ANY_ID, adm6996_fixup);
@@ -95,7 +95,7 @@
        ret |= BMCR_ANENABLE | BMCR_ANRESTART;
        return phy_write(phydev, MII_BMCR, ret);
  }
-@@ -1996,7 +1996,7 @@ ar8xxx_phy_config_init(struct phy_device
+@@ -2021,7 +2021,7 @@ ar8xxx_phy_config_init(struct phy_device
  
        priv->phy = phydev;
  
                if (chip_is_ar8316(priv)) {
                        /* switch device has been initialized, reinit */
                        priv->dev.ports = (AR8216_NUM_PORTS - 1);
-@@ -2044,7 +2044,7 @@ ar8xxx_check_link_states(struct ar8xxx_p
+@@ -2069,7 +2069,7 @@ ar8xxx_check_link_states(struct ar8xxx_p
                /* flush ARL entries for this port if it went down*/
                if (!link_new)
                        priv->chip->atu_flush_port(priv, i);
                         i, link_new ? "up" : "down");
        }
  
-@@ -2063,10 +2063,10 @@ ar8xxx_phy_read_status(struct phy_device
+@@ -2088,10 +2088,10 @@ ar8xxx_phy_read_status(struct phy_device
        if (phydev->state == PHY_CHANGELINK)
                ar8xxx_check_link_states(priv);
  
        phydev->link = !!link.link;
        if (!phydev->link)
                return 0;
-@@ -2096,7 +2096,7 @@ ar8xxx_phy_read_status(struct phy_device
+@@ -2122,7 +2122,7 @@ ar8xxx_phy_read_status(struct phy_device
  static int
  ar8xxx_phy_config_aneg(struct phy_device *phydev)
  {
                return 0;
  
        return genphy_config_aneg(phydev);
-@@ -2151,15 +2151,15 @@ ar8xxx_phy_probe(struct phy_device *phyd
+@@ -2177,15 +2177,15 @@ ar8xxx_phy_probe(struct phy_device *phyd
        int ret;
  
        /* skip PHYs at unused adresses */
--      if (phydev->mdio.addr != 0 && phydev->mdio.addr != 4)
-+      if (phydev->addr != 0 && phydev->addr != 4)
+-      if (phydev->mdio.addr != 0 && phydev->mdio.addr != 3 && phydev->mdio.addr != 4)
++      if (phydev->addr != 0 && phydev->addr != 3 && phydev->addr != 4)
                return -ENODEV;
  
 -      if (!ar8xxx_is_possible(phydev->mdio.bus))
                        goto found;
  
        priv = ar8xxx_create();
-@@ -2168,7 +2168,7 @@ ar8xxx_phy_probe(struct phy_device *phyd
+@@ -2194,7 +2194,7 @@ ar8xxx_phy_probe(struct phy_device *phyd
                goto unlock;
        }
  
  
        ret = ar8xxx_probe_switch(priv);
        if (ret)
-@@ -2189,7 +2189,7 @@ ar8xxx_phy_probe(struct phy_device *phyd
+@@ -2215,7 +2215,7 @@ ar8xxx_phy_probe(struct phy_device *phyd
  found:
        priv->use_count++;
  
                if (ar8xxx_has_gige(priv)) {
                        phydev->supported = SUPPORTED_1000baseT_Full;
                        phydev->advertising = ADVERTISED_1000baseT_Full;
-@@ -2277,21 +2277,33 @@ ar8xxx_phy_soft_reset(struct phy_device
+@@ -2305,21 +2305,33 @@ ar8xxx_phy_soft_reset(struct phy_device
        return 0;
  }
  
  MODULE_LICENSE("GPL");
 --- a/drivers/net/phy/ar8327.c
 +++ b/drivers/net/phy/ar8327.c
-@@ -619,11 +619,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv)
+@@ -662,11 +662,11 @@ ar8327_hw_init(struct ar8xxx_priv *priv)
        if (!priv->chip_data)
                return -ENOMEM;
  
  }
  
  
-@@ -392,13 +388,12 @@ mvswitch_probe(struct phy_device *pdev)
+@@ -398,13 +394,12 @@ mvswitch_probe(struct phy_device *pdev)
  static int
  mvswitch_fixup(struct phy_device *dev)
  {
        if (reg != MV_IDENT_VALUE)
                return 0;
  
-@@ -418,13 +413,14 @@ static struct phy_driver mvswitch_driver
-       .config_init    = &mvswitch_config_init,
+@@ -425,13 +420,14 @@ static struct phy_driver mvswitch_driver
        .config_aneg    = &mvswitch_config_aneg,
+       .aneg_done      = &mvswitch_aneg_done,
        .read_status    = &mvswitch_read_status,
 +      .driver         = { .owner = THIS_MODULE,},
  };
  module_init(psb6970_init);
 --- a/drivers/net/phy/rtl8306.c
 +++ b/drivers/net/phy/rtl8306.c
-@@ -872,7 +872,7 @@ rtl8306_config_init(struct phy_device *p
+@@ -877,7 +877,7 @@ rtl8306_config_init(struct phy_device *p
        int err;
  
        /* Only init the switch for the primary PHY */
                return 0;
  
        val.value.i = 1;
-@@ -882,7 +882,7 @@ rtl8306_config_init(struct phy_device *p
+@@ -887,7 +887,7 @@ rtl8306_config_init(struct phy_device *p
        priv->dev.ops = &rtl8306_ops;
        priv->do_cpu = 0;
        priv->page = -1;
  
        chipid = rtl_get(dev, RTL_REG_CHIPID);
        chipver = rtl_get(dev, RTL_REG_CHIPVER);
-@@ -928,13 +928,13 @@ rtl8306_fixup(struct phy_device *pdev)
+@@ -933,13 +933,13 @@ rtl8306_fixup(struct phy_device *pdev)
        u16 chipid;
  
        /* Attach to primary LAN port and WAN port */
        chipid = rtl_get(&priv.dev, RTL_REG_CHIPID);
        if (chipid == 0x5988)
                pdev->phy_id = RTL8306_MAGIC;
-@@ -952,14 +952,14 @@ rtl8306_probe(struct phy_device *pdev)
+@@ -957,14 +957,14 @@ rtl8306_probe(struct phy_device *pdev)
                 * share one rtl_priv instance between virtual phy
                 * devices on the same bus
                 */
  
  found:
        pdev->priv = priv;
-@@ -980,7 +980,7 @@ rtl8306_config_aneg(struct phy_device *p
+@@ -985,7 +985,7 @@ rtl8306_config_aneg(struct phy_device *p
        struct rtl_priv *priv = pdev->priv;
  
        /* Only for WAN */
                return 0;
  
        /* Restart autonegotiation */
-@@ -996,7 +996,7 @@ rtl8306_read_status(struct phy_device *p
+@@ -1001,7 +1001,7 @@ rtl8306_read_status(struct phy_device *p
        struct rtl_priv *priv = pdev->priv;
        struct switch_dev *dev = &priv->dev;
  
                /* WAN */
                pdev->speed = rtl_get(dev, RTL_PORT_REG(4, SPEED)) ? SPEED_100 : SPEED_10;
                pdev->duplex = rtl_get(dev, RTL_PORT_REG(4, DUPLEX)) ? DUPLEX_FULL : DUPLEX_HALF;
-@@ -1037,6 +1037,7 @@ static struct phy_driver rtl8306_driver
+@@ -1044,6 +1044,7 @@ static struct phy_driver rtl8306_driver
        .config_init    = &rtl8306_config_init,
        .config_aneg    = &rtl8306_config_aneg,
        .read_status    = &rtl8306_read_status,
  };
  
  
-@@ -1044,7 +1045,7 @@ static int __init
+@@ -1051,7 +1052,7 @@ static int __init
  rtl_init(void)
  {
        phy_register_fixup_for_id(PHY_ANY_ID, rtl8306_fixup);