From 4ba3ddd1dc9df446339bfe22df03702f41a0986e Mon Sep 17 00:00:00 2001 From: yangjq Date: Thu, 11 Jun 2020 15:30:25 +0530 Subject: [PATCH] aw8697: Stop repeatedly waveform playing Stop repeatedly waveform playing when receive a stop command. Also cancel the 120s timer when stopping vibrating. When stopping waveform playing, the 120s timer to safely stop vibrating also needs to be canceled because it becomes no use, and it might disturb normal operation when it's triggered later. NO_PROP_NEEDED: This propagation is only needed when the change of framework for this new feature is integrated, being done by engineers in charge of that product. Change-Id: I544ec1c8c391bf5468b22bdd0095a77b9d43d222 Signed-off-by: yangjq Reviewed-on: https://gerrit.mot.com/1611611 Reviewed-by: Jianqi Yang Reviewed-on: https://gerrit.mot.com/1614428 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Submit-Approved: Jira Key --- drivers/misc/awinic/aw8697/aw8697.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/misc/awinic/aw8697/aw8697.c b/drivers/misc/awinic/aw8697/aw8697.c index 889edea418ce..8030236f37f0 100644 --- a/drivers/misc/awinic/aw8697/aw8697.c +++ b/drivers/misc/awinic/aw8697/aw8697.c @@ -2565,6 +2565,12 @@ static void aw8697_vibrate(struct aw8697 *aw8697, int value) int seq; mutex_lock(&aw8697->lock); +#ifdef AW8697_REPEAT_RTP_PLAYING + if (aw8697->haptic_mode == HAPTIC_RTP_LOOP) { + aw8697->haptic_mode = HAPTIC_RTP; + hrtimer_cancel(&aw8697->timer); + } +#endif aw8697_haptic_stop(aw8697); if (aw8697->index == 0x02) __pm_relax(aw8697->ws);