From f2438f0d9391a27f763bb46bc5d0941fcfb207c3 Mon Sep 17 00:00:00 2001 From: Ramu Gottipati Date: Thu, 9 Jan 2020 10:57:33 +0530 Subject: [PATCH] dsp: Avoid configuring PSPD channel mixer if PSPD is already configured Observing audio glitch issue while trying to apply PSPD channel mixer coefficients for already applied COPP port. To fix this, added check condition to retun 0 without applying PSPD. Change-Id: I3825cacfd888f153144cc5d73eb274f4fbf5d8bc Signed-off-by: Ramu Gottipati --- dsp/q6adm.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/dsp/q6adm.c b/dsp/q6adm.c index b161df90aec7..1deaeb10669c 100644 --- a/dsp/q6adm.c +++ b/dsp/q6adm.c @@ -1,6 +1,6 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Copyright (c) 2012-2019, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2020, The Linux Foundation. All rights reserved. */ #include #include @@ -513,6 +513,17 @@ int adm_programable_channel_mixer(int port_id, int copp_idx, int session_id, pr_err("%s: Invalid port_id %#x\n", __func__, port_id); return -EINVAL; } + + /* + * check if PSPD is already configured + * if it is configured already, return 0 without applying PSPD. + */ + if (atomic_read(&this_adm.copp.cnt[port_idx][copp_idx]) > 1) { + pr_debug("%s: copp.cnt:%#x\n", __func__, + atomic_read(&this_adm.copp.cnt[port_idx][copp_idx])); + return 0; + } + /* * First 8 bytes are 4 bytes as rule number, 2 bytes as output * channel and 2 bytes as input channel.