diff options
author | Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com> | 2011-10-12 00:13:04 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2011-10-29 06:09:33 -0400 |
commit | 3cf21a7c48389c167065bffd61db39a9bd201f07 (patch) | |
tree | 07f37090b058e7aa8fb04676d4a560d2e37a381c /drivers/i2c/busses/i2c-eg20t.c | |
parent | 12bd3146518ab984c1eb234a0f81756ddc5e3683 (diff) |
i2c-eg20t: add stop sequence in case wait-event timeout occurs
add stop sequence in case wait-event timeout in write processing.
(read processing already had it)
Signed-off-by: Tomoya MORINAGA <tomoya-linux@dsn.lapis-semi.com>
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-eg20t.c')
-rw-r--r-- | drivers/i2c/busses/i2c-eg20t.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c index cb296862ae0a..318e6a5a710f 100644 --- a/drivers/i2c/busses/i2c-eg20t.c +++ b/drivers/i2c/busses/i2c-eg20t.c | |||
@@ -456,6 +456,7 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap, | |||
456 | pch_clrbit(adap->pch_base_address, PCH_I2CSR, I2CMIF_BIT); | 456 | pch_clrbit(adap->pch_base_address, PCH_I2CSR, I2CMIF_BIT); |
457 | return -EAGAIN; | 457 | return -EAGAIN; |
458 | } else { /* wait-event timeout */ | 458 | } else { /* wait-event timeout */ |
459 | pch_i2c_stop(adap); | ||
459 | return -ETIME; | 460 | return -ETIME; |
460 | } | 461 | } |
461 | 462 | ||
@@ -476,6 +477,7 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap, | |||
476 | pch_clrbit(adap->pch_base_address, PCH_I2CSR, | 477 | pch_clrbit(adap->pch_base_address, PCH_I2CSR, |
477 | I2CMIF_BIT); | 478 | I2CMIF_BIT); |
478 | } else { /* wait-event timeout */ | 479 | } else { /* wait-event timeout */ |
480 | pch_i2c_stop(adap); | ||
479 | return -ETIME; | 481 | return -ETIME; |
480 | } | 482 | } |
481 | } | 483 | } |
@@ -632,6 +634,7 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs, | |||
632 | pch_clrbit(adap->pch_base_address, PCH_I2CSR, I2CMIF_BIT); | 634 | pch_clrbit(adap->pch_base_address, PCH_I2CSR, I2CMIF_BIT); |
633 | return -EAGAIN; | 635 | return -EAGAIN; |
634 | } else { /* wait-event timeout */ | 636 | } else { /* wait-event timeout */ |
637 | pch_i2c_stop(adap); | ||
635 | return -ETIME; | 638 | return -ETIME; |
636 | } | 639 | } |
637 | 640 | ||