asoc: set AFE_LOOPBACK_TX port id to EC ref port
- AFE_LOOPBACK_TX BE is the dummy backend created to establish the EC reference capture path. While opening COPP pass playback port id instead of AFE_LOOPBACK_TX to get reference stream data from AFE RX port. - Add session type support in creating new COPP and while checking for existing COPP. CRs-Fixed: 2080421 Change-Id: I979f3ce1009cc18ff14130bebb8bd51a78fbe5ac Signed-off-by: Surendar Karka <skarka@codeaurora.org>
此提交包含在:
21
dsp/q6adm.c
21
dsp/q6adm.c
@@ -61,6 +61,7 @@ struct adm_copp {
|
||||
atomic_t channels[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
atomic_t app_type[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
atomic_t acdb_id[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
atomic_t session_type[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
wait_queue_head_t wait[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
wait_queue_head_t adm_delay_wait[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
atomic_t adm_delay_stat[AFE_MAX_PORTS][MAX_COPPS_PER_PORT];
|
||||
@@ -269,7 +270,8 @@ static int adm_get_copp_id(int port_idx, int copp_idx)
|
||||
}
|
||||
|
||||
static int adm_get_idx_if_copp_exists(int port_idx, int topology, int mode,
|
||||
int rate, int bit_width, int app_type)
|
||||
int rate, int bit_width, int app_type,
|
||||
int session_type)
|
||||
{
|
||||
int idx;
|
||||
|
||||
@@ -283,6 +285,9 @@ static int adm_get_idx_if_copp_exists(int port_idx, int topology, int mode,
|
||||
(rate == atomic_read(&this_adm.copp.rate[port_idx][idx])) &&
|
||||
(bit_width ==
|
||||
atomic_read(&this_adm.copp.bit_width[port_idx][idx])) &&
|
||||
(session_type ==
|
||||
atomic_read(
|
||||
&this_adm.copp.session_type[port_idx][idx])) &&
|
||||
(app_type ==
|
||||
atomic_read(&this_adm.copp.app_type[port_idx][idx])))
|
||||
return idx;
|
||||
@@ -1484,6 +1489,8 @@ static void adm_reset_data(void)
|
||||
&this_adm.copp.app_type[i][j], 0);
|
||||
atomic_set(
|
||||
&this_adm.copp.acdb_id[i][j], 0);
|
||||
atomic_set(
|
||||
&this_adm.copp.session_type[i][j], 0);
|
||||
this_adm.copp.adm_status[i][j] =
|
||||
ADM_STATUS_CALIBRATION_REQUIRED;
|
||||
}
|
||||
@@ -2750,11 +2757,13 @@ static int adm_arrange_mch_ep2_map_v8(
|
||||
* @bit_width: bit width to set for copp
|
||||
* @app_type: App type used for this session
|
||||
* @acdb_id: ACDB ID of this device
|
||||
* @session_type: type of session
|
||||
*
|
||||
* Returns 0 on success or error on failure
|
||||
*/
|
||||
int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
||||
int perf_mode, uint16_t bit_width, int app_type, int acdb_id)
|
||||
int perf_mode, uint16_t bit_width, int app_type, int acdb_id,
|
||||
int session_type)
|
||||
{
|
||||
struct adm_cmd_device_open_v5 open;
|
||||
struct adm_cmd_device_open_v6 open_v6;
|
||||
@@ -2838,7 +2847,7 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
||||
copp_idx = adm_get_idx_if_copp_exists(port_idx, topology,
|
||||
perf_mode,
|
||||
rate, bit_width,
|
||||
app_type);
|
||||
app_type, session_type);
|
||||
|
||||
if (copp_idx < 0) {
|
||||
copp_idx = adm_get_next_available_copp(port_idx);
|
||||
@@ -2862,6 +2871,8 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
||||
app_type);
|
||||
atomic_set(&this_adm.copp.acdb_id[port_idx][copp_idx],
|
||||
acdb_id);
|
||||
atomic_set(&this_adm.copp.session_type[port_idx][copp_idx],
|
||||
session_type);
|
||||
set_bit(ADM_STATUS_CALIBRATION_REQUIRED,
|
||||
(void *)&this_adm.copp.adm_status[port_idx][copp_idx]);
|
||||
if ((path != ADM_PATH_COMPRESSED_RX) &&
|
||||
@@ -3047,7 +3058,8 @@ int adm_open(int port_id, int path, int rate, int channel_mode, int topology,
|
||||
open.endpoint_id_1 = tmp_port;
|
||||
open.endpoint_id_2 = 0xFFFF;
|
||||
|
||||
if (this_adm.ec_ref_rx && (path != 1)) {
|
||||
if (this_adm.ec_ref_rx && (path != 1) &&
|
||||
(afe_get_port_type(tmp_port) == MSM_AFE_PORT_TYPE_TX)) {
|
||||
open.endpoint_id_2 = this_adm.ec_ref_rx;
|
||||
this_adm.ec_ref_rx = -1;
|
||||
}
|
||||
@@ -3578,6 +3590,7 @@ int adm_close(int port_id, int perf_mode, int copp_idx)
|
||||
atomic_set(&this_adm.copp.channels[port_idx][copp_idx], 0);
|
||||
atomic_set(&this_adm.copp.bit_width[port_idx][copp_idx], 0);
|
||||
atomic_set(&this_adm.copp.app_type[port_idx][copp_idx], 0);
|
||||
atomic_set(&this_adm.copp.session_type[port_idx][copp_idx], 0);
|
||||
|
||||
clear_bit(ADM_STATUS_CALIBRATION_REQUIRED,
|
||||
(void *)&this_adm.copp.adm_status[port_idx][copp_idx]);
|
||||
|
新增問題並參考
封鎖使用者