Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 287993
b: refs/heads/master
c: b8e3995
h: refs/heads/master
i:
  287991: bb66cca
v: v3
  • Loading branch information
David McKay authored and David S. Miller committed Feb 23, 2012
1 parent 3be9602 commit 626bb88
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03606895cd98c0a628b17324fd7b5ff15db7e3cd
refs/heads/master: b8e3995af4c7da7707b1710332a31f66e06b74dc
24 changes: 18 additions & 6 deletions trunk/drivers/net/phy/icplus.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,24 @@ static int ip175c_config_init(struct phy_device *phydev)

static int ip1xx_reset(struct phy_device *phydev)
{
int err, bmcr;
int bmcr;

/* Software Reset PHY */
bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
bmcr |= BMCR_RESET;
err = phy_write(phydev, MII_BMCR, bmcr);
if (err < 0)
return err;
bmcr = phy_write(phydev, MII_BMCR, bmcr);
if (bmcr < 0)
return bmcr;

do {
bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
} while (bmcr & BMCR_RESET);

return err;
return 0;
}

static int ip1001_config_init(struct phy_device *phydev)
Expand All @@ -124,19 +128,27 @@ static int ip1001_config_init(struct phy_device *phydev)

/* Enable Auto Power Saving mode */
c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);
if (c < 0)
return c;
c |= IP1001_APS_ON;
c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c);
if (c < 0)
return c;

if (phydev->interface == PHY_INTERFACE_MODE_RGMII) {
/* Additional delay (2ns) used to adjust RX clock phase
* at RGMII interface */
c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
if (c < 0)
return c;

c |= IP1001_PHASE_SEL_MASK;
c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
if (c < 0)
return c;
}

return c;
return 0;
}

static int ip101a_config_init(struct phy_device *phydev)
Expand Down

0 comments on commit 626bb88

Please sign in to comment.