diff options
author | Kevin Wells <wellsk40@gmail.com> | 2010-03-16 18:55:37 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-04-19 20:16:57 -0400 |
commit | 28ad3321a1ac732c7fe37d5be85f67fe40ef18a9 (patch) | |
tree | 97b5c130393adaa794d4ce2fec568742681d89d0 /drivers/i2c/busses/i2c-pnx.c | |
parent | be80dbaa3ed64337693be58fb2f3808e78911ba6 (diff) |
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) | |||
173 | /* We still have something to talk about... */ | 173 | /* We still have something to talk about... */ |
174 | val = *alg_data->mif.buf++; | 174 | val = *alg_data->mif.buf++; |
175 | 175 | ||
176 | if (alg_data->mif.len == 1) | ||
177 | val |= stop_bit; | ||
178 | |||
176 | alg_data->mif.len--; | 179 | alg_data->mif.len--; |
177 | iowrite32(val, I2C_REG_TX(alg_data)); | 180 | iowrite32(val, I2C_REG_TX(alg_data)); |
178 | 181 | ||
@@ -246,6 +249,9 @@ static int i2c_pnx_master_rcv(struct i2c_pnx_algo_data *alg_data) | |||
246 | __func__); | 249 | __func__); |
247 | 250 | ||
248 | if (alg_data->mif.len == 1) { | 251 | if (alg_data->mif.len == 1) { |
252 | /* Last byte, do not acknowledge next rcv. */ | ||
253 | val |= stop_bit; | ||
254 | |||
249 | /* | 255 | /* |
250 | * Enable interrupt RFDAIE (data in Rx fifo), | 256 | * Enable interrupt RFDAIE (data in Rx fifo), |
251 | * and disable DRMIE (need data for Tx) | 257 | * and disable DRMIE (need data for Tx) |