Skip to content

Commit

Permalink
i2c-pnx: Add stop conditions for end of transfer
Browse files Browse the repository at this point in the history
Add a stop condition bit flag to the last byte in the transfer.
This will generate an extra clock to handle the stop condition
and prevent devices from staying in an ACK'd state.

Signed-off-by: Kevin Wells <wellsk40@gmail.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
  • Loading branch information
Kevin Wells authored and Ben Dooks committed Apr 20, 2010
1 parent be80dba commit 28ad332
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/i2c/busses/i2c-pnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ static int i2c_pnx_master_xmit(struct i2c_pnx_algo_data *alg_data)
/* We still have something to talk about... */
val = *alg_data->mif.buf++;

if (alg_data->mif.len == 1)
val |= stop_bit;

alg_data->mif.len--;
iowrite32(val, I2C_REG_TX(alg_data));

Expand Down Expand Up @@ -246,6 +249,9 @@ static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data)
__func__);

if (alg_data->mif.len == 1) {
/* Last byte, do not acknowledge next rcv. */
val |= stop_bit;

/*
* Enable interrupt RFDAIE (data in Rx fifo),
* and disable DRMIE (need data for Tx)
Expand Down

0 comments on commit 28ad332

Please sign in to comment.