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()
637 struct mixer_ctl_group *grp; in mixer_ctl_set_value() local
641 if (!ctl || (id >= ctl->info->count) || !ctl->grp) in mixer_ctl_set_value()
644 grp = ctl->grp; in mixer_ctl_set_value()
647 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_set_value()
672 return grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_value()
677 struct mixer_ctl_group *grp; in mixer_ctl_set_array() local
683 if ((!ctl) || !count || !array || !ctl->grp) in mixer_ctl_set_array()
686 grp = ctl->grp; in mixer_ctl_set_array()
722 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_TLV_WRITE, tlv); in mixer_ctl_set_array()
743 return grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_array()
782 struct mixer_ctl_group *grp; in mixer_ctl_set_enum_by_string() local
787 if (!ctl || (ctl->info->type != SNDRV_CTL_ELEM_TYPE_ENUMERATED) || !ctl->grp) in mixer_ctl_set_enum_by_string()
790 grp = ctl->grp; in mixer_ctl_set_enum_by_string()
797 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_enum_by_string()
816 struct mixer_ctl_group *grp; in mixer_subscribe_events() local
819 grp = mixer->hw_grp; in mixer_subscribe_events()
821 grp->event_cnt = 0; in mixer_subscribe_events()
822 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) in mixer_subscribe_events()
827 grp = mixer->virt_grp; in mixer_subscribe_events()
829 grp->event_cnt = 0; in mixer_subscribe_events()
830 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) in mixer_subscribe_events()
847 struct mixer_ctl_group *grp; in mixer_wait_event() local
867 grp = mixer->virt_grp; in mixer_wait_event()
868 if (!grp->ops->get_poll_fd(grp->data, pfd, count)) { in mixer_wait_event()
889 grp = mixer->hw_grp; in mixer_wait_event()
890 grp->event_cnt++; in mixer_wait_event()
892 grp = mixer->virt_grp; in mixer_wait_event()
893 grp->event_cnt++; in mixer_wait_event()
914 struct mixer_ctl_group *grp; in mixer_consume_event() local
923 grp = mixer->hw_grp; in mixer_consume_event()
924 if (grp->event_cnt) { in mixer_consume_event()
925 grp->event_cnt--; in mixer_consume_event()
926 count = grp->ops->read_event(grp->data, &ev, sizeof(ev)); in mixer_consume_event()
932 grp = mixer->virt_grp; in mixer_consume_event()
933 if (grp->event_cnt) { in mixer_consume_event()
934 grp->event_cnt--; in mixer_consume_event()
935 count += grp->ops->read_event(grp->data, &ev, sizeof(ev)); in mixer_consume_event()
955 struct mixer_ctl_group *grp; in mixer_read_event() local
959 grp = mixer->hw_grp; in mixer_read_event()
960 if (grp->event_cnt) { in mixer_read_event()
961 grp->event_cnt--; in mixer_read_event()
962 count = grp->ops->read_event(grp->data, (struct snd_ctl_event *)ev, sizeof(*ev)); in mixer_read_event()
968 grp = mixer->virt_grp; in mixer_read_event()
969 if (grp->event_cnt) { in mixer_read_event()
970 grp->event_cnt--; in mixer_read_event()
971 count = grp->ops->read_event(grp->data, (struct snd_ctl_event *)ev, sizeof(*ev)); in mixer_read_event()