Lines Matching refs:index

110     int verb_index, list_size, index = 0;
126 while(strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
128 ALOGV("Index:%d Verb:%s", index,
129 uc_mgr->card_ctxt_ptr->verb_list[index]);
130 index++;
134 return index;
144 verb_list[index].use_case_name,
145 (strlen(verb_list[index].use_case_name)+1))) {
146 index++;
148 verb_index = index;
149 index = 0;
150 while(strncmp(verb_list[verb_index].device_list[index],
152 ALOGV("Index:%d Device:%s", index,
153 verb_list[verb_index].device_list[index]);
154 index++;
158 return index;
168 verb_list[index].use_case_name,
169 (strlen(verb_list[index].use_case_name)+1))) {
170 index++;
172 verb_index = index;
173 index = 0;
174 while(strncmp(verb_list[verb_index].modifier_list[index],
176 ALOGV("Index:%d Modifier:%s", index,
177 verb_list[verb_index].modifier_list[index]);
178 index++;
182 return index;
185 for (index = 0; index < uc_mgr->device_list_count; index++) {
186 free(uc_mgr->current_device_list[index]);
187 uc_mgr->current_device_list[index] = NULL;
204 for (index = 0; index < list_size; index++) {
205 uc_mgr->current_device_list[index] =
207 index);
215 for (index = 0; index < uc_mgr->modifier_list_count; index++) {
216 free(uc_mgr->current_modifier_list[index]);
217 uc_mgr->current_modifier_list[index] = NULL;
234 for (index = 0; index < list_size; index++) {
235 uc_mgr->current_modifier_list[index] =
237 index);
270 int index, verb_index = 0, ret = 0;
308 index = 0;
325 while(strncmp(ctrl_list[index].case_name, ident2,
327 if (!strncmp(ctrl_list[index].case_name,
333 index++;
344 if (ctrl_list[index].playback_dev_name) {
345 *value = strdup(ctrl_list[index].playback_dev_name);
351 if (ctrl_list[index].capture_dev_name) {
352 *value = strdup(ctrl_list[index].capture_dev_name);
375 index = 0; verb_index = 0;
388 while(strncmp(ctrl_list[index].case_name, ident2,
389 MAX_LEN(ctrl_list[index].case_name,ident2))) {
390 if (!strncmp(ctrl_list[index].case_name, SND_UCM_END_OF_LIST,
395 index++;
403 if (verb_list[verb_index].device_ctrls[index].acdb_id) {
404 ret = verb_list[verb_index].device_ctrls[index].acdb_id;
411 index = 0; verb_index = 0;
424 while(strncmp(ctrl_list[index].case_name, ident2, strlen(ident2)+1)) {
425 if (!strncmp(ctrl_list[index].case_name, SND_UCM_END_OF_LIST,
430 index++;
438 if (verb_list[verb_index].device_ctrls[index].effects_mixer_ctl) {
439 *value = strdup(verb_list[verb_index].device_ctrls[index].effects_mixer_ctl);
468 int index, list_size, ret = -EINVAL;
489 for (index = 0; index < list_size; index++) {
492 index))) {
512 for (index = 0; index < list_size; index++) {
515 index))) {
542 int index = 0, list_size = 0, rx_dev_status = 0, tx_dev_status = 0;
555 for (index = 0; index < list_size; index++) {
558 index))) {
582 int list_size, index, verb_index, ret = 0, voice_acdb = 0, rx_id, tx_id;
596 for (index = 0; index < list_size; index++) {
599 index))) {
628 for (index = 0; index < list_size; index++) {
631 index))) {
640 index = 0;
642 while(strncmp(ctrl_list[index].case_name, ident_value,
644 if (!strncmp(ctrl_list[index].case_name, SND_UCM_END_OF_LIST,
649 index++;
656 tx_id = ctrl_list[index].acdb_id;
658 rx_id = ctrl_list[index].acdb_id;
707 int ret = 0, index = 0, verb_index;
725 (ctrl_list == NULL) || (ctrl_list[index].case_name == NULL)) {
730 while(strncmp(ctrl_list[index].case_name, use_case, (strlen(use_case)+1))) {
731 if (!strncmp(ctrl_list[index].case_name, SND_UCM_END_OF_LIST,
736 index++;
737 if (ctrl_list[index].case_name == NULL) {
738 ALOGE("Invalid case_name at index %d", index);
746 return index;
761 int i, ret = 0, index = 0, verb_index, mixer_count;
820 for(index = 0; index < mixer_count; index++) {
826 mixer_list[index].control_name, 0);
828 if (mixer_list[index].type == TYPE_INT) {
830 mixer_list[index].control_name,
831 mixer_list[index].value);
832 ret = mixer_ctl_set(ctl, mixer_list[index].value);
833 } else if (mixer_list[index].type == TYPE_MULTI_VAL) {
835 mixer_list[index].control_name);
836 ret = mixer_ctl_set_value(ctl, mixer_list[index].value,
837 mixer_list[index].mulval);
840 mixer_list[index].control_name);
843 mixer_list[index].control_name,
844 mixer_list[index].string);
845 ret = mixer_ctl_select(ctl, mixer_list[index].string);
962 int list_size, index, uc_index, ret = 0, intdev_flag = 0;
981 for (index = 0; index < list_size; index++) {
983 snd_ucm_get_value_at_index(uc_mgr->card_ctxt_ptr->dev_list_head, index);
1056 int list_size, index, dev_index, uc_index, ret = 0;
1117 int list_size, index = 0, ret = -ENODEV, flag = 0, intdev_flag = 0;
1199 for (index = 0; index < list_size; index++) {
1202 index))) {
1284 int ret = -EINVAL, index = 0;
1286 while (strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
1288 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], usecase,
1293 index++;
1386 int verb_index, list_size, index = 0, ret = -EINVAL;
1459 while (strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
1461 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index], value,
1466 index++;
1472 ALOGV("Index:%d Verb:%s", index,
1473 uc_mgr->card_ctxt_ptr->verb_list[index]);
1491 uc_mgr->card_ctxt_ptr->current_verb_index = index;
1497 index = 0; ret = 0;
1500 for (index = 0; index < list_size; index++) {
1503 index))) {
1513 if (index == list_size) {
1542 index = get_use_case_index(uc_mgr, value, CTRL_LIST_DEVICE);
1545 CTRL_LIST_DEVICE, index);
1549 index = 0; ret = 0;
1557 while(strncmp(verb_list[verb_index].modifier_list[index], value,
1559 if (!strncmp(verb_list[verb_index].modifier_list[index],
1564 index++;
1611 int verb_index, list_size, index = 0, ret = -EINVAL;
1684 while (strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
1686 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
1691 index++;
1697 ALOGV("Index:%d Verb:%s", index,
1698 uc_mgr->card_ctxt_ptr->verb_list[index]);
1715 uc_mgr->card_ctxt_ptr->current_verb_index = index;
1716 index = 0;
1719 for (index = 0; index < list_size; index++) {
1721 uc_mgr->card_ctxt_ptr->dev_list_head, index))) {
1731 if (index == list_size) {
1742 index = 0; ret = 0;
1745 for (index = 0; index < list_size; index++) {
1748 index))) {
1757 if (index == list_size) {
1798 while(strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
1800 if (!strncmp(uc_mgr->card_ctxt_ptr->verb_list[index],
1805 index++;
1811 verb_index = index; index = 0; ret = 0;
1815 while(strncmp(verb_list[verb_index].modifier_list[index],
1817 if (!strncmp(verb_list[verb_index].modifier_list[index],
1822 index++;
1827 index = 0;
1830 for (index = 0; index < list_size; index++) {
1832 uc_mgr->card_ctxt_ptr->dev_list_head, index))) {
1842 if (index == list_size) {
1883 int index, ret = -EINVAL;
1893 for (index = 0; index < (int)MAX_NUM_CARDS; index++) {
1894 if(!strncmp(card_name, card_mapping_list[index].card_name,
1895 (strlen(card_mapping_list[index].card_name)+1))) {
1910 uc_mgr_ptr->snd_card_index = index;
1920 card_mapping_list[index].card_number;
2038 int index, list_size, ret = 0;
2051 for (index = (list_size-1); index >= 0; index--) {
2054 index))) {
2066 for (index = 0; index < uc_mgr->modifier_list_count; index++) {
2067 free(uc_mgr->current_modifier_list[index]);
2068 uc_mgr->current_modifier_list[index] = NULL;
2087 for (index = (list_size-1); index >= 0; index--) {
2090 index))) {
2103 for (index = 0; index < uc_mgr->device_list_count; index++) {
2104 free(uc_mgr->current_device_list[index]);
2105 uc_mgr->current_device_list[index] = NULL;
2123 int fd, index = 0, ret = 0, rc = 0;
2165 if (index == 0) {
2166 index++;
2208 ret = snd_ucm_parse_verb(uc_mgr, file_name, index);
2209 verb_list[index].use_case_name =
2211 strlcpy(verb_list[index].use_case_name, verb_name,
2218 if((*uc_mgr)->card_ctxt_ptr->verb_list[index]) {
2219 free((*uc_mgr)->card_ctxt_ptr->verb_list[index]);
2220 (*uc_mgr)->card_ctxt_ptr->verb_list[index] = NULL;
2222 (*uc_mgr)->card_ctxt_ptr->verb_list[index] =
2224 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], verb_name,
2231 index++;
2232 (*uc_mgr)->card_ctxt_ptr->verb_list[index] =
2234 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index],
2282 int fd, verb_count, index = 0, ret = 0, rc;
2357 if ((verb_list[index].use_case_name =
2359 strlcpy(verb_list[index].use_case_name,
2365 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] =
2367 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index],
2397 ret = snd_ucm_parse_verb(uc_mgr, file_name, index);
2405 index++;
2418 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] =
2420 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index], SND_UCM_END_OF_LIST,
2454 int verb_count = 0, device_count = 0, mod_count = 0, index = -1, ret = 0;
2464 if (index != -1) {
2465 list = (verb_list[index].verb_ctrls +
2466 verb_list[index].verb_count);
2470 free(verb_list[index].verb_ctrls);
2484 index++;
2490 if ((verb_list[index].use_case_name =
2492 strlcpy(verb_list[index].use_case_name,
2498 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] =
2500 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index],
2508 verb_list[index].verb_count = 0;
2509 verb_list[index].device_count = 0;
2510 verb_list[index].mod_count = 0;
2511 verb_list[index].device_list = NULL;
2512 verb_list[index].modifier_list = NULL;
2513 verb_list[index].verb_ctrls = NULL;
2514 verb_list[index].device_ctrls = NULL;
2515 verb_list[index].mod_ctrls = NULL;
2517 verb_list[index].verb_ctrls = (card_mctrl_t *)
2519 if (verb_list[index].verb_ctrls == NULL) {
2523 verb_list[index].verb_count = 0;
2526 &next_str, index, CTRL_LIST_VERB);
2599 list = (verb_list[index].verb_ctrls +
2600 verb_list[index].verb_count);
2604 free(verb_list[index].verb_ctrls);
2617 index++;
2618 if (index != -1) {
2619 if (((*uc_mgr)->card_ctxt_ptr->verb_list[index] =
2621 strlcpy((*uc_mgr)->card_ctxt_ptr->verb_list[index],
2683 for (index = 1; index < num_verbs; index++) {
2684 verb_list[index].device_ctrls = verb_list[0].device_ctrls;
2685 verb_list[index].device_list = verb_list[0].device_list;
2686 verb_list[index].device_count = verb_list[0].device_count;
2687 verb_list[index].mod_ctrls = verb_list[0].mod_ctrls;
2688 verb_list[index].modifier_list = verb_list[0].modifier_list;
2689 verb_list[index].mod_count = verb_list[0].mod_count;
2867 * index - index of the verb in the list
2871 const char *file_name, int index)
2888 verb_list[index].verb_count = 0;
2889 verb_list[index].device_count = 0;
2890 verb_list[index].mod_count = 0;
2891 verb_list[index].device_list = NULL;
2892 verb_list[index].modifier_list = NULL;
2893 verb_list[index].verb_ctrls = NULL;
2894 verb_list[index].device_ctrls = NULL;
2895 verb_list[index].mod_ctrls = NULL;
2922 verb_list[index].verb_count++;
2925 &next_str, index, CTRL_LIST_VERB);
2931 verb_list[index].device_count++;
2935 &next_str, index, CTRL_LIST_DEVICE);
2939 list = (verb_list[index].device_ctrls +
2940 (verb_list[index].device_count - 1));
2949 verb_list[index].device_list[device_count] = verb_ptr;
2955 verb_list[index].mod_count++;
2959 &next_str, index, CTRL_LIST_MODIFIER);
2963 list = (verb_list[index].mod_ctrls +
2964 (verb_list[index].mod_count - 1));
2973 verb_list[index].modifier_list[modifier_count]
2987 verb_list[index].device_list =
2989 if (verb_list[index].device_list == NULL)
2991 verb_list[index].modifier_list =
2993 if (verb_list[index].modifier_list == NULL)
2995 parse_count += verb_list[index].verb_count;
2996 verb_list[index].verb_ctrls = (card_mctrl_t *)
2997 malloc((verb_list[index].verb_count+1)*sizeof(card_mctrl_t));
2998 if (verb_list[index].verb_ctrls == NULL) {
3002 verb_list[index].verb_count = 0;
3003 parse_count += verb_list[index].device_count;
3004 verb_list[index].device_ctrls = (card_mctrl_t *)
3005 malloc((verb_list[index].device_count+1)*sizeof(card_mctrl_t));
3006 if (verb_list[index].device_ctrls == NULL) {
3010 verb_list[index].device_count = 0;
3011 parse_count += verb_list[index].mod_count;
3012 verb_list[index].mod_ctrls = (card_mctrl_t *)
3013 malloc((verb_list[index].mod_count+1)*sizeof(card_mctrl_t));
3014 if (verb_list[index].mod_ctrls == NULL) {
3018 verb_list[index].mod_count = 0;
3027 verb_list[index].device_list[device_count] = verb_ptr;
3034 verb_list[index].modifier_list[modifier_count] = verb_ptr;
3035 list = (verb_list[index].verb_ctrls +
3036 verb_list[index].verb_count);
3040 free(verb_list[index].verb_ctrls);
3053 list = (verb_list[index].device_ctrls +
3054 verb_list[index].device_count);
3058 free(verb_list[index].device_ctrls);
3071 list = (verb_list[index].mod_ctrls +
3072 verb_list[index].mod_count);
3076 free(verb_list[index].mod_ctrls);
3098 * verb_index - verb index
3482 int ret = -EINVAL, i, index = 0, count = 0;
3541 index = 0;
3546 list->mulval[index] =
3548 strlcpy(list->mulval[index], pmv, (strlen(pmv)+1));
3549 index++;
3559 list->mulval[index] =
3561 strlcpy(list->mulval[index], temp_coeff,
3563 index++;
3585 int case_index = 0, index = 0, mindex = 0;
3588 for(index = 0; index < list[case_index].ena_mixer_count; index++) {
3589 if(list[case_index].ena_mixer_list[index].control_name) {
3590 free(list[case_index].ena_mixer_list[index].control_name);
3592 if(list[case_index].ena_mixer_list[index].string) {
3593 free(list[case_index].ena_mixer_list[index].string);
3595 if(list[case_index].ena_mixer_list[index].mulval) {
3597 mindex < list[case_index].ena_mixer_list[index].value;
3599 free(list[case_index].ena_mixer_list[index].mulval[mindex]);
3601 if(list[case_index].ena_mixer_list[index].mulval) {
3602 free(list[case_index].ena_mixer_list[index].mulval);
3606 for(index = 0; index < list[case_index].dis_mixer_count; index++) {
3607 if(list[case_index].dis_mixer_list[index].control_name) {
3608 free(list[case_index].dis_mixer_list[index].control_name);
3610 if(list[case_index].dis_mixer_list[index].string) {
3611 free(list[case_index].dis_mixer_list[index].string);
3613 if(list[case_index].dis_mixer_list[index].mulval) {
3615 mindex < list[case_index].dis_mixer_list[index].value;
3617 free(list[case_index].dis_mixer_list[index].mulval[mindex]);
3619 if(list[case_index].dis_mixer_list[index].mulval) {
3620 free(list[case_index].dis_mixer_list[index].mulval);
3649 int index = 0, verb_index = 0;
3669 index = 0;
3671 if (verb_list[verb_index].device_list[index]) {
3672 if (!strncmp(verb_list[verb_index].device_list[index],
3674 free(verb_list[verb_index].device_list[index]);
3677 free(verb_list[verb_index].device_list[index]);
3678 index++;
3684 index = 0;
3686 if (verb_list[verb_index].modifier_list[index]) {
3687 if (!strncmp(verb_list[verb_index].modifier_list[index],
3689 free(verb_list[verb_index].modifier_list[index]);
3692 free(verb_list[verb_index].modifier_list[index]);
3693 index++;
3740 /* Get the status of identifier at particulare index of the list
3762 /* Get the node at particular index
3764 * index - index value
3767 int index)
3774 if ((index < 0) || (index >= (snd_ucm_get_size_of_list(head)))) {
3775 ALOGE("Element with given index %d doesn't exist in the list", index);
3779 while (index) {
3781 index--;
3787 /* Set the status of identifier at particulare index of the list
3809 /* Get the identifier value at particulare index of the list
3811 * index - node index value
3812 * Returns node idetifier value at index on sucess, NULL otherwise
3815 int index)
3822 if ((index < 0) || (index >= (snd_ucm_get_size_of_list(head)))) {
3823 ALOGE("Element with given index %d doesn't exist in the list", index);
3827 while (index) {
3829 index--;
3841 int index = 0;
3849 index++;
3853 return (index+1);
3858 int index = 0;
3867 ALOGV("index: %d, value: %s", index, head->ident);
3868 index++;
3871 ALOGV("index: %d, value: %s", index, head->ident);