Lines Matching +full:stop +full:- +full:ack
3 Copyright (c) 2013-2018, Intel Corporation
48 I40E_GLGEN_I2CPARAMS(_hw->func_caps.mdio_port_num)
50 /* I2C bit-banging functions */
67 * ixl_i2c_bus_clear - Clears the I2C bus
76 struct i40e_hw *hw = &pf->hw; in ixl_i2c_bus_clear()
105 * ixl_i2c_stop - Sets I2C stop condition
108 * Sets I2C stop condition (Low -> High on SDA while SCL is High)
113 struct i40e_hw *hw = &pf->hw; in ixl_i2c_stop()
118 /* Stop condition must begin with data low and clock high */ in ixl_i2c_stop()
122 /* Setup time for stop condition (4us) */ in ixl_i2c_stop()
127 /* bus free time between stop and start (4.7us)*/ in ixl_i2c_stop()
132 * ixl_clock_in_i2c_byte - Clocks in one byte via I2C
146 for (i = 7; i >= 0; i--) { in ixl_clock_in_i2c_byte()
155 * ixl_clock_in_i2c_bit - Clocks in one bit via I2C data/clock
164 struct i40e_hw *hw = &pf->hw; in ixl_clock_in_i2c_bit()
191 * ixl_get_i2c_ack - Polls for I2C ACK
199 struct i40e_hw *hw = &pf->hw; in ixl_get_i2c_ack()
204 bool ack = 1; in ixl_get_i2c_ack() local
216 /* Poll for ACK. Note that ACK in I2C spec is in ixl_get_i2c_ack()
220 ack = ixl_get_i2c_data(pf, &i2cctl); in ixl_get_i2c_ack()
223 if (!ack) in ixl_get_i2c_ack()
227 if (ack) { in ixl_get_i2c_ack()
228 ixl_dbg(pf, IXL_DBG_I2C, "I2C ack was not received.\n"); in ixl_get_i2c_ack()
241 * ixl_clock_out_i2c_bit - Clocks in/out one bit via I2C data/clock
250 struct i40e_hw *hw = &pf->hw; in ixl_clock_out_i2c_bit()
276 * ixl_clock_out_i2c_byte - Clocks out one byte via I2C
285 struct i40e_hw *hw = &pf->hw; in ixl_clock_out_i2c_byte()
293 for (i = 7; i >= 0; i--) { in ixl_clock_out_i2c_byte()
312 * ixl_lower_i2c_clk - Lowers the I2C SCL clock
316 * Lowers the I2C clock line '1'->'0'
321 struct i40e_hw *hw = &pf->hw; in ixl_lower_i2c_clk()
334 * ixl_raise_i2c_clk - Raises the I2C SCL clock
338 * Raises the I2C clock line '0'->'1'
343 struct i40e_hw *hw = &pf->hw; in ixl_raise_i2c_clk()
364 * ixl_get_i2c_data - Reads the I2C SDA data bit
384 * ixl_set_i2c_data - Sets the I2C data bit
394 struct i40e_hw *hw = &pf->hw; in ixl_set_i2c_data()
408 /* Data rise/fall (1000ns/300ns) and set-up time (250ns) */ in ixl_set_i2c_data()
415 ixl_dbg(pf, IXL_DBG_I2C, "Error - I2C data was not set to %X.\n", data); in ixl_set_i2c_data()
422 * ixl_i2c_start - Sets I2C start condition
423 * Sets I2C start condition (High -> Low on SDA while SCL is High)
428 struct i40e_hw *hw = &pf->hw; in ixl_i2c_start()
453 * ixl_read_i2c_byte_bb - Reads 8 bit word over I2C
459 struct i40e_hw *hw = &pf->hw; in ixl_read_i2c_byte_bb()
483 ixl_dbg(pf, IXL_DBG_I2C, "dev_addr i2c ack error\n"); in ixl_read_i2c_byte_bb()
495 ixl_dbg(pf, IXL_DBG_I2C, "byte_offset i2c ack error\n"); in ixl_read_i2c_byte_bb()
527 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte read error - Retrying\n"); in ixl_read_i2c_byte_bb()
542 * ixl_write_i2c_byte_bb - Writes 8 bit word over I2C
548 struct i40e_hw *hw = &pf->hw; in ixl_write_i2c_byte_bb()
593 ixl_dbg(pf, IXL_DBG_I2C, "I2C byte write error - Retrying\n"); in ixl_write_i2c_byte_bb()
608 * ixl_read_i2c_byte_reg - Reads 8 bit word over I2C using a hardware register
614 struct i40e_hw *hw = &pf->hw; in ixl_read_i2c_byte_reg()
622 wr32(hw, I40E_GLGEN_I2CCMD(hw->func_caps.mdio_port_num), reg); in ixl_read_i2c_byte_reg()
624 status = ixl_wait_for_i2c_completion(hw, hw->func_caps.mdio_port_num); in ixl_read_i2c_byte_reg()
627 reg = rd32(hw, I40E_GLGEN_I2CCMD(hw->func_caps.mdio_port_num)); in ixl_read_i2c_byte_reg()
638 * ixl_write_i2c_byte_reg - Writes 8 bit word over I2C using a hardware register
644 struct i40e_hw *hw = &pf->hw; in ixl_write_i2c_byte_reg()
652 reg = rd32(hw, I40E_GLGEN_I2CCMD(hw->func_caps.mdio_port_num)); in ixl_write_i2c_byte_reg()
663 /* Write command to registers controlling I2C - data and address. */ in ixl_write_i2c_byte_reg()
664 wr32(hw, I40E_GLGEN_I2CCMD(hw->func_caps.mdio_port_num), reg); in ixl_write_i2c_byte_reg()
666 status = ixl_wait_for_i2c_completion(hw, hw->func_caps.mdio_port_num); in ixl_write_i2c_byte_reg()
687 } while (timeout-- > 0); in ixl_wait_for_i2c_completion()
696 * ixl_read_i2c_byte_aq - Reads 8 bit word over I2C using an AQ command
702 struct i40e_hw *hw = &pf->hw; in ixl_read_i2c_byte_aq()
714 i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_read_i2c_byte_aq()
722 * ixl_write_i2c_byte_aq - Writes 8 bit word over I2C using an AQ command
728 struct i40e_hw *hw = &pf->hw; in ixl_write_i2c_byte_aq()
739 i40e_stat_str(hw, status), i40e_aq_str(hw, hw->aq.asq_last_status)); in ixl_write_i2c_byte_aq()