summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhuohao Lee <zhuohao@chromium.org>2018-11-08 18:47:24 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-11-14 16:56:28 -0800
commit5b749cf03594ec652ad8b52e24a31db95b9d4634 (patch)
treeb7aa832da5811efc69cd5a3429a01851ef508323
parente470e5a7f05143646685ed1bb0b73076fc2682ba (diff)
downloadchrome-ec-5b749cf03594ec652ad8b52e24a31db95b9d4634.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> Reviewed-on: https://chromium-review.googlesource.com/1331249 Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com> Reviewed-by: Furquan Shaikh <furquan@chromium.org> Reviewed-by: ML Chao <mlchao@nuvoton.corp-partner.google.com> Reviewed-by: Jett Rink <jettrink@chromium.org>
-rw-r--r--chip/npcx/i2c.c5
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);