From 36d842cd14c0a4255385a3a38c3dcc0e8ca865ed Mon Sep 17 00:00:00 2001 From: yangjq Date: Thu, 27 Sep 2018 12:14:25 +0800 Subject: [PATCH] aw869x: Add debug code for vibrating fail issue As for the vibrating fail issue is difficult to reproduce, add debug codes from awinic to find more if it's reproduced by user. Change-Id: I588875a1baa201fb2088f0fdc0ac4dc27e0537a7 Signed-off-by: yangjq Reviewed-on: https://gerrit.mot.com/1247441 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/misc/awinic/aw869x.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/drivers/misc/awinic/aw869x.c b/drivers/misc/awinic/aw869x.c index a4037ab69e9f..a9e8d71b1032 100644 --- a/drivers/misc/awinic/aw869x.c +++ b/drivers/misc/awinic/aw869x.c @@ -486,6 +486,11 @@ static int aw869x_haptic_stop(struct aw869x *aw869x) aw869x_haptic_play_mode(aw869x, AW869X_HAPTIC_STANDBY_MODE); aw869x_i2c_write_bits(aw869x, AW869X_REG_SYSCTRL, AW869X_BIT_SYSCTRL_WORK_MODE_MASK, AW869X_BIT_SYSCTRL_STANDBY); + msleep(1); + /* RAMINIT Disable */ + aw869x_i2c_write_bits(aw869x, AW869X_REG_SYSCTRL, + AW869X_BIT_SYSCTRL_RAMINIT_MASK, AW869X_BIT_SYSCTRL_RAMINIT_OFF); + /* RAMINIT Disable End */ return 0; } @@ -493,7 +498,12 @@ static int aw869x_haptic_start(struct aw869x *aw869x) { aw869x_i2c_write_bits(aw869x, AW869X_REG_SYSCTRL, AW869X_BIT_SYSCTRL_WORK_MODE_MASK, AW869X_BIT_SYSCTRL_ACTIVE); - aw869x_i2c_write(aw869x, AW869X_REG_PROC_CTRL, + /* RAMINIT Enable */ + aw869x_i2c_write_bits(aw869x, AW869X_REG_SYSCTRL, + AW869X_BIT_SYSCTRL_RAMINIT_MASK, AW869X_BIT_SYSCTRL_RAMINIT_EN); + /* RAMINIT Enable End */ + aw869x_interrupt_clear(aw869x); + aw869x_i2c_write(aw869x, AW869X_REG_PROC_CTRL, AW869X_BIT_PROC_CTRL_GO); return 0; }