void rtac_add_voice(u32 cvs_handle, u32 cvp_handle, u32 rx_afe_port, u32 tx_afe_port, u32 session_id) { u32 i = 0; pr_debug("%s\n", __func__); mutex_lock(&rtac_voice_mutex); if (rtac_voice_data.num_of_voice_combos == RTAC_MAX_ACTIVE_VOICE_COMBOS) { pr_err("%s, Can't add anymore RTAC devices!\n", __func__); goto done; } if (rtac_voice_data.num_of_voice_combos != 0) { for (; i < rtac_voice_data.num_of_voice_combos; i++) { 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); goto done; } } } rtac_voice_data.num_of_voice_combos++; set_rtac_voice_data(i, cvs_handle, cvp_handle, rx_afe_port, tx_afe_port, session_id); done: mutex_unlock(&rtac_voice_mutex); return; }
void rtac_add_voice(struct voice_data *v) { u32 i = 0; pr_debug("%s\n", __func__); mutex_lock(&rtac_voice_mutex); if (rtac_voice_data.num_of_voice_combos == RTAC_MAX_ACTIVE_VOICE_COMBOS) { pr_err("%s, Can't add anymore RTAC devices!\n", __func__); goto done; } /* Check if device already added */ if (rtac_voice_data.num_of_voice_combos != 0) { for (; i < rtac_voice_data.num_of_voice_combos; i++) { if (rtac_voice_data.voice[i].cvp_handle == v->cvp_handle) { set_rtac_voice_data(i, v); goto done; } } } /* Add device */ rtac_voice_data.num_of_voice_combos++; set_rtac_voice_data(i, v); done: mutex_unlock(&rtac_voice_mutex); return; }