Lines Matching refs:uc_mgr
105 int snd_use_case_get_list(snd_use_case_mgr_t *uc_mgr, in snd_use_case_get_list() argument
117 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
118 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || in snd_use_case_get_list()
119 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL)) { in snd_use_case_get_list()
121 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
126 while(strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in snd_use_case_get_list()
129 uc_mgr->card_ctxt_ptr->verb_list[index]); in snd_use_case_get_list()
132 *list = (char ***)uc_mgr->card_ctxt_ptr->verb_list; in snd_use_case_get_list()
133 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
136 if (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get_list()
139 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
142 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_get_list()
143 while(strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get_list()
157 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
160 if (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get_list()
163 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
166 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_get_list()
167 while(strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get_list()
181 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
184 if (uc_mgr->device_list_count) { in snd_use_case_get_list()
185 for (index = 0; index < uc_mgr->device_list_count; index++) { in snd_use_case_get_list()
186 free(uc_mgr->current_device_list[index]); in snd_use_case_get_list()
187 uc_mgr->current_device_list[index] = NULL; in snd_use_case_get_list()
189 free(uc_mgr->current_device_list); in snd_use_case_get_list()
190 uc_mgr->current_device_list = NULL; in snd_use_case_get_list()
191 uc_mgr->device_list_count = 0; in snd_use_case_get_list()
194 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_get_list()
195 uc_mgr->device_list_count = list_size; in snd_use_case_get_list()
197 uc_mgr->current_device_list = in snd_use_case_get_list()
199 if (uc_mgr->current_device_list == NULL) { in snd_use_case_get_list()
201 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
205 uc_mgr->current_device_list[index] = in snd_use_case_get_list()
206 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_get_list()
210 *list = (const char **)uc_mgr->current_device_list; in snd_use_case_get_list()
211 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
214 if (uc_mgr->modifier_list_count) { in snd_use_case_get_list()
215 for (index = 0; index < uc_mgr->modifier_list_count; index++) { in snd_use_case_get_list()
216 free(uc_mgr->current_modifier_list[index]); in snd_use_case_get_list()
217 uc_mgr->current_modifier_list[index] = NULL; in snd_use_case_get_list()
219 free(uc_mgr->current_modifier_list); in snd_use_case_get_list()
220 uc_mgr->current_modifier_list = NULL; in snd_use_case_get_list()
221 uc_mgr->modifier_list_count = 0; in snd_use_case_get_list()
224 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head); in snd_use_case_get_list()
225 uc_mgr->modifier_list_count = list_size; in snd_use_case_get_list()
227 uc_mgr->current_modifier_list = in snd_use_case_get_list()
229 if (uc_mgr->current_modifier_list == NULL) { in snd_use_case_get_list()
231 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
235 uc_mgr->current_modifier_list[index] = in snd_use_case_get_list()
236 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_get_list()
240 *list = (const char **)uc_mgr->current_modifier_list; in snd_use_case_get_list()
241 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
245 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get_list()
263 int snd_use_case_get(snd_use_case_mgr_t *uc_mgr, in snd_use_case_get() argument
272 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
273 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || in snd_use_case_get()
274 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL)) { in snd_use_case_get()
276 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
281 if (uc_mgr->card_ctxt_ptr->card_name != NULL) { in snd_use_case_get()
282 *value = strdup(uc_mgr->card_ctxt_ptr->card_name); in snd_use_case_get()
286 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
291 if (uc_mgr->card_ctxt_ptr->current_verb != NULL) { in snd_use_case_get()
292 *value = strdup(uc_mgr->card_ctxt_ptr->current_verb); in snd_use_case_get()
296 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
310 verb_index = uc_mgr->card_ctxt_ptr->current_verb_index; in snd_use_case_get()
311 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_get()
312 if((get_usecase_type(uc_mgr, ident2)) == CTRL_LIST_VERB) { in snd_use_case_get()
318 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get()
321 uc_mgr->card_ctxt_ptr->current_verb, verb_index); in snd_use_case_get()
322 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
366 if(uc_mgr->card_ctxt_ptr->control_device != NULL) { in snd_use_case_get()
367 *value = strdup(uc_mgr->card_ctxt_ptr->control_device); in snd_use_case_get()
376 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_get()
378 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get()
382 uc_mgr->card_ctxt_ptr->current_verb, verb_index); in snd_use_case_get()
383 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
412 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_get()
414 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_get()
418 uc_mgr->card_ctxt_ptr->current_verb, verb_index); in snd_use_case_get()
419 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
451 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_get()
463 int snd_use_case_geti(snd_use_case_mgr_t *uc_mgr, in snd_use_case_geti() argument
470 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_geti()
471 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || in snd_use_case_geti()
472 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL)) { in snd_use_case_geti()
474 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_geti()
488 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_geti()
491 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_geti()
511 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head); in snd_use_case_geti()
514 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_geti()
534 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_geti()
538 static int check_devices_for_voice_call(snd_use_case_mgr_t *uc_mgr, in check_devices_for_voice_call() argument
554 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in check_devices_for_voice_call()
557 snd_ucm_get_device_node(uc_mgr->card_ctxt_ptr->dev_list_head, in check_devices_for_voice_call()
578 static int snd_use_case_apply_voice_acdb(snd_use_case_mgr_t *uc_mgr, in snd_use_case_apply_voice_acdb() argument
586 if ((!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_apply_voice_acdb()
588 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_apply_voice_acdb()
595 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head); in snd_use_case_apply_voice_acdb()
598 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_apply_voice_acdb()
615 verb_index = uc_mgr->card_ctxt_ptr->current_verb_index; in snd_use_case_apply_voice_acdb()
617 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_apply_voice_acdb()
620 uc_mgr->card_ctxt_ptr->current_verb, verb_index); in snd_use_case_apply_voice_acdb()
625 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in snd_use_case_apply_voice_acdb()
627 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_apply_voice_acdb()
630 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_apply_voice_acdb()
669 if ((rx_id != uc_mgr->current_rx_device) || in snd_use_case_apply_voice_acdb()
670 (tx_id != uc_mgr->current_tx_device)) { in snd_use_case_apply_voice_acdb()
671 uc_mgr->current_rx_device = rx_id; in snd_use_case_apply_voice_acdb()
672 uc_mgr->current_tx_device = tx_id; in snd_use_case_apply_voice_acdb()
674 uc_mgr->current_rx_device, in snd_use_case_apply_voice_acdb()
675 uc_mgr->current_tx_device); in snd_use_case_apply_voice_acdb()
676 if (uc_mgr->acdb_handle && !uc_mgr->isFusion3Platform) { in snd_use_case_apply_voice_acdb()
677 … acdb_send_voice_cal = dlsym(uc_mgr->acdb_handle,"acdb_loader_send_voice_cal"); in snd_use_case_apply_voice_acdb()
681 acdb_send_voice_cal(uc_mgr->current_rx_device, in snd_use_case_apply_voice_acdb()
682 uc_mgr->current_tx_device); in snd_use_case_apply_voice_acdb()
687 rx id %d tx id %d", uc_mgr->current_rx_device, in snd_use_case_apply_voice_acdb()
688 uc_mgr->current_tx_device); in snd_use_case_apply_voice_acdb()
696 uc_mgr->current_rx_device = -1; uc_mgr->current_tx_device = -1; in snd_use_case_apply_voice_acdb()
702 int get_use_case_index(snd_use_case_mgr_t *uc_mgr, const char *use_case, in get_use_case_index() argument
709 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in get_use_case_index()
710 verb_index = uc_mgr->card_ctxt_ptr->current_verb_index; in get_use_case_index()
713 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].verb_ctrls; in get_use_case_index()
716 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in get_use_case_index()
719 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].mod_ctrls; in get_use_case_index()
724 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, SND_UCM_END_OF_LIST, 3)) || in get_use_case_index()
727 uc_mgr->card_ctxt_ptr->current_verb, verb_index); in get_use_case_index()
755 int snd_use_case_apply_mixer_controls(snd_use_case_mgr_t *uc_mgr, in snd_use_case_apply_mixer_controls() argument
763 verb_index = uc_mgr->card_ctxt_ptr->current_verb_index; in snd_use_case_apply_mixer_controls()
766 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].verb_ctrls; in snd_use_case_apply_mixer_controls()
769 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in snd_use_case_apply_mixer_controls()
772 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].mod_ctrls; in snd_use_case_apply_mixer_controls()
777 (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, SND_UCM_END_OF_LIST, 3)) || in snd_use_case_apply_mixer_controls()
780 uc_mgr->card_ctxt_ptr->current_verb, verb_index); in snd_use_case_apply_mixer_controls()
787 if (!uc_mgr->card_ctxt_ptr->mixer_handle) { in snd_use_case_apply_mixer_controls()
792 (check_devices_for_voice_call(uc_mgr, use_case) != NULL)) in snd_use_case_apply_mixer_controls()
797 if (snd_use_case_apply_voice_acdb(uc_mgr, uc_index)) { in snd_use_case_apply_mixer_controls()
801 if (uc_mgr->acdb_handle) { in snd_use_case_apply_mixer_controls()
802 … acdb_send_audio_cal = dlsym(uc_mgr->acdb_handle,"acdb_loader_send_audio_cal"); in snd_use_case_apply_mixer_controls()
825 ctl = mixer_get_control(uc_mgr->card_ctxt_ptr->mixer_handle, in snd_use_case_apply_mixer_controls()
854 uc_mgr->card_ctxt_ptr->mixer_handle, in snd_use_case_apply_mixer_controls()
957 static int set_controls_of_usecase_for_all_devices(snd_use_case_mgr_t *uc_mgr, in set_controls_of_usecase_for_all_devices() argument
966 if ((verb_index = uc_mgr->card_ctxt_ptr->current_verb_index) < 0) in set_controls_of_usecase_for_all_devices()
969 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in set_controls_of_usecase_for_all_devices()
972 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].verb_ctrls; in set_controls_of_usecase_for_all_devices()
975 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].mod_ctrls; in set_controls_of_usecase_for_all_devices()
980 list_size = snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in set_controls_of_usecase_for_all_devices()
983 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, index); in set_controls_of_usecase_for_all_devices()
985 uc_index = get_use_case_index(uc_mgr, current_device, in set_controls_of_usecase_for_all_devices()
996 uc_mgr->card_ctxt_ptr->dev_list_head, current_device)) { in set_controls_of_usecase_for_all_devices()
1000 ret = snd_use_case_apply_mixer_controls(uc_mgr, in set_controls_of_usecase_for_all_devices()
1004 uc_mgr->card_ctxt_ptr->dev_list_head, in set_controls_of_usecase_for_all_devices()
1008 snd_use_case_apply_voice_acdb(uc_mgr, uc_index); in set_controls_of_usecase_for_all_devices()
1015 get_use_case_index(uc_mgr, use_case, ctrl_list_type)) < 0) { in set_controls_of_usecase_for_all_devices()
1021 ret = snd_use_case_apply_mixer_controls(uc_mgr, use_case, in set_controls_of_usecase_for_all_devices()
1031 if ((uc_index = get_use_case_index(uc_mgr, ident, ctrl_list_type)) < 0) { in set_controls_of_usecase_for_all_devices()
1036 snd_use_case_apply_mixer_controls(uc_mgr, ident, enable, in set_controls_of_usecase_for_all_devices()
1051 static int set_controls_of_usecase_for_device(snd_use_case_mgr_t *uc_mgr, in set_controls_of_usecase_for_device() argument
1061 if ((verb_index = uc_mgr->card_ctxt_ptr->current_verb_index) < 0) in set_controls_of_usecase_for_device()
1064 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in set_controls_of_usecase_for_device()
1067 dev_index = get_use_case_index(uc_mgr, device, CTRL_LIST_DEVICE); in set_controls_of_usecase_for_device()
1070 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_usecase_for_device()
1071 ret = snd_use_case_apply_mixer_controls(uc_mgr, device, in set_controls_of_usecase_for_device()
1075 uc_mgr->card_ctxt_ptr->dev_list_head, device, enable, in set_controls_of_usecase_for_device()
1082 if ((uc_index = get_use_case_index(uc_mgr, use_case, ctrl_list_type)) < 0) { in set_controls_of_usecase_for_device()
1084 uc_index = get_use_case_index(uc_mgr, ident, ctrl_list_type); in set_controls_of_usecase_for_device()
1085 if (snd_use_case_apply_mixer_controls(uc_mgr, ident, enable, in set_controls_of_usecase_for_device()
1091 ret = snd_use_case_apply_mixer_controls(uc_mgr, use_case, enable, in set_controls_of_usecase_for_device()
1095 uc_index = get_use_case_index(uc_mgr, ident, ctrl_list_type); in set_controls_of_usecase_for_device()
1096 if (snd_use_case_apply_mixer_controls(uc_mgr, ident, enable, in set_controls_of_usecase_for_device()
1111 static int set_controls_of_device_for_all_usecases(snd_use_case_mgr_t *uc_mgr, in set_controls_of_device_for_all_usecases() argument
1120 if ((verb_index = uc_mgr->card_ctxt_ptr->current_verb_index) < 0) in set_controls_of_device_for_all_usecases()
1123 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in set_controls_of_device_for_all_usecases()
1124 dev_index = get_use_case_index(uc_mgr, device, CTRL_LIST_DEVICE); in set_controls_of_device_for_all_usecases()
1127 if (strncmp(uc_mgr->card_ctxt_ptr->current_verb, SND_USE_CASE_VERB_INACTIVE, in set_controls_of_device_for_all_usecases()
1130 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].verb_ctrls; in set_controls_of_device_for_all_usecases()
1132 capability == getUseCaseType(uc_mgr->card_ctxt_ptr->current_verb) || in set_controls_of_device_for_all_usecases()
1133 getUseCaseType(uc_mgr->card_ctxt_ptr->current_verb) == CAP_VOICE) { in set_controls_of_device_for_all_usecases()
1134 strlcpy(use_case, uc_mgr->card_ctxt_ptr->current_verb, in set_controls_of_device_for_all_usecases()
1138 get_use_case_index(uc_mgr, use_case, CTRL_LIST_VERB)) < 0) { in set_controls_of_device_for_all_usecases()
1144 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_device_for_all_usecases()
1145 ret = snd_use_case_apply_mixer_controls(uc_mgr, device, in set_controls_of_device_for_all_usecases()
1149 uc_mgr->card_ctxt_ptr->dev_list_head, device, in set_controls_of_device_for_all_usecases()
1155 ret = snd_use_case_apply_mixer_controls(uc_mgr, use_case, in set_controls_of_device_for_all_usecases()
1165 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_device_for_all_usecases()
1166 ret = snd_use_case_apply_mixer_controls(uc_mgr, in set_controls_of_device_for_all_usecases()
1170 uc_mgr->card_ctxt_ptr->dev_list_head, device, enable, in set_controls_of_device_for_all_usecases()
1176 strlcpy(use_case, uc_mgr->card_ctxt_ptr->current_verb, in set_controls_of_device_for_all_usecases()
1178 uc_index = get_use_case_index(uc_mgr, use_case, CTRL_LIST_VERB); in set_controls_of_device_for_all_usecases()
1181 getUseCaseType(uc_mgr->card_ctxt_ptr->current_verb) || in set_controls_of_device_for_all_usecases()
1182 getUseCaseType(uc_mgr->card_ctxt_ptr->current_verb) == in set_controls_of_device_for_all_usecases()
1185 ret = snd_use_case_apply_mixer_controls(uc_mgr, use_case, in set_controls_of_device_for_all_usecases()
1195 snd_ucm_print_list(uc_mgr->card_ctxt_ptr->mod_list_head); in set_controls_of_device_for_all_usecases()
1197 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].mod_ctrls; in set_controls_of_device_for_all_usecases()
1198 list_size = snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head); in set_controls_of_device_for_all_usecases()
1201 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->mod_list_head, in set_controls_of_device_for_all_usecases()
1208 if ((uc_index = get_use_case_index(uc_mgr, use_case, in set_controls_of_device_for_all_usecases()
1215 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_device_for_all_usecases()
1216 ret = snd_use_case_apply_mixer_controls(uc_mgr, in set_controls_of_device_for_all_usecases()
1221 uc_mgr->card_ctxt_ptr->dev_list_head, in set_controls_of_device_for_all_usecases()
1227 ret = snd_use_case_apply_mixer_controls(uc_mgr, in set_controls_of_device_for_all_usecases()
1237 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_device_for_all_usecases()
1238 ret = snd_use_case_apply_mixer_controls(uc_mgr, in set_controls_of_device_for_all_usecases()
1242 uc_mgr->card_ctxt_ptr->dev_list_head, device, in set_controls_of_device_for_all_usecases()
1250 get_use_case_index(uc_mgr, ident_value, CTRL_LIST_MODIFIER); in set_controls_of_device_for_all_usecases()
1255 ret = snd_use_case_apply_mixer_controls(uc_mgr, use_case, in set_controls_of_device_for_all_usecases()
1268 ret = snd_use_case_apply_mixer_controls(uc_mgr, device, enable, in set_controls_of_device_for_all_usecases()
1271 snd_ucm_set_status_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in set_controls_of_device_for_all_usecases()
1282 static int get_usecase_type(snd_use_case_mgr_t *uc_mgr, const char *usecase) in get_usecase_type() argument
1286 while (strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in get_usecase_type()
1288 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], usecase, in get_usecase_type()
1308 static int set_controls_of_device_for_usecase(snd_use_case_mgr_t *uc_mgr, in set_controls_of_device_for_usecase() argument
1317 if ((verb_index = uc_mgr->card_ctxt_ptr->current_verb_index) < 0) in set_controls_of_device_for_usecase()
1320 uc_mgr->card_ctxt_ptr->use_case_verb_list[verb_index].device_ctrls; in set_controls_of_device_for_usecase()
1321 dev_index = get_use_case_index(uc_mgr, device, CTRL_LIST_DEVICE); in set_controls_of_device_for_usecase()
1326 if ((uc_index = get_use_case_index(uc_mgr, use_case, in set_controls_of_device_for_usecase()
1327 get_usecase_type(uc_mgr, usecase))) < 0) { in set_controls_of_device_for_usecase()
1332 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_device_for_usecase()
1333 ret = snd_use_case_apply_mixer_controls(uc_mgr, device, in set_controls_of_device_for_usecase()
1337 (uc_mgr->card_ctxt_ptr->dev_list_head, device, enable, in set_controls_of_device_for_usecase()
1342 ret = snd_use_case_apply_mixer_controls(uc_mgr, use_case, enable, in set_controls_of_device_for_usecase()
1343 get_usecase_type(uc_mgr, usecase), uc_index); in set_controls_of_device_for_usecase()
1352 uc_mgr->card_ctxt_ptr->dev_list_head, device)) { in set_controls_of_device_for_usecase()
1353 ret = snd_use_case_apply_mixer_controls(uc_mgr, device, enable, in set_controls_of_device_for_usecase()
1357 uc_mgr->card_ctxt_ptr->dev_list_head, device, enable, in set_controls_of_device_for_usecase()
1363 ret = snd_use_case_apply_mixer_controls(uc_mgr, device, enable, in set_controls_of_device_for_usecase()
1366 snd_ucm_set_status_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in set_controls_of_device_for_usecase()
1380 int snd_use_case_set(snd_use_case_mgr_t *uc_mgr, in snd_use_case_set() argument
1388 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set()
1389 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || (value == NULL) || in snd_use_case_set()
1390 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL) || in snd_use_case_set()
1393 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set()
1397 ALOGD("snd_use_case_set(): uc_mgr %p identifier %s value %s", uc_mgr, in snd_use_case_set()
1410 &uc_mgr->card_ctxt_ptr->dev_list_head, ident2); in snd_use_case_set()
1418 ret = set_controls_of_device_for_all_usecases(uc_mgr, in snd_use_case_set()
1426 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set()
1427 ret = snd_use_case_set(uc_mgr, "_enadev", value); in snd_use_case_set()
1434 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set()
1439 ret = snd_use_case_set(uc_mgr, "_dismod", ident2); in snd_use_case_set()
1445 ret = snd_use_case_set(uc_mgr, "_enamod", value); in snd_use_case_set()
1459 while (strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in snd_use_case_set()
1461 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], value, in snd_use_case_set()
1473 uc_mgr->card_ctxt_ptr->verb_list[index]); in snd_use_case_set()
1476 if (strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_set()
1479 ret = set_controls_of_usecase_for_all_devices(uc_mgr, in snd_use_case_set()
1480 uc_mgr->card_ctxt_ptr->current_verb, 0, CTRL_LIST_VERB); in snd_use_case_set()
1483 uc_mgr->card_ctxt_ptr->current_verb); in snd_use_case_set()
1485 strlcpy(uc_mgr->card_ctxt_ptr->current_verb, value, MAX_STR_LEN); in snd_use_case_set()
1488 if (strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_set()
1491 uc_mgr->card_ctxt_ptr->current_verb_index = index; in snd_use_case_set()
1492 ret = set_controls_of_usecase_for_all_devices(uc_mgr, in snd_use_case_set()
1493 uc_mgr->card_ctxt_ptr->current_verb, 1, CTRL_LIST_VERB); in snd_use_case_set()
1499 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_set()
1502 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set()
1515 snd_ucm_add_ident_to_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set()
1518 snd_ucm_print_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_set()
1520 ret = set_controls_of_device_for_all_usecases(uc_mgr, value, 1); in snd_use_case_set()
1522 ret = snd_ucm_get_status_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set()
1529 snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set()
1536 snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set()
1542 index = get_use_case_index(uc_mgr, value, CTRL_LIST_DEVICE); in snd_use_case_set()
1544 ret = snd_use_case_apply_mixer_controls(uc_mgr, value, 0, in snd_use_case_set()
1550 verb_index = uc_mgr->card_ctxt_ptr->current_verb_index; in snd_use_case_set()
1555 uc_mgr->card_ctxt_ptr->verb_list[verb_index]); in snd_use_case_set()
1556 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_set()
1569 snd_ucm_add_ident_to_list(&uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_set()
1573 ret = set_controls_of_usecase_for_all_devices(uc_mgr, value, 1, in snd_use_case_set()
1578 ret = snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_set()
1586 ret = set_controls_of_usecase_for_all_devices(uc_mgr, value, 0, in snd_use_case_set()
1592 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set()
1605 int snd_use_case_set_case(snd_use_case_mgr_t *uc_mgr, in snd_use_case_set_case() argument
1613 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set_case()
1614 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || (value == NULL) || in snd_use_case_set_case()
1615 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL) || in snd_use_case_set_case()
1618 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set_case()
1623 uc_mgr, identifier, value); in snd_use_case_set_case()
1635 &uc_mgr->card_ctxt_ptr->dev_list_head, ident2); in snd_use_case_set_case()
1643 ret = set_controls_of_device_for_usecase(uc_mgr, ident2, in snd_use_case_set_case()
1651 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set_case()
1652 ret = snd_use_case_set_case(uc_mgr, "_enadev", value, usecase); in snd_use_case_set_case()
1659 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set_case()
1664 ret = snd_use_case_set_case(uc_mgr, "_dismod", ident2, usecase); in snd_use_case_set_case()
1670 ret = snd_use_case_set_case(uc_mgr, "_enamod", value, usecase); in snd_use_case_set_case()
1684 while (strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in snd_use_case_set_case()
1686 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in snd_use_case_set_case()
1698 uc_mgr->card_ctxt_ptr->verb_list[index]); in snd_use_case_set_case()
1701 if (strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_set_case()
1703 ret = set_controls_of_usecase_for_device(uc_mgr, in snd_use_case_set_case()
1704 uc_mgr->card_ctxt_ptr->current_verb, usecase, in snd_use_case_set_case()
1708 uc_mgr->card_ctxt_ptr->current_verb); in snd_use_case_set_case()
1710 strlcpy(uc_mgr->card_ctxt_ptr->current_verb, value, MAX_STR_LEN); in snd_use_case_set_case()
1713 if (strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_set_case()
1715 uc_mgr->card_ctxt_ptr->current_verb_index = index; in snd_use_case_set_case()
1718 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_set_case()
1721 uc_mgr->card_ctxt_ptr->dev_list_head, index))) { in snd_use_case_set_case()
1733 snd_ucm_add_ident_to_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1736 ret = set_controls_of_usecase_for_device(uc_mgr, in snd_use_case_set_case()
1737 uc_mgr->card_ctxt_ptr->current_verb, usecase, in snd_use_case_set_case()
1744 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_set_case()
1747 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1759 snd_ucm_add_ident_to_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1762 snd_ucm_print_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_set_case()
1764 ret = set_controls_of_device_for_usecase(uc_mgr, value, usecase, 1); in snd_use_case_set_case()
1766 ret = snd_ucm_get_status_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1773 snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1780 snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1787 ret = set_controls_of_device_for_usecase(uc_mgr, value, in snd_use_case_set_case()
1792 if (!strncmp(uc_mgr->card_ctxt_ptr->current_verb, in snd_use_case_set_case()
1798 while(strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in snd_use_case_set_case()
1799 uc_mgr->card_ctxt_ptr->current_verb, MAX_STR_LEN)) { in snd_use_case_set_case()
1800 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], in snd_use_case_set_case()
1812 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_use_case_set_case()
1814 uc_mgr->card_ctxt_ptr->verb_list[verb_index]); in snd_use_case_set_case()
1829 snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_set_case()
1832 uc_mgr->card_ctxt_ptr->dev_list_head, index))) { in snd_use_case_set_case()
1844 snd_ucm_add_ident_to_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_set_case()
1847 snd_ucm_add_ident_to_list(&uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_set_case()
1851 ret = set_controls_of_usecase_for_device(uc_mgr, value, in snd_use_case_set_case()
1856 ret = snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_set_case()
1864 ret = set_controls_of_usecase_for_device(uc_mgr, value, usecase, in snd_use_case_set_case()
1870 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_set_case()
1880 int snd_use_case_mgr_open(snd_use_case_mgr_t **uc_mgr, const char *card_name) in snd_use_case_mgr_open() argument
1974 *uc_mgr = uc_mgr_ptr; in snd_use_case_mgr_open()
1986 int snd_use_case_mgr_reload(snd_use_case_mgr_t *uc_mgr) { in snd_use_case_mgr_reload() argument
1996 int snd_use_case_mgr_close(snd_use_case_mgr_t *uc_mgr) in snd_use_case_mgr_close() argument
2000 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || in snd_use_case_mgr_close()
2001 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL)) { in snd_use_case_mgr_close()
2006 ALOGV("snd_use_case_close(): instance %p", uc_mgr); in snd_use_case_mgr_close()
2007 ret = snd_use_case_mgr_reset(uc_mgr); in snd_use_case_mgr_close()
2010 snd_ucm_free_mixer_list(&uc_mgr); in snd_use_case_mgr_close()
2011 pthread_mutexattr_destroy(&uc_mgr->card_ctxt_ptr->card_lock_attr); in snd_use_case_mgr_close()
2012 pthread_mutex_destroy(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_mgr_close()
2013 if (uc_mgr->card_ctxt_ptr->mixer_handle) { in snd_use_case_mgr_close()
2014 mixer_close(uc_mgr->card_ctxt_ptr->mixer_handle); in snd_use_case_mgr_close()
2015 uc_mgr->card_ctxt_ptr->mixer_handle = NULL; in snd_use_case_mgr_close()
2017 uc_mgr->snd_card_index = -1; in snd_use_case_mgr_close()
2018 uc_mgr->current_tx_device = -1; in snd_use_case_mgr_close()
2019 uc_mgr->current_rx_device = -1; in snd_use_case_mgr_close()
2020 free(uc_mgr->card_ctxt_ptr->control_device); in snd_use_case_mgr_close()
2021 free(uc_mgr->card_ctxt_ptr->card_name); in snd_use_case_mgr_close()
2022 free(uc_mgr->card_ctxt_ptr); in snd_use_case_mgr_close()
2023 uc_mgr->card_ctxt_ptr = NULL; in snd_use_case_mgr_close()
2024 free(uc_mgr); in snd_use_case_mgr_close()
2025 uc_mgr = NULL; in snd_use_case_mgr_close()
2035 int snd_use_case_mgr_reset(snd_use_case_mgr_t *uc_mgr) in snd_use_case_mgr_reset() argument
2040 ALOGV("snd_use_case_reset(): instance %p", uc_mgr); in snd_use_case_mgr_reset()
2041 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_mgr_reset()
2042 if ((uc_mgr->snd_card_index >= (int)MAX_NUM_CARDS) || in snd_use_case_mgr_reset()
2043 (uc_mgr->snd_card_index < 0) || (uc_mgr->card_ctxt_ptr == NULL)) { in snd_use_case_mgr_reset()
2045 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_mgr_reset()
2050 list_size = snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->mod_list_head); in snd_use_case_mgr_reset()
2053 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_mgr_reset()
2055 snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->mod_list_head, in snd_use_case_mgr_reset()
2057 ret = set_controls_of_usecase_for_all_devices(uc_mgr, in snd_use_case_mgr_reset()
2065 if (uc_mgr->modifier_list_count) { in snd_use_case_mgr_reset()
2066 for (index = 0; index < uc_mgr->modifier_list_count; index++) { in snd_use_case_mgr_reset()
2067 free(uc_mgr->current_modifier_list[index]); in snd_use_case_mgr_reset()
2068 uc_mgr->current_modifier_list[index] = NULL; in snd_use_case_mgr_reset()
2070 free(uc_mgr->current_modifier_list); in snd_use_case_mgr_reset()
2071 uc_mgr->current_modifier_list = NULL; in snd_use_case_mgr_reset()
2072 uc_mgr->modifier_list_count = 0; in snd_use_case_mgr_reset()
2075 if(strncmp(uc_mgr->card_ctxt_ptr->current_verb, SND_USE_CASE_VERB_INACTIVE, in snd_use_case_mgr_reset()
2077 ret = set_controls_of_usecase_for_all_devices(uc_mgr, in snd_use_case_mgr_reset()
2078 uc_mgr->card_ctxt_ptr->current_verb, 0, CTRL_LIST_VERB); in snd_use_case_mgr_reset()
2081 uc_mgr->card_ctxt_ptr->current_verb); in snd_use_case_mgr_reset()
2082 strlcpy(uc_mgr->card_ctxt_ptr->current_verb, SND_USE_CASE_VERB_INACTIVE, in snd_use_case_mgr_reset()
2086 list_size = snd_ucm_get_size_of_list(uc_mgr->card_ctxt_ptr->dev_list_head); in snd_use_case_mgr_reset()
2089 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_mgr_reset()
2091 snd_ucm_del_ident_from_list(&uc_mgr->card_ctxt_ptr->dev_list_head, in snd_use_case_mgr_reset()
2093 ret = set_controls_of_device_for_all_usecases(uc_mgr, in snd_use_case_mgr_reset()
2102 if (uc_mgr->device_list_count) { in snd_use_case_mgr_reset()
2103 for (index = 0; index < uc_mgr->device_list_count; index++) { in snd_use_case_mgr_reset()
2104 free(uc_mgr->current_device_list[index]); in snd_use_case_mgr_reset()
2105 uc_mgr->current_device_list[index] = NULL; in snd_use_case_mgr_reset()
2107 free(uc_mgr->current_device_list); in snd_use_case_mgr_reset()
2108 uc_mgr->current_device_list = NULL; in snd_use_case_mgr_reset()
2109 uc_mgr->device_list_count = 0; in snd_use_case_mgr_reset()
2111 uc_mgr->current_tx_device = -1; in snd_use_case_mgr_reset()
2112 uc_mgr->current_rx_device = -1; in snd_use_case_mgr_reset()
2113 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_use_case_mgr_reset()
2126 snd_use_case_mgr_t **uc_mgr = (snd_use_case_mgr_t **)&uc_mgr_ptr; in second_stage_parsing_thread() local
2129 strlcat(path, (*uc_mgr)->card_ctxt_ptr->card_name, sizeof(path)); in second_stage_parsing_thread()
2206 verb_list = (*uc_mgr)->card_ctxt_ptr->use_case_verb_list; in second_stage_parsing_thread()
2208 ret = snd_ucm_parse_verb(uc_mgr, file_name, index); in second_stage_parsing_thread()
2218 if((*uc_mgr)->card_ctxt_ptr->verb_list[index]) { in second_stage_parsing_thread()
2219 free((*uc_mgr)->card_ctxt_ptr->verb_list[index]); in second_stage_parsing_thread()
2220 (*uc_mgr)->card_ctxt_ptr->verb_list[index] = NULL; in second_stage_parsing_thread()
2222 (*uc_mgr)->card_ctxt_ptr->verb_list[index] = in second_stage_parsing_thread()
2224 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], verb_name, in second_stage_parsing_thread()
2232 (*uc_mgr)->card_ctxt_ptr->verb_list[index] = in second_stage_parsing_thread()
2234 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], in second_stage_parsing_thread()
2253 snd_ucm_print((*uc_mgr)); in second_stage_parsing_thread()
2257 ALOGE("Exiting parsing thread uc_mgr %p\n", uc_mgr); in second_stage_parsing_thread()
2265 int snd_use_case_mgr_wait_for_parsing(snd_use_case_mgr_t *uc_mgr) in snd_use_case_mgr_wait_for_parsing() argument
2269 ret = pthread_join(uc_mgr->thr, NULL); in snd_use_case_mgr_wait_for_parsing()
2278 static int snd_ucm_parse(snd_use_case_mgr_t **uc_mgr) in snd_ucm_parse() argument
2288 strlcat(path, (*uc_mgr)->card_ctxt_ptr->card_name, sizeof(path)); in snd_ucm_parse()
2309 (*uc_mgr)->card_ctxt_ptr->use_case_verb_list = in snd_ucm_parse()
2311 if ((*uc_mgr)->card_ctxt_ptr->use_case_verb_list == NULL) { in snd_ucm_parse()
2317 if (((*uc_mgr)->card_ctxt_ptr->verb_list = in snd_ucm_parse()
2327 ret = parse_single_config_format(uc_mgr, current_str, verb_count); in snd_ucm_parse()
2345 verb_list = (*uc_mgr)->card_ctxt_ptr->use_case_verb_list; in snd_ucm_parse()
2365 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] = in snd_ucm_parse()
2367 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], in snd_ucm_parse()
2397 ret = snd_ucm_parse_verb(uc_mgr, file_name, index); in snd_ucm_parse()
2418 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] = in snd_ucm_parse()
2420 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], SND_UCM_END_OF_LIST, in snd_ucm_parse()
2427 ALOGD("Creating Parsing thread uc_mgr %p\n", uc_mgr); in snd_ucm_parse()
2428 rc = pthread_create(&(*uc_mgr)->thr, 0, second_stage_parsing_thread, in snd_ucm_parse()
2429 (void*)(*uc_mgr)); in snd_ucm_parse()
2448 static int parse_single_config_format(snd_use_case_mgr_t **uc_mgr, in parse_single_config_format() argument
2457 verb_list = (*uc_mgr)->card_ctxt_ptr->use_case_verb_list; in parse_single_config_format()
2498 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] = in parse_single_config_format()
2500 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], in parse_single_config_format()
2525 ret = snd_ucm_parse_section(uc_mgr, ¤t_str, in parse_single_config_format()
2544 ret = snd_ucm_parse_section(uc_mgr, ¤t_str, in parse_single_config_format()
2577 ret = snd_ucm_parse_section(uc_mgr, ¤t_str, in parse_single_config_format()
2619 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] = in parse_single_config_format()
2621 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], in parse_single_config_format()
2697 snd_ucm_print((*uc_mgr)); in parse_single_config_format()
2870 static int snd_ucm_parse_verb(snd_use_case_mgr_t **uc_mgr, in snd_ucm_parse_verb() argument
2884 verb_list = (*uc_mgr)->card_ctxt_ptr->use_case_verb_list; in snd_ucm_parse_verb()
2924 ret = snd_ucm_parse_section(uc_mgr, ¤t_str, in snd_ucm_parse_verb()
2934 ret = snd_ucm_parse_section(uc_mgr, ¤t_str, in snd_ucm_parse_verb()
2958 ret = snd_ucm_parse_section(uc_mgr, ¤t_str, in snd_ucm_parse_verb()
3132 static int snd_ucm_print(snd_use_case_mgr_t *uc_mgr) in snd_ucm_print() argument
3138 pthread_mutex_lock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_ucm_print()
3139 verb_list = uc_mgr->card_ctxt_ptr->use_case_verb_list; in snd_ucm_print()
3140 while(strncmp(uc_mgr->card_ctxt_ptr->verb_list[verb_index], in snd_ucm_print()
3143 uc_mgr->card_ctxt_ptr->verb_list[verb_index]); in snd_ucm_print()
3173 pthread_mutex_unlock(&uc_mgr->card_ctxt_ptr->card_lock); in snd_ucm_print()
3214 static int snd_ucm_parse_section(snd_use_case_mgr_t **uc_mgr, char **cur_str, in snd_ucm_parse_section() argument
3222 verb_list = (*uc_mgr)->card_ctxt_ptr->use_case_verb_list; in snd_ucm_parse_section()
3645 void snd_ucm_free_mixer_list(snd_use_case_mgr_t **uc_mgr) in snd_ucm_free_mixer_list() argument
3651 pthread_mutex_lock(&(*uc_mgr)->card_ctxt_ptr->card_lock); in snd_ucm_free_mixer_list()
3652 verb_list = (*uc_mgr)->card_ctxt_ptr->use_case_verb_list; in snd_ucm_free_mixer_list()
3653 while(strncmp((*uc_mgr)->card_ctxt_ptr->verb_list[verb_index], in snd_ucm_free_mixer_list()
3659 if((*uc_mgr)->card_ctxt_ptr->verb_list[verb_index]) { in snd_ucm_free_mixer_list()
3660 free((*uc_mgr)->card_ctxt_ptr->verb_list[verb_index]); in snd_ucm_free_mixer_list()
3699 if((*uc_mgr)->card_ctxt_ptr->use_case_verb_list) in snd_ucm_free_mixer_list()
3700 free((*uc_mgr)->card_ctxt_ptr->use_case_verb_list); in snd_ucm_free_mixer_list()
3701 if((*uc_mgr)->card_ctxt_ptr->verb_list) in snd_ucm_free_mixer_list()
3702 free((*uc_mgr)->card_ctxt_ptr->verb_list); in snd_ucm_free_mixer_list()
3703 pthread_mutex_unlock(&(*uc_mgr)->card_ctxt_ptr->card_lock); in snd_ucm_free_mixer_list()