Lines Matching +full:stop +full:- +full:ack
3 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
16 * - Redistributions of source code must retain the above
20 * - Redistributions in binary form must reproduce the above
43 * Originally written for a not-quite-i2c serial eeprom, which is
45 * variety of other uses, most board-specific, so the bit-boffing
47 * have been moved to chip-specific files.
59 * i2c_wait_for_writes - wait for a write
74 dd->f_gpio_mod(dd, 0, 0, 0); in i2c_wait_for_writes()
84 /* BUF_WAIT is time bus must be free between STOP or ACK and to next START.
95 mask = 1UL << dd->gpio_scl_num; in scl_out()
97 /* SCL is meant to be bare-drain, so never set "OUT", just DIR */ in scl_out()
98 dd->f_gpio_mod(dd, 0, bit ? 0 : mask, mask); in scl_out()
109 for (rise_usec = SCL_WAIT_USEC; rise_usec > 0; rise_usec -= 2) { in scl_out()
110 if (mask & dd->f_gpio_mod(dd, 0, 0, 0)) in scl_out()
125 mask = 1UL << dd->gpio_sda_num; in sda_out()
127 /* SDA is meant to be bare-drain, so never set "OUT", just DIR */ in sda_out()
128 dd->f_gpio_mod(dd, 0, bit ? 0 : mask, mask); in sda_out()
139 bnum = dd->gpio_sda_num; in sda_in()
141 /* SDA is meant to be bare-drain, so never set "OUT", just DIR */ in sda_in()
142 dd->f_gpio_mod(dd, 0, 0, mask); in sda_in()
143 read_val = dd->f_gpio_mod(dd, 0, 0, 0); in sda_in()
150 * i2c_ackrcv - see if ack following write is true
169 * rd_byte - read a byte, sending STOP on last, else ACK
181 for (bit_cntr = 7; bit_cntr >= 0; --bit_cntr) { in rd_byte()
200 * wr_byte - write a byte, one bit at a time
204 * Returns 0 if we got the following ack, otherwise 1
211 for (bit_cntr = 7; bit_cntr >= 0; bit_cntr--) { in wr_byte()
234 * stop_seq - transmit the stop sequence
248 * stop_cmd - transmit the stop condition
260 * qib_twsi_reset - reset I2C communication
273 mask = (1UL << dd->gpio_scl_num) | (1UL << dd->gpio_sda_num); in qib_twsi_reset()
277 * This is the default power-on state with out=0 and dir=0, in qib_twsi_reset()
278 * So tri-stated and should be floating high (barring HW problems) in qib_twsi_reset()
280 dd->f_gpio_mod(dd, 0, 0, mask); in qib_twsi_reset()
285 * One vendor recommends then issuing START followed by STOP. in qib_twsi_reset()
290 * So our START and STOP take place with SCL held high. in qib_twsi_reset()
292 while (clock_cycles_left--) { in qib_twsi_reset()
302 * Issue START, STOP, pause for T_BUF. in qib_twsi_reset()
305 pins = dd->f_gpio_mod(dd, 0, 0, 0); in qib_twsi_reset()
313 /* At this point, SCL is high, SDA low. Raise SDA for STOP */ in qib_twsi_reset()
325 * STOP.
326 * returns 0 if OK (ACK received), else != 0
342 /* Added functionality for IBA7220-based cards */
353 * this driver, the device is followed by a one-byte "address" which selects
366 /* legacy not-really-I2C */ in qib_twsi_blk_rd()
378 * SFF spec claims we do _not_ stop after the addr in qib_twsi_blk_rd()
379 * but simply issue a start with the "read" dev-addr. in qib_twsi_blk_rd()
380 * Since we are implicitely waiting for ACK here, in qib_twsi_blk_rd()
382 * and cannot rely on the delay built in to the STOP in qib_twsi_blk_rd()
403 * block devices keeps clocking data out as long as we ack, in qib_twsi_blk_rd()
409 while (len-- > 0) { in qib_twsi_blk_rd()
411 * Get and store data, sending ACK if length remaining, in qib_twsi_blk_rd()
412 * else STOP in qib_twsi_blk_rd()
431 * this driver, the device is followed by a one-byte "address" which selects
464 len -= sub_len; in qib_twsi_blk_wr()
476 * The startcmd for the read will fail the ack until in qib_twsi_blk_wr()
486 if (!--max_wait_time) in qib_twsi_blk_wr()