aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-eg20t.c
diff options
context:
space:
mode:
authorTomoya MORINAGA <tomoya.rohm@gmail.com>2012-03-26 02:34:10 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-05-12 08:28:13 -0400
commit2761a81cee6874f73ebaa81f1a9e45147907c38b (patch)
treeae1e8331fb76557a1e5793a7a437a44c3b9a6528 /drivers/i2c/busses/i2c-eg20t.c
parent531183e5d27312d68fab40352cd13426aa761473 (diff)
i2c-eg20t: Call init() when wait-event timeout occurs
Signed-off-by: Tomoya MORINAGA <tomoya.rohm@gmail.com> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers/i2c/busses/i2c-eg20t.c')
-rw-r--r--drivers/i2c/busses/i2c-eg20t.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/i2c/busses/i2c-eg20t.c b/drivers/i2c/busses/i2c-eg20t.c
index c811289b61e2..d6309e618cdc 100644
--- a/drivers/i2c/busses/i2c-eg20t.c
+++ b/drivers/i2c/busses/i2c-eg20t.c
@@ -445,7 +445,10 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap,
445 pch_i2c_init(adap); 445 pch_i2c_init(adap);
446 return -EAGAIN; 446 return -EAGAIN;
447 } else { /* wait-event timeout */ 447 } else { /* wait-event timeout */
448 pch_err(adap, "%s(L.%d):wait-event timeout\n",
449 __func__, __LINE__);
448 pch_i2c_stop(adap); 450 pch_i2c_stop(adap);
451 pch_i2c_init(adap);
449 return -ETIME; 452 return -ETIME;
450 } 453 }
451 } else { 454 } else {
@@ -469,7 +472,10 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap,
469 pch_i2c_init(adap); 472 pch_i2c_init(adap);
470 return -EAGAIN; 473 return -EAGAIN;
471 } else { /* wait-event timeout */ 474 } else { /* wait-event timeout */
475 pch_err(adap, "%s(L.%d):wait-event timeout\n",
476 __func__, __LINE__);
472 pch_i2c_stop(adap); 477 pch_i2c_stop(adap);
478 pch_i2c_init(adap);
473 return -ETIME; 479 return -ETIME;
474 } 480 }
475 481
@@ -490,7 +496,10 @@ static s32 pch_i2c_writebytes(struct i2c_adapter *i2c_adap,
490 pch_clrbit(adap->pch_base_address, PCH_I2CSR, 496 pch_clrbit(adap->pch_base_address, PCH_I2CSR,
491 I2CMIF_BIT); 497 I2CMIF_BIT);
492 } else { /* wait-event timeout */ 498 } else { /* wait-event timeout */
499 pch_err(adap, "%s(L.%d):wait-event timeout\n",
500 __func__, __LINE__);
493 pch_i2c_stop(adap); 501 pch_i2c_stop(adap);
502 pch_i2c_init(adap);
494 return -ETIME; 503 return -ETIME;
495 } 504 }
496 } 505 }
@@ -598,7 +607,10 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
598 pch_i2c_init(adap); 607 pch_i2c_init(adap);
599 return -EAGAIN; 608 return -EAGAIN;
600 } else { /* wait-event timeout */ 609 } else { /* wait-event timeout */
610 pch_err(adap, "%s(L.%d):wait-event timeout\n",
611 __func__, __LINE__);
601 pch_i2c_stop(adap); 612 pch_i2c_stop(adap);
613 pch_i2c_init(adap);
602 return -ETIME; 614 return -ETIME;
603 } 615 }
604 pch_i2c_restart(adap); 616 pch_i2c_restart(adap);
@@ -621,7 +633,10 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
621 pch_i2c_init(adap); 633 pch_i2c_init(adap);
622 return -EAGAIN; 634 return -EAGAIN;
623 } else { /* wait-event timeout */ 635 } else { /* wait-event timeout */
636 pch_err(adap, "%s(L.%d):wait-event timeout\n",
637 __func__, __LINE__);
624 pch_i2c_stop(adap); 638 pch_i2c_stop(adap);
639 pch_i2c_init(adap);
625 return -ETIME; 640 return -ETIME;
626 } 641 }
627 } else { 642 } else {
@@ -648,7 +663,10 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
648 pch_i2c_init(adap); 663 pch_i2c_init(adap);
649 return -EAGAIN; 664 return -EAGAIN;
650 } else { /* wait-event timeout */ 665 } else { /* wait-event timeout */
666 pch_err(adap, "%s(L.%d):wait-event timeout\n",
667 __func__, __LINE__);
651 pch_i2c_stop(adap); 668 pch_i2c_stop(adap);
669 pch_i2c_init(adap);
652 return -ETIME; 670 return -ETIME;
653 } 671 }
654 672
@@ -677,7 +695,10 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
677 return -EIO; 695 return -EIO;
678 } 696 }
679 } else { /* wait-event timeout */ 697 } else { /* wait-event timeout */
698 pch_err(adap, "%s(L.%d):wait-event timeout\n",
699 __func__, __LINE__);
680 pch_i2c_stop(adap); 700 pch_i2c_stop(adap);
701 pch_i2c_init(adap);
681 return -ETIME; 702 return -ETIME;
682 } 703 }
683 704
@@ -698,7 +719,10 @@ static s32 pch_i2c_readbytes(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
698 return -EIO; 719 return -EIO;
699 } 720 }
700 } else { /* wait-event timeout */ 721 } else { /* wait-event timeout */
722 pch_err(adap, "%s(L.%d):wait-event timeout\n",
723 __func__, __LINE__);
701 pch_i2c_stop(adap); 724 pch_i2c_stop(adap);
725 pch_i2c_init(adap);
702 return -ETIME; 726 return -ETIME;
703 } 727 }
704 728