aw8697: A fix of rtp playing from Awinic

When frequently making a phone call and declining it, the waveform
playing sometimes would fail to work due to the limitation of i2c's
transmission speed.

Awinic provides this solution and it not only works fine but also has
been integrated to all their new software releases, even for aw8697.

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: Id7f1a01c4fcb13b082ca48d105654803eb84e8f4
Signed-off-by: yangjq <yangjq@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1616585
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yangjq 2020-06-12 16:22:26 +05:30 • committed by Amarendra Reddy
commit 8db7df380c

View file

@ -1416,7 +1416,15 @@ static int aw8697_haptic_rtp_init(struct aw8697 *aw8697)
mutex_unlock(&aw8697->rtp_lock);
break;
}
if ((aw8697_rtp->len - aw8697->rtp_cnt) <
if ((aw8697->rtp_cnt < aw8697->ram.base_addr)) {
if((aw8697_rtp->len-aw8697->rtp_cnt) < (aw8697->ram.base_addr)){
buf_len = aw8697_rtp->len-aw8697->rtp_cnt;
} else {
buf_len = (aw8697->ram.base_addr);
}
}
else if ((aw8697_rtp->len - aw8697->rtp_cnt) <
(aw8697->ram.base_addr >> 2)) {
buf_len = aw8697_rtp->len - aw8697->rtp_cnt;
} else {
@ -1428,6 +1436,7 @@ static int aw8697_haptic_rtp_init(struct aw8697 *aw8697)
if (aw8697->rtp_cnt == aw8697_rtp->len) {
pr_info("%s: rtp update complete\n", __func__);
aw8697->rtp_cnt = 0;
pm_qos_remove_request(&pm_qos_req_vb);
mutex_unlock(&aw8697->rtp_lock);
return 0;
}