Lines Matching refs:pf

51 static s32	ixl_set_i2c_data(struct ixl_pf *pf, u32 *i2cctl, bool data);
52 static bool ixl_get_i2c_data(struct ixl_pf *pf, u32 *i2cctl);
53 static void ixl_raise_i2c_clk(struct ixl_pf *pf, u32 *i2cctl);
54 static void ixl_lower_i2c_clk(struct ixl_pf *pf, u32 *i2cctl);
55 static s32 ixl_clock_out_i2c_bit(struct ixl_pf *pf, bool data);
56 static s32 ixl_get_i2c_ack(struct ixl_pf *pf);
57 static s32 ixl_clock_out_i2c_byte(struct ixl_pf *pf, u8 data);
58 static s32 ixl_clock_in_i2c_bit(struct ixl_pf *pf, bool *data);
59 static s32 ixl_clock_in_i2c_byte(struct ixl_pf *pf, u8 *data);
60 static void ixl_i2c_bus_clear(struct ixl_pf *pf);
61 static void ixl_i2c_start(struct ixl_pf *pf);
62 static void ixl_i2c_stop(struct ixl_pf *pf);
74 ixl_i2c_bus_clear(struct ixl_pf *pf)
76 struct i40e_hw *hw = &pf->hw;
82 ixl_i2c_start(pf);
84 ixl_set_i2c_data(pf, &i2cctl, 1);
87 ixl_raise_i2c_clk(pf, &i2cctl);
92 ixl_lower_i2c_clk(pf, &i2cctl);
98 ixl_i2c_start(pf);
101 ixl_i2c_stop(pf);
111 ixl_i2c_stop(struct ixl_pf *pf)
113 struct i40e_hw *hw = &pf->hw;
119 ixl_set_i2c_data(pf, &i2cctl, 0);
120 ixl_raise_i2c_clk(pf, &i2cctl);
125 ixl_set_i2c_data(pf, &i2cctl, 1);
139 ixl_clock_in_i2c_byte(struct ixl_pf *pf, u8 *data)
147 ixl_clock_in_i2c_bit(pf, &bit);
162 ixl_clock_in_i2c_bit(struct ixl_pf *pf, bool *data)
164 struct i40e_hw *hw = &pf->hw;
169 ixl_raise_i2c_clk(pf, &i2cctl);
180 *data = ixl_get_i2c_data(pf, &i2cctl);
182 ixl_lower_i2c_clk(pf, &i2cctl);
197 ixl_get_i2c_ack(struct ixl_pf *pf)
199 struct i40e_hw *hw = &pf->hw;
206 ixl_raise_i2c_clk(pf, &i2cctl);
220 ack = ixl_get_i2c_data(pf, &i2cctl);
228 ixl_dbg(pf, IXL_DBG_I2C, "I2C ack was not received.\n");
232 ixl_lower_i2c_clk(pf, &i2cctl);
248 ixl_clock_out_i2c_bit(struct ixl_pf *pf, bool data)
250 struct i40e_hw *hw = &pf->hw;
254 status = ixl_set_i2c_data(pf, &i2cctl, data);
256 ixl_raise_i2c_clk(pf, &i2cctl);
261 ixl_lower_i2c_clk(pf, &i2cctl);
269 ixl_dbg(pf, IXL_DBG_I2C, "I2C data was not set to %#x\n", data);
283 ixl_clock_out_i2c_byte(struct ixl_pf *pf, u8 data)
285 struct i40e_hw *hw = &pf->hw;
295 status = ixl_clock_out_i2c_bit(pf, bit);
319 ixl_lower_i2c_clk(struct ixl_pf *pf, u32 *i2cctl)
321 struct i40e_hw *hw = &pf->hw;
341 ixl_raise_i2c_clk(struct ixl_pf *pf, u32 *i2cctl)
343 struct i40e_hw *hw = &pf->hw;
371 ixl_get_i2c_data(struct ixl_pf *pf, u32 *i2cctl)
392 ixl_set_i2c_data(struct ixl_pf *pf, u32 *i2cctl, bool data)
394 struct i40e_hw *hw = &pf->hw;
413 if (data != ixl_get_i2c_data(pf, i2cctl)) {
415 ixl_dbg(pf, IXL_DBG_I2C, "Error - I2C data was not set to %X.\n", data);
426 ixl_i2c_start(struct ixl_pf *pf)
428 struct i40e_hw *hw = &pf->hw;
434 ixl_set_i2c_data(pf, &i2cctl, 1);
435 ixl_raise_i2c_clk(pf, &i2cctl);
440 ixl_set_i2c_data(pf, &i2cctl, 0);
445 ixl_lower_i2c_clk(pf, &i2cctl);
456 ixl_read_i2c_byte_bb(struct ixl_pf *pf, u8 byte_offset,
459 struct i40e_hw *hw = &pf->hw;
472 ixl_i2c_start(pf);
475 status = ixl_clock_out_i2c_byte(pf, dev_addr);
477 ixl_dbg(pf, IXL_DBG_I2C, "dev_addr clock out error\n");
481 status = ixl_get_i2c_ack(pf);
483 ixl_dbg(pf, IXL_DBG_I2C, "dev_addr i2c ack error\n");
487 status = ixl_clock_out_i2c_byte(pf, byte_offset);
489 ixl_dbg(pf, IXL_DBG_I2C, "byte_offset clock out error\n");
493 status = ixl_get_i2c_ack(pf);
495 ixl_dbg(pf, IXL_DBG_I2C, "byte_offset i2c ack error\n");
499 ixl_i2c_start(pf);
502 status = ixl_clock_out_i2c_byte(pf, (dev_addr | 0x1));
506 status = ixl_get_i2c_ack(pf);
510 status = ixl_clock_in_i2c_byte(pf, data);
514 status = ixl_clock_out_i2c_bit(pf, nack);
518 ixl_i2c_stop(pf);
523 ixl_i2c_bus_clear(pf);
527 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte read error - Retrying\n");
529 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte read error\n");
545 ixl_write_i2c_byte_bb(struct ixl_pf *pf, u8 byte_offset,
548 struct i40e_hw *hw = &pf->hw;
559 ixl_i2c_start(pf);
561 status = ixl_clock_out_i2c_byte(pf, dev_addr);
565 status = ixl_get_i2c_ack(pf);
569 status = ixl_clock_out_i2c_byte(pf, byte_offset);
573 status = ixl_get_i2c_ack(pf);
577 status = ixl_clock_out_i2c_byte(pf, data);
581 status = ixl_get_i2c_ack(pf);
585 ixl_i2c_stop(pf);
589 ixl_i2c_bus_clear(pf);
593 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte write error - Retrying\n");
595 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte write error\n");
611 ixl_read_i2c_byte_reg(struct ixl_pf *pf, u8 byte_offset,
614 struct i40e_hw *hw = &pf->hw;
633 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte read error\n");
641 ixl_write_i2c_byte_reg(struct ixl_pf *pf, u8 byte_offset,
644 struct i40e_hw *hw = &pf->hw;
650 status = ixl_read_i2c_byte_reg(pf, byte_offset + 1, dev_addr, &upperbyte);
669 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte write error\n");
699 ixl_read_i2c_byte_aq(struct ixl_pf *pf, u8 byte_offset,
702 struct i40e_hw *hw = &pf->hw;
713 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte read status %s, error %s\n",
725 ixl_write_i2c_byte_aq(struct ixl_pf *pf, u8 byte_offset,
728 struct i40e_hw *hw = &pf->hw;
738 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte write status %s, error %s\n",