From 0ffc608139338baab2b2d33c768b0f59fd87a5f0 Mon Sep 17 00:00:00 2001 From: Vignesh Kulothungan Date: Fri, 3 Aug 2018 10:46:42 -0700 Subject: [PATCH] dsp: q6afe: Add check for DC detection registration Check if speaker protection is enabled before registering for DC detection events. CRs-Fixed: 2244131 Change-Id: If2f9f777534ee5fe9024ba1080d0b73d3f750159 Signed-off-by: Vignesh Kulothungan --- dsp/q6afe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dsp/q6afe.c b/dsp/q6afe.c index 31f86d6ff6a1..b2d43bd0f994 100644 --- a/dsp/q6afe.c +++ b/dsp/q6afe.c @@ -1796,8 +1796,11 @@ static void afe_send_cal_spkr_prot_tx(int port_id) } mutex_unlock(&this_afe.cal_data[AFE_FB_SPKR_PROT_EX_VI_CAL]->lock); - /* Register for DC detection event */ - afe_spkr_prot_reg_event_cfg(port_id); + /* Register for DC detection event if speaker protection is enabled */ + if (this_afe.prot_cfg.mode != MSM_SPKR_PROT_DISABLED && + (this_afe.vi_tx_port == port_id)) { + afe_spkr_prot_reg_event_cfg(port_id); + } } static void afe_send_cal_spkr_prot_rx(int port_id)