diff options
| author | David S. Miller <[email protected]> | 2012-04-14 19:17:54 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2012-04-14 19:17:54 +0000 |
| commit | 7f83560df2b51d41fbc77c7b204b3f5c2ad6765a (patch) | |
| tree | b42dbeaa952ad4846c6f232fc1a8992be8664f5a /drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | |
| parent | tunnel: implement 64 bits statistics (diff) | |
| parent | ixgbe: add I2C clock stretching (diff) | |
| download | kernel-7f83560df2b51d41fbc77c7b204b3f5c2ad6765a.tar.gz kernel-7f83560df2b51d41fbc77c7b204b3f5c2ad6765a.zip | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c')
| -rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c index bf9f82f4b1ae..24117709d6a2 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c @@ -1582,13 +1582,21 @@ static s32 ixgbe_clock_out_i2c_bit(struct ixgbe_hw *hw, bool data) **/ static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl) { - *i2cctl |= IXGBE_I2C_CLK_OUT; + u32 i = 0; + u32 timeout = IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT; + u32 i2cctl_r = 0; - IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl); - IXGBE_WRITE_FLUSH(hw); + for (i = 0; i < timeout; i++) { + *i2cctl |= IXGBE_I2C_CLK_OUT; + IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl); + IXGBE_WRITE_FLUSH(hw); + /* SCL rise time (1000ns) */ + udelay(IXGBE_I2C_T_RISE); - /* SCL rise time (1000ns) */ - udelay(IXGBE_I2C_T_RISE); + i2cctl_r = IXGBE_READ_REG(hw, IXGBE_I2CCTL); + if (i2cctl_r & IXGBE_I2C_CLK_IN) + break; + } } /** |
