Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300744
b: refs/heads/master
c: 8f56e4b
h: refs/heads/master
v: v3
  • Loading branch information
Don Skidmore authored and Jeff Kirsher committed Apr 14, 2012
1 parent c23fd0b commit fb2026d
Show file tree
Hide file tree
Showing 3 changed files with 16 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: be0c0068140dea329d151be58b8fdd9fa22301ca
refs/heads/master: 8f56e4b9ab72109c5bf6d3e32ff43321a3ba4386
20 changes: 14 additions & 6 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

IXGBE_WRITE_REG(hw, IXGBE_I2CCTL, *i2cctl);
IXGBE_WRITE_FLUSH(hw);
u32 i = 0;
u32 timeout = IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT;
u32 i2cctl_r = 0;

/* SCL rise time (1000ns) */
udelay(IXGBE_I2C_T_RISE);
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);

i2cctl_r = IXGBE_READ_REG(hw, IXGBE_I2CCTL);
if (i2cctl_r & IXGBE_I2C_CLK_IN)
break;
}
}

/**
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
#define IXGBE_I2C_CLK_OUT 0x00000002
#define IXGBE_I2C_DATA_IN 0x00000004
#define IXGBE_I2C_DATA_OUT 0x00000008
#define IXGBE_I2C_CLOCK_STRETCHING_TIMEOUT 500

/* Interrupt Registers */
#define IXGBE_EICR 0x00800
Expand Down

0 comments on commit fb2026d

Please sign in to comment.