Lines Matching refs:grp
76 struct mixer_ctl_group *grp; member
123 static void mixer_grp_close(struct mixer *mixer, struct mixer_ctl_group *grp) in mixer_grp_close() argument
127 if (!grp) in mixer_grp_close()
130 if (grp->ctl) { in mixer_grp_close()
131 for (n = 0; n < grp->count; n++) in mixer_grp_close()
132 mixer_cleanup_control(&grp->ctl[n]); in mixer_grp_close()
133 free(grp->ctl); in mixer_grp_close()
136 free(grp); in mixer_grp_close()
177 static int add_controls(struct mixer *mixer, struct mixer_ctl_group *grp) in add_controls() argument
182 const unsigned int old_count = grp->count; in add_controls()
187 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_LIST, &elist) < 0) in add_controls()
196 ctl = mixer_realloc_z(grp->ctl, old_count, elist.count, in add_controls()
201 grp->ctl = ctl; in add_controls()
217 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_LIST, &elist) < 0) in add_controls()
221 struct snd_ctl_elem_info *ei = &grp->ctl[n].info; in add_controls()
223 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_INFO, ei) < 0) in add_controls()
226 ctl[n].grp = grp; in add_controls()
229 grp->count = new_count; in add_controls()
242 grp->count = n; /* keep controls we successfully added */ in add_controls()
252 struct mixer_ctl_group *grp = NULL; in mixer_grp_open() local
257 grp = calloc(1, sizeof(*grp)); in mixer_grp_open()
258 if (!grp) in mixer_grp_open()
269 mixer->h_grp = grp; in mixer_grp_open()
276 mixer->v_grp = grp; in mixer_grp_open()
279 grp->ops = ops; in mixer_grp_open()
280 grp->data = data; in mixer_grp_open()
283 ret = grp->ops->ioctl(data, SNDRV_CTL_IOCTL_CARD_INFO, in mixer_grp_open()
290 ret = add_controls(mixer, grp); in mixer_grp_open()
297 grp->ops->close(grp->data); in mixer_grp_open()
300 free(grp); in mixer_grp_open()
415 struct mixer_ctl_group *grp; in mixer_get_num_ctls_by_name() local
425 grp = mixer->h_grp; in mixer_get_num_ctls_by_name()
426 ctl = grp->ctl; in mixer_get_num_ctls_by_name()
428 for (n = 0; n < grp->count; n++) in mixer_get_num_ctls_by_name()
434 grp = mixer->v_grp; in mixer_get_num_ctls_by_name()
435 ctl = grp->ctl; in mixer_get_num_ctls_by_name()
437 for (n = 0; n < grp->count; n++) in mixer_get_num_ctls_by_name()
455 struct mixer_ctl_group *grp; in mixer_subscribe_events() local
462 grp = mixer->h_grp; in mixer_subscribe_events()
463 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) in mixer_subscribe_events()
469 grp = mixer->v_grp; in mixer_subscribe_events()
470 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_SUBSCRIBE_EVENTS, &subscribe) < 0) in mixer_subscribe_events()
488 struct mixer_ctl_group *grp; in mixer_wait_event() local
515 grp = mixer->v_grp; in mixer_wait_event()
516 if (!grp->ops->get_poll_fd(grp->data, pfd, count)) { in mixer_wait_event()
543 grp = mixer->h_grp; in mixer_wait_event()
544 grp->event_cnt++; in mixer_wait_event()
548 grp = mixer->v_grp; in mixer_wait_event()
549 grp->event_cnt++; in mixer_wait_event()
593 struct mixer_ctl_group *grp = NULL; in mixer_read_event() local
603 grp = mixer->h_grp; in mixer_read_event()
609 grp = mixer->v_grp; in mixer_read_event()
613 if (grp) { in mixer_read_event()
614 grp->event_cnt--; in mixer_read_event()
615 bytes = grp->ops->read_event(grp->data, &ev, sizeof(ev)); in mixer_read_event()
630 static unsigned int mixer_grp_get_count(struct mixer_ctl_group *grp) in mixer_grp_get_count() argument
632 if (!grp) in mixer_grp_get_count()
635 return grp->count; in mixer_grp_get_count()
722 struct mixer_ctl_group *grp; in mixer_get_ctl_by_name_and_index() local
731 grp = mixer->h_grp; in mixer_get_ctl_by_name_and_index()
732 ctl = grp->ctl; in mixer_get_ctl_by_name_and_index()
734 for (n = 0; n < grp->count; n++) in mixer_get_ctl_by_name_and_index()
742 grp = mixer->v_grp; in mixer_get_ctl_by_name_and_index()
743 ctl = grp->ctl; in mixer_get_ctl_by_name_and_index()
745 for (n = 0; n < grp->count; n++) in mixer_get_ctl_by_name_and_index()
761 struct mixer_ctl_group *grp; in mixer_ctl_update() local
766 grp = ctl->grp; in mixer_ctl_update()
767 grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_INFO, &ctl->info); in mixer_ctl_update()
933 struct mixer_ctl_group *grp; in mixer_ctl_get_value() local
940 grp = ctl->grp; in mixer_ctl_get_value()
943 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_value()
981 struct mixer_ctl_group *grp; in mixer_ctl_get_array() local
991 grp = ctl->grp; in mixer_ctl_get_array()
1002 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_array()
1024 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_TLV_READ, tlv); in mixer_ctl_get_array()
1033 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_get_array()
1067 struct mixer_ctl_group *grp; in mixer_ctl_set_value() local
1075 grp = ctl->grp; in mixer_ctl_set_value()
1078 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_READ, &ev); in mixer_ctl_set_value()
1103 return grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_value()
1118 struct mixer_ctl_group *grp; in mixer_ctl_set_array() local
1127 grp = ctl->grp; in mixer_ctl_set_array()
1159 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_TLV_WRITE, tlv); in mixer_ctl_set_array()
1180 return grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_array()
1233 struct mixer_ctl_group *grp = ctl->grp; in mixer_ctl_fill_enum_string() local
1249 if (grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_INFO, &tmp) < 0) in mixer_ctl_fill_enum_string()
1300 struct mixer_ctl_group *grp; in mixer_ctl_set_enum_by_string() local
1313 grp = ctl->grp; in mixer_ctl_set_enum_by_string()
1320 ret = grp->ops->ioctl(grp->data, SNDRV_CTL_IOCTL_ELEM_WRITE, &ev); in mixer_ctl_set_enum_by_string()