summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVangala, Amarnath <avangala@codeaurora.org>2020-06-23 13:40:04 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2021-05-10 02:09:28 -0700
commita29516b5faaaa52101d75df2da0097c68f2376f5 (patch)
treecc4cccfb75d8c90871a0d10ca6a1925a2a881a08
parent3da6272ea2fdf0e8990de49fd37ff736b3a43ead (diff)
downloadmsm-extra-a29516b5faaaa52101d75df2da0097c68f2376f5.tar.gz
dsp: Feedback path cfg to support 3rd party spkr protection algorithms.
Backward compatibility change to set 'feedback path cfg' to AFE_MODULE_FEEDBACK, to support 3rd party spkr protection algorithms. Change-Id: I9af731902fbc5bc69f130a4f30d8fc5f18ceaace Signed-off-by: Vangala, Amarnath <avangala@codeaurora.org>
-rw-r--r--dsp/q6afe.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/dsp/q6afe.c b/dsp/q6afe.c
index 7f594f29..5880ec93 100644
--- a/dsp/q6afe.c
+++ b/dsp/q6afe.c
@@ -9644,30 +9644,28 @@ int afe_spk_prot_feed_back_cfg(int src_port, int dst_port,
}
this_afe.v4_ch_map_cfg.num_channels = index;
this_afe.num_spkrs = index / 2;
- pr_debug("%s no of channels: %d\n", __func__, index);
- this_afe.vi_tx_port = src_port;
- this_afe.vi_rx_port = dst_port;
- ret = 0;
- } else {
- memset(&prot_config, 0, sizeof(prot_config));
- prot_config.feedback_path_cfg.dst_portid =
+ }
+
+ index = 0;
+ memset(&prot_config, 0, sizeof(prot_config));
+ prot_config.feedback_path_cfg.dst_portid =
q6audio_get_port_id(dst_port);
- if (l_ch) {
- prot_config.feedback_path_cfg.chan_info[index++] = 1;
- prot_config.feedback_path_cfg.chan_info[index++] = 2;
- }
- if (r_ch) {
- prot_config.feedback_path_cfg.chan_info[index++] = 3;
- prot_config.feedback_path_cfg.chan_info[index++] = 4;
- }
- prot_config.feedback_path_cfg.num_channels = index;
- pr_debug("%s no of channels: %d\n", __func__, index);
- prot_config.feedback_path_cfg.minor_version = 1;
- ret = afe_spk_prot_prepare(src_port, dst_port,
- AFE_PARAM_ID_FEEDBACK_PATH_CFG, &prot_config,
- sizeof(union afe_spkr_prot_config));
+ if (l_ch) {
+ prot_config.feedback_path_cfg.chan_info[index++] = 1;
+ prot_config.feedback_path_cfg.chan_info[index++] = 2;
+ }
+ if (r_ch) {
+ prot_config.feedback_path_cfg.chan_info[index++] = 3;
+ prot_config.feedback_path_cfg.chan_info[index++] = 4;
}
+ prot_config.feedback_path_cfg.num_channels = index;
+ pr_debug("%s no of channels: %d\n", __func__, index);
+ prot_config.feedback_path_cfg.minor_version = 1;
+ ret = afe_spk_prot_prepare(src_port, dst_port,
+ AFE_PARAM_ID_FEEDBACK_PATH_CFG, &prot_config,
+ sizeof(union afe_spkr_prot_config));
+
fail_cmd:
return ret;
}