aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-bfin-twi.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/i2c/busses/i2c-bfin-twi.c b/drivers/i2c/busses/i2c-bfin-twi.c
index 77cafb6ba923..4d73ad7b5703 100644
--- a/drivers/i2c/busses/i2c-bfin-twi.c
+++ b/drivers/i2c/busses/i2c-bfin-twi.c
@@ -196,8 +196,6 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface)
196 /* remove restart bit and enable master receive */ 196 /* remove restart bit and enable master receive */
197 write_MASTER_CTL(iface, 197 write_MASTER_CTL(iface,
198 read_MASTER_CTL(iface) & ~RSTART); 198 read_MASTER_CTL(iface) & ~RSTART);
199 write_MASTER_CTL(iface,
200 read_MASTER_CTL(iface) | MEN | MDIR);
201 SSYNC(); 199 SSYNC();
202 } else if (iface->cur_mode == TWI_I2C_MODE_REPEAT && 200 } else if (iface->cur_mode == TWI_I2C_MODE_REPEAT &&
203 iface->cur_msg+1 < iface->msg_num) { 201 iface->cur_msg+1 < iface->msg_num) {
@@ -222,18 +220,19 @@ static void bfin_twi_handle_interrupt(struct bfin_twi_iface *iface)
222 } 220 }
223 221
224 if (iface->pmsg[iface->cur_msg].len <= 255) 222 if (iface->pmsg[iface->cur_msg].len <= 255)
225 write_MASTER_CTL(iface, 223 write_MASTER_CTL(iface,
226 iface->pmsg[iface->cur_msg].len << 6); 224 (read_MASTER_CTL(iface) &
225 (~(0xff << 6))) |
226 (iface->pmsg[iface->cur_msg].len << 6));
227 else { 227 else {
228 write_MASTER_CTL(iface, 0xff << 6); 228 write_MASTER_CTL(iface,
229 (read_MASTER_CTL(iface) |
230 (0xff << 6)));
229 iface->manual_stop = 1; 231 iface->manual_stop = 1;
230 } 232 }
231 /* remove restart bit and enable master receive */ 233 /* remove restart bit and enable master receive */
232 write_MASTER_CTL(iface, 234 write_MASTER_CTL(iface,
233 read_MASTER_CTL(iface) & ~RSTART); 235 read_MASTER_CTL(iface) & ~RSTART);
234 write_MASTER_CTL(iface, read_MASTER_CTL(iface) |
235 MEN | ((iface->read_write == I2C_SMBUS_READ) ?
236 MDIR : 0));
237 SSYNC(); 236 SSYNC();
238 } else { 237 } else {
239 iface->result = 1; 238 iface->result = 1;