|
@@ -101,6 +101,7 @@ struct adm_ctl {
|
|
|
int num_ec_ref_rx_chans_downmixed;
|
|
|
uint16_t ec_ref_chmixer_weights[PCM_FORMAT_MAX_NUM_CHANNEL_V8]
|
|
|
[PCM_FORMAT_MAX_NUM_CHANNEL_V8];
|
|
|
+ int ffecns_port_id;
|
|
|
int native_mode;
|
|
|
};
|
|
|
|
|
@@ -2985,6 +2986,12 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
|
|
rate = 16000;
|
|
|
}
|
|
|
|
|
|
+ if (topology == FFECNS_TOPOLOGY) {
|
|
|
+ this_adm.ffecns_port_id = port_id;
|
|
|
+ pr_debug("%s: ffecns port id =%x\n", __func__,
|
|
|
+ this_adm.ffecns_port_id);
|
|
|
+ }
|
|
|
+
|
|
|
if (topology == VPM_TX_VOICE_SMECNS_V2_COPP_TOPOLOGY)
|
|
|
channel_mode = 1;
|
|
|
|
|
@@ -3842,6 +3849,10 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
|
|
|
pr_debug("%s: remove adm device from rtac\n", __func__);
|
|
|
rtac_remove_adm_device(port_id, copp_id);
|
|
|
}
|
|
|
+
|
|
|
+ if (port_id == this_adm.ffecns_port_id)
|
|
|
+ this_adm.ffecns_port_id = -1;
|
|
|
+
|
|
|
return 0;
|
|
|
}
|
|
|
EXPORT_SYMBOL(adm_close);
|
|
@@ -4442,6 +4453,48 @@ int adm_send_set_multichannel_ec_primary_mic_ch(int port_id, int copp_idx,
|
|
|
}
|
|
|
EXPORT_SYMBOL(adm_send_set_multichannel_ec_primary_mic_ch);
|
|
|
|
|
|
+/**
|
|
|
+ * adm_set_ffecns_effect -
|
|
|
+ * command to set effect for ffecns module
|
|
|
+ *
|
|
|
+ * @effect: effect payload
|
|
|
+ *
|
|
|
+ * Returns 0 on success or error on failure
|
|
|
+ */
|
|
|
+int adm_set_ffecns_effect(int effect)
|
|
|
+{
|
|
|
+ struct ffecns_effect ffecns_params;
|
|
|
+ struct param_hdr_v3 param_hdr;
|
|
|
+ int rc = 0;
|
|
|
+ int copp_idx = 0;
|
|
|
+
|
|
|
+ copp_idx = adm_get_default_copp_idx(this_adm.ffecns_port_id);
|
|
|
+ if ((copp_idx < 0) || (copp_idx >= MAX_COPPS_PER_PORT)) {
|
|
|
+ pr_err("%s, no active copp to query rms copp_idx:%d\n",
|
|
|
+ __func__, copp_idx);
|
|
|
+ return -EINVAL;
|
|
|
+ }
|
|
|
+
|
|
|
+ memset(&ffecns_params, 0, sizeof(ffecns_params));
|
|
|
+ memset(¶m_hdr, 0, sizeof(param_hdr));
|
|
|
+
|
|
|
+ param_hdr.module_id = FFECNS_MODULE_ID;
|
|
|
+ param_hdr.instance_id = INSTANCE_ID_0;
|
|
|
+ param_hdr.param_id = FLUENCE_CMN_GLOBAL_EFFECT_PARAM_ID;
|
|
|
+ param_hdr.param_size = sizeof(ffecns_params);
|
|
|
+
|
|
|
+ ffecns_params.payload = effect;
|
|
|
+
|
|
|
+ rc = adm_pack_and_set_one_pp_param(this_adm.ffecns_port_id, copp_idx,
|
|
|
+ param_hdr, (uint8_t *) &ffecns_params);
|
|
|
+ if (rc)
|
|
|
+ pr_err("%s: Failed to set ffecns effect, err %d\n",
|
|
|
+ __func__, rc);
|
|
|
+
|
|
|
+ return rc;
|
|
|
+}
|
|
|
+EXPORT_SYMBOL(adm_set_ffecns_effect);
|
|
|
+
|
|
|
/**
|
|
|
* adm_param_enable -
|
|
|
* command to send params to ADM for given module
|
|
@@ -5296,6 +5349,7 @@ int __init adm_init(void)
|
|
|
int i = 0, j;
|
|
|
|
|
|
this_adm.ec_ref_rx = -1;
|
|
|
+ this_adm.ffecns_port_id = -1;
|
|
|
init_waitqueue_head(&this_adm.matrix_map_wait);
|
|
|
init_waitqueue_head(&this_adm.adm_wait);
|
|
|
|