Merge "ASoC: qdsp6v2: Update RTC with device pair used in a voice call"
This commit is contained in:
commit
4c6b09d6f2
|
@ -1,4 +1,4 @@
|
|||
/* Copyright (c) 2011, 2013-2014, The Linux Foundation. All rights reserved.
|
||||
/* Copyright (c) 2011, 2013-2015, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -50,7 +50,7 @@ void rtac_add_adm_device(u32 port_id, u32 copp_id, u32 path_id, u32 popp_id,
|
|||
void rtac_remove_adm_device(u32 port_id, u32 copp_id);
|
||||
void rtac_remove_popp_from_adm_devices(u32 popp_id);
|
||||
void rtac_add_voice(u32 cvs_handle, u32 cvp_handle, u32 rx_afe_port,
|
||||
u32 tx_afe_port, u32 session_id);
|
||||
u32 tx_afe_port, u32 rx_acdb_id, u32 tx_acdb_id, u32 session_id);
|
||||
void rtac_remove_voice(u32 cvs_handle);
|
||||
void rtac_set_adm_handle(void *handle);
|
||||
bool rtac_make_adm_callback(uint32_t *payload, u32 payload_size);
|
||||
|
|
|
@ -2593,6 +2593,14 @@ static int voice_send_cvp_register_cal_cmd(struct voice_data *v)
|
|||
goto unlock;
|
||||
}
|
||||
|
||||
v->dev_tx.dev_id = ((struct audio_cal_info_vocproc *)
|
||||
cal_block->cal_info)->tx_acdb_id;
|
||||
v->dev_rx.dev_id = ((struct audio_cal_info_vocproc *)
|
||||
cal_block->cal_info)->rx_acdb_id;
|
||||
pr_debug("%s: %s: Tx acdb id = %d and Rx acdb id = %d", __func__,
|
||||
voc_get_session_name(v->session_id), v->dev_tx.dev_id,
|
||||
v->dev_rx.dev_id);
|
||||
|
||||
memcpy(&cvp_reg_cal_cmd.cvp_cal_data.column_info[0],
|
||||
(void *) &((struct audio_cal_info_voc_col *)
|
||||
col_data->cal_info)->data,
|
||||
|
@ -3486,6 +3494,7 @@ static int voice_setup_vocproc(struct voice_data *v)
|
|||
rtac_add_voice(voice_get_cvs_handle(v),
|
||||
voice_get_cvp_handle(v),
|
||||
v->dev_rx.port_id, v->dev_tx.port_id,
|
||||
v->dev_rx.dev_id, v->dev_tx.dev_id,
|
||||
v->session_id);
|
||||
|
||||
return 0;
|
||||
|
@ -4885,6 +4894,7 @@ static int voc_enable_cvp(uint32_t session_id)
|
|||
rtac_add_voice(voice_get_cvs_handle(v),
|
||||
voice_get_cvp_handle(v),
|
||||
v->dev_rx.port_id, v->dev_tx.port_id,
|
||||
v->dev_rx.dev_id, v->dev_tx.dev_id,
|
||||
v->session_id);
|
||||
v->voc_state = VOC_RUN;
|
||||
}
|
||||
|
@ -5441,6 +5451,7 @@ int voc_enable_device(uint32_t session_id)
|
|||
rtac_add_voice(voice_get_cvs_handle(v),
|
||||
voice_get_cvp_handle(v),
|
||||
v->dev_rx.port_id, v->dev_tx.port_id,
|
||||
v->dev_rx.dev_id, v->dev_tx.dev_id,
|
||||
v->session_id);
|
||||
|
||||
ret = voice_send_start_voice_cmd(v);
|
||||
|
@ -7829,6 +7840,8 @@ static int __init voice_init(void)
|
|||
|
||||
common.voice[i].dev_tx.port_id = 0x100B;
|
||||
common.voice[i].dev_rx.port_id = 0x100A;
|
||||
common.voice[i].dev_tx.dev_id = 0;
|
||||
common.voice[i].dev_rx.dev_id = 0;
|
||||
common.voice[i].sidetone_gain = 0x512;
|
||||
common.voice[i].dtmf_rx_detect_en = 0;
|
||||
common.voice[i].lch_mode = 0;
|
||||
|
|
|
@ -102,18 +102,20 @@ static u32 *rtac_asm_buffer;
|
|||
static u32 *rtac_afe_buffer;
|
||||
|
||||
/* Voice info & APR */
|
||||
struct rtac_voice_data {
|
||||
struct rtac_voice_data_t {
|
||||
uint32_t tx_topology_id;
|
||||
uint32_t rx_topology_id;
|
||||
uint32_t tx_afe_port;
|
||||
uint32_t rx_afe_port;
|
||||
uint16_t cvs_handle;
|
||||
uint16_t cvp_handle;
|
||||
uint32_t tx_acdb_id;
|
||||
uint32_t rx_acdb_id;
|
||||
};
|
||||
|
||||
struct rtac_voice {
|
||||
uint32_t num_of_voice_combos;
|
||||
struct rtac_voice_data voice[RTAC_MAX_ACTIVE_VOICE_COMBOS];
|
||||
uint32_t num_of_voice_combos;
|
||||
struct rtac_voice_data_t voice[RTAC_MAX_ACTIVE_VOICE_COMBOS];
|
||||
};
|
||||
|
||||
struct rtac_afe_user_data {
|
||||
|
@ -526,6 +528,7 @@ void rtac_remove_popp_from_adm_devices(u32 popp_id)
|
|||
/* Voice Info */
|
||||
static void set_rtac_voice_data(int idx, u32 cvs_handle, u32 cvp_handle,
|
||||
u32 rx_afe_port, u32 tx_afe_port,
|
||||
u32 rx_acdb_id, u32 tx_acdb_id,
|
||||
u32 session_id)
|
||||
{
|
||||
rtac_voice_data.voice[idx].tx_topology_id =
|
||||
|
@ -534,15 +537,24 @@ static void set_rtac_voice_data(int idx, u32 cvs_handle, u32 cvp_handle,
|
|||
voice_get_topology(CVP_VOC_RX_TOPOLOGY_CAL);
|
||||
rtac_voice_data.voice[idx].tx_afe_port = tx_afe_port;
|
||||
rtac_voice_data.voice[idx].rx_afe_port = rx_afe_port;
|
||||
rtac_voice_data.voice[idx].tx_acdb_id = tx_acdb_id;
|
||||
rtac_voice_data.voice[idx].rx_acdb_id = rx_acdb_id;
|
||||
rtac_voice_data.voice[idx].cvs_handle = cvs_handle;
|
||||
rtac_voice_data.voice[idx].cvp_handle = cvp_handle;
|
||||
pr_debug("%s\n%s: %x\n%s: %d %s: %d\n%s: %d %s: %d\n%s: %d %s: %d\n%s",
|
||||
"<---- Voice Data Info ---->", "Session id", session_id,
|
||||
"cvs_handle", cvs_handle, "cvp_handle", cvp_handle,
|
||||
"rx_afe_port", rx_afe_port, "tx_afe_port", tx_afe_port,
|
||||
"rx_acdb_id", rx_acdb_id, "tx_acdb_id", tx_acdb_id,
|
||||
"<-----------End----------->");
|
||||
|
||||
/* Store session ID for voice RTAC */
|
||||
voice_session_id[idx] = session_id;
|
||||
}
|
||||
|
||||
void rtac_add_voice(u32 cvs_handle, u32 cvp_handle, u32 rx_afe_port,
|
||||
u32 tx_afe_port, u32 session_id)
|
||||
u32 tx_afe_port, u32 rx_acdb_id, u32 tx_acdb_id,
|
||||
u32 session_id)
|
||||
{
|
||||
u32 i = 0;
|
||||
pr_debug("%s\n", __func__);
|
||||
|
@ -560,8 +572,8 @@ void rtac_add_voice(u32 cvs_handle, u32 cvp_handle, u32 rx_afe_port,
|
|||
if (rtac_voice_data.voice[i].cvs_handle ==
|
||||
cvs_handle) {
|
||||
set_rtac_voice_data(i, cvs_handle, cvp_handle,
|
||||
rx_afe_port, tx_afe_port,
|
||||
session_id);
|
||||
rx_afe_port, tx_afe_port, rx_acdb_id,
|
||||
tx_acdb_id, session_id);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
@ -571,6 +583,7 @@ void rtac_add_voice(u32 cvs_handle, u32 cvp_handle, u32 rx_afe_port,
|
|||
rtac_voice_data.num_of_voice_combos++;
|
||||
set_rtac_voice_data(i, cvs_handle, cvp_handle,
|
||||
rx_afe_port, tx_afe_port,
|
||||
rx_acdb_id, tx_acdb_id,
|
||||
session_id);
|
||||
done:
|
||||
mutex_unlock(&rtac_voice_mutex);
|
||||
|
|
Loading…
Reference in New Issue