From 8db7df380c42ab40edd86da94ca3ced3f67cddc5 Mon Sep 17 00:00:00 2001 From: yangjq Date: Fri, 12 Jun 2020 16:22:26 +0530 Subject: [PATCH] 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 Reviewed-on: https://gerrit.mot.com/1616585 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/misc/awinic/aw8697/aw8697.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/misc/awinic/aw8697/aw8697.c b/drivers/misc/awinic/aw8697/aw8697.c index 8030236f37f0..fe7432dc220c 100644 --- a/drivers/misc/awinic/aw8697/aw8697.c +++ b/drivers/misc/awinic/aw8697/aw8697.c @@ -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; }