diff options
author | Kevin Wells <wellsk40@gmail.com> | 2010-03-16 23:55:37 +0100 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-04-20 02:16:57 +0200 |
commit | 28ad3321a1ac732c7fe37d5be85f67fe40ef18a9 (patch) | |
tree | 97b5c130393adaa794d4ce2fec568742681d89d0 /drivers/i2c/busses/i2c-pnx.c | |
parent | i2c-pnx: Limit maximum divider to 1023 (diff) | |
download | linux-28ad3321a1ac732c7fe37d5be85f67fe40ef18a9.tar.xz linux-28ad3321a1ac732c7fe37d5be85f67fe40ef18a9.zip |
i2c-pnx: Add stop conditions for end of transfer
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>
Diffstat (limited to 'drivers/i2c/busses/i2c-pnx.c')
-rw-r--r-- | drivers/i2c/busses/i2c-pnx.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-pnx.c b/drivers/i2c/busses/i2c-pnx.c index 68fa415d9ad5..a97e3fec8148 100644 --- a/drivers/i2c/busses/i2c-pnx.c +++ b/drivers/i2c/busses/i2c-pnx.c @@ -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)); @@ -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) |