• Home
  • Raw
  • Download

Lines Matching refs:grp

57     struct mixer_ctl_group *grp;  member
90 static void mixer_grp_close(struct mixer_ctl_group *grp) in mixer_grp_close() argument
94 if (!grp) in mixer_grp_close()
97 if (grp->ctl) { in mixer_grp_close()
98 for (n = 0; n < grp->count; n++) { in mixer_grp_close()
99 if (grp->ctl[n].ename) { in mixer_grp_close()
100 unsigned int max = grp->ctl[n].info->value.enumerated.items; in mixer_grp_close()
102 free(grp->ctl[n].ename[m]); in mixer_grp_close()
103 free(grp->ctl[n].ename); in mixer_grp_close()
106 free(grp->ctl); in mixer_grp_close()
109 if (grp->elem_info) in mixer_grp_close()
110 free(grp->elem_info); in mixer_grp_close()
112 free(grp); in mixer_grp_close()
137 struct mixer_ctl_group *grp; in mixer_grp_open() local
143 grp = calloc(1, sizeof(*grp)); in mixer_grp_open()
144 if (!grp) in mixer_grp_open()
152 grp->ctl = calloc(elist.count, sizeof(struct mixer_ctl)); in mixer_grp_open()
153 grp->elem_info = calloc(elist.count, sizeof(struct snd_ctl_elem_info)); in mixer_grp_open()
154 if (!grp->ctl || !grp->elem_info) { in mixer_grp_open()
165 grp->count = elist.count; in mixer_grp_open()
166 elist.space = grp->count; in mixer_grp_open()
172 for (n = 0; n < grp->count; n++) { in mixer_grp_open()
173 struct mixer_ctl *ctl = grp->ctl + n; in mixer_grp_open()
175 ctl->grp = grp; in mixer_grp_open()
176 ctl->info = grp->elem_info + n; in mixer_grp_open()
183 grp->data = data; in mixer_grp_open()
184 grp->ops = ops; in mixer_grp_open()
185 *ctl_grp = grp; in mixer_grp_open()
186 *num_ctls_in_grp = grp->count; in mixer_grp_open()
194 free(grp->elem_info); in mixer_grp_open()
195 free(grp->ctl); in mixer_grp_open()
199 free(grp); in mixer_grp_open()
300 struct mixer_ctl_group *grp; in mixer_ctl_get_elem_info() local
303 if (!ctl || !ctl->grp) in mixer_ctl_get_elem_info()
306 grp = ctl->grp; in mixer_ctl_get_elem_info()
308 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_INFO, in mixer_ctl_get_elem_info()
326 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_INFO, &tmp) < 0) in mixer_ctl_get_elem_info()
353 static int mixer_grp_get_count(struct mixer_ctl_group *grp) in mixer_grp_get_count() argument
355 if (!grp) in mixer_grp_get_count()
358 return grp->count; in mixer_grp_get_count()
387 struct mixer_ctl_group *grp; in mixer_get_ctl_by_name() local
396 grp = mixer->hw_grp; in mixer_get_ctl_by_name()
398 for (n = 0; n < grp->count; n++) in mixer_get_ctl_by_name()
399 if (!strcmp(name, (char*) grp->elem_info[n].id.name)) in mixer_get_ctl_by_name()
404 grp = mixer->virt_grp; in mixer_get_ctl_by_name()
406 for (n = 0; n < grp->count; n++) in mixer_get_ctl_by_name()
407 if (!strcmp(name, (char*) grp->elem_info[n].id.name)) in mixer_get_ctl_by_name()
416 struct mixer_ctl_group *grp; in mixer_ctl_update() local
418 if (!ctl || !ctl->grp) in mixer_ctl_update()
421 grp = ctl->grp; in mixer_ctl_update()
422 grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_INFO, ctl->info); in mixer_ctl_update()
515 struct mixer_ctl_group *grp; in mixer_ctl_get_value() local
519 if (!ctl || (id >= ctl->info->count) || !ctl->grp) in mixer_ctl_get_value()
522 grp = ctl->grp; in mixer_ctl_get_value()
525 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_value()
556 struct mixer_ctl_group *grp; in mixer_ctl_get_array() local
563 if ((!ctl) || !count || !array || !ctl->grp) in mixer_ctl_get_array()
566 grp = ctl->grp; in mixer_ctl_get_array()
584 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_array()
604 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_TLV_READ, tlv); in mixer_ctl_get_array()
613 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_array()
622 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_array()
640 struct mixer_ctl_group *grp; in mixer_ctl_set_value() local
644 if (!ctl || (id >= ctl->info->count) || !ctl->grp) in mixer_ctl_set_value()
647 grp = ctl->grp; in mixer_ctl_set_value()
650 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_set_value()
675 return grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_value()
680 struct mixer_ctl_group *grp; in mixer_ctl_set_array() local
686 if ((!ctl) || !count || !array || !ctl->grp) in mixer_ctl_set_array()
689 grp = ctl->grp; in mixer_ctl_set_array()
725 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_TLV_WRITE, tlv); in mixer_ctl_set_array()
746 return grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_array()
785 struct mixer_ctl_group *grp; in mixer_ctl_set_enum_by_string() local
790 if (!ctl || (ctl->info->type != SNDRV_CTL_ELEM_TYPE_ENUMERATED) || !ctl->grp) in mixer_ctl_set_enum_by_string()
793 grp = ctl->grp; in mixer_ctl_set_enum_by_string()
800 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_enum_by_string()
819 struct mixer_ctl_group *grp; in mixer_subscribe_events() local
822 grp = mixer->hw_grp; in mixer_subscribe_events()
824 grp->event_cnt = 0; in mixer_subscribe_events()
825 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) in mixer_subscribe_events()
830 grp = mixer->virt_grp; in mixer_subscribe_events()
832 grp->event_cnt = 0; in mixer_subscribe_events()
833 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) in mixer_subscribe_events()
850 struct mixer_ctl_group *grp; in mixer_wait_event() local
870 grp = mixer->virt_grp; in mixer_wait_event()
871 if (!grp->ops->get_poll_fd(grp->data, pfd, count)) { in mixer_wait_event()
892 grp = mixer->hw_grp; in mixer_wait_event()
893 grp->event_cnt++; in mixer_wait_event()
895 grp = mixer->virt_grp; in mixer_wait_event()
896 grp->event_cnt++; in mixer_wait_event()
917 struct mixer_ctl_group *grp; in mixer_consume_event() local
926 grp = mixer->hw_grp; in mixer_consume_event()
927 if (grp->event_cnt) { in mixer_consume_event()
928 grp->event_cnt--; in mixer_consume_event()
929 count = grp->ops->read_event(grp->data, &ev, sizeof(ev)); in mixer_consume_event()
935 grp = mixer->virt_grp; in mixer_consume_event()
936 if (grp->event_cnt) { in mixer_consume_event()
937 grp->event_cnt--; in mixer_consume_event()
938 count += grp->ops->read_event(grp->data, &ev, sizeof(ev)); in mixer_consume_event()
958 struct mixer_ctl_group *grp; in mixer_read_event() local
962 grp = mixer->hw_grp; in mixer_read_event()
963 if (grp->event_cnt) { in mixer_read_event()
964 grp->event_cnt--; in mixer_read_event()
965 count = grp->ops->read_event(grp->data, (struct snd_ctl_event *)ev, sizeof(*ev)); in mixer_read_event()
971 grp = mixer->virt_grp; in mixer_read_event()
972 if (grp->event_cnt) { in mixer_read_event()
973 grp->event_cnt--; in mixer_read_event()
974 count = grp->ops->read_event(grp->data, (struct snd_ctl_event *)ev, sizeof(*ev)); in mixer_read_event()