diff options
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c | 20 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 1 |
2 files changed, 15 insertions, 6 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) | |||
1582 | **/ | 1582 | **/ |
1583 | static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl) | 1583 | static void ixgbe_raise_i2c_clk(struct ixgbe_hw *hw, u32 *i2cctl) |
1584 | { | 1584 | { |
1585 | *i2cctl |= IXGBE_I2C_CLK_OUT; | 1585 | u32 i = 0; |
1586 | 1586 | u32 timeout = IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT; | |
1587 | IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl); | 1587 | u32 i2cctl_r = 0; |
1588 | IXGBE_WRITE_FLUSH(hw); | ||
1589 | 1588 | ||
1590 | /* SCL rise time (1000ns) */ | 1589 | for (i = 0; i < timeout; i++) { |
1591 | udelay(IXGBE_I2C_T_RISE); | 1590 | *i2cctl |= IXGBE_I2C_CLK_OUT; |
1591 | IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl); | ||
1592 | IXGBE_WRITE_FLUSH(hw); | ||
1593 | /* SCL rise time (1000ns) */ | ||
1594 | udelay(IXGBE_I2C_T_RISE); | ||
1595 | |||
1596 | i2cctl_r = IXGBE_READ_REG(hw, IXGBE_I2CCTL); | ||
1597 | if (i2cctl_r & IXGBE_I2C_CLK_IN) | ||
1598 | break; | ||
1599 | } | ||
1592 | } | 1600 | } |
1593 | 1601 | ||
1594 | /** | 1602 | /** |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h index ffa6679e943b..4acd9e665b28 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | |||
@@ -110,6 +110,7 @@ | |||
110 | #define IXGBE_I2C_CLK_OUT 0x00000002 | 110 | #define IXGBE_I2C_CLK_OUT 0x00000002 |
111 | #define IXGBE_I2C_DATA_IN 0x00000004 | 111 | #define IXGBE_I2C_DATA_IN 0x00000004 |
112 | #define IXGBE_I2C_DATA_OUT 0x00000008 | 112 | #define IXGBE_I2C_DATA_OUT 0x00000008 |
113 | #define IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT 500 | ||
113 | 114 | ||
114 | /* Interrupt Registers */ | 115 | /* Interrupt Registers */ |
115 | #define IXGBE_EICR 0x00800 | 116 | #define IXGBE_EICR 0x00800 |