diff options
author | Zhuohao Lee <zhuohao@chromium.org> | 2018-11-08 18:47:24 +0800 |
---|---|---|
committer | Edward Hill <ecgh@chromium.org> | 2018-11-17 00:06:02 +0000 |
commit | c4c3c8ea8336e71e093f12d181db96bd0c71ff20 (patch) | |
tree | fe15b82c0629b8db1e4462ba233fcec814b0bce4 /chip | |
parent | 2f6e50e2aa0775d7d5d9904ae4bf324570a0e5e0 (diff) | |
download | chrome-ec-c4c3c8ea8336e71e093f12d181db96bd0c71ff20.tar.gz |
chip/npcx: Default output the i2c_recovery() error message
The i2c_recovery() will be called if the i2c bus error is detected.
This is an serious error handling and may be caused by the slave
which doesn't follow the spec. We should output this error message
to let developer catch this error at the beginning like proto stage.
BUG=b:118063849
BRANCH=master
TEST=error message popped out on Nami and Rammus
Change-Id: I4996cd18415d6ee4c5cd48ac374252a2230628b0
Signed-off-by: Zhuohao Lee <zhuohao@chromium.org>
Previous-Reviewed-on: https://chromium-review.googlesource.com/1331249
(cherry picked from commit b11f8316946c68b5f56e386c8f2cc3df920b562f)
Reviewed-on: https://chromium-review.googlesource.com/c/1340496
Reviewed-by: Edward Hill <ecgh@chromium.org>
Tested-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/npcx/i2c.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chip/npcx/i2c.c b/chip/npcx/i2c.c index 926a5a26c5..725a2e7015 100644 --- a/chip/npcx/i2c.c +++ b/chip/npcx/i2c.c @@ -201,8 +201,9 @@ static int i2c_reset(int controller) static void i2c_recovery(int controller, volatile struct i2c_status *p_status) { - CPRINTS("i2c %d recovery! error code is %d, current state is %d", - controller, p_status->err_code, p_status->oper_state); + cprintf(CC_I2C, + "i2c %d recovery! error code is %d, current state is %d\n", + controller, p_status->err_code, p_status->oper_state); /* Abort data, wait for STOP condition completed. */ i2c_abort_data(controller); |