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 <yangjq@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1611611
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Reviewed-on: https://gerrit.mot.com/1614428
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Submit-Approved: Jira Key
This commit is contained in:
yangjq 2020-06-11 15:30:25 +05:30 • committed by Amarendra Reddy
commit 4ba3ddd1dc

View file

@ -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);