Lines Matching refs:ctl

48 	struct snd_ctl_file *ctl;
69 ctl = kzalloc(sizeof(*ctl), GFP_KERNEL);
70 if (ctl == NULL) {
74 INIT_LIST_HEAD(&ctl->events);
75 init_waitqueue_head(&ctl->change_sleep);
76 spin_lock_init(&ctl->read_lock);
77 ctl->card = card;
79 ctl->preferred_subdevice[i] = -1;
80 ctl->pid = get_pid(task_pid(current));
81 file->private_data = ctl;
83 list_add_tail(&ctl->list, &card->ctl_files);
97 static void snd_ctl_empty_read_queue(struct snd_ctl_file * ctl)
101 guard(spinlock_irqsave)(&ctl->read_lock);
102 while (!list_empty(&ctl->events)) {
103 cread = snd_kctl_event(ctl->events.next);
112 struct snd_ctl_file *ctl;
116 ctl = file->private_data;
118 card = ctl->card;
121 list_del(&ctl->list);
126 if (control->vd[idx].owner == ctl)
130 snd_fasync_free(ctl->fasync);
131 snd_ctl_empty_read_queue(ctl);
132 put_pid(ctl->pid);
133 kfree(ctl);
143 * @id: the ctl element id to send notification
152 struct snd_ctl_file *ctl;
164 list_for_each_entry(ctl, &card->ctl_files, list) {
165 if (!ctl->subscribed)
167 scoped_guard(spinlock, &ctl->read_lock) {
168 list_for_each_entry(ev, &ctl->events, list) {
178 list_add_tail(&ev->list, &ctl->events);
183 wake_up(&ctl->change_sleep);
185 snd_kill_fasync(ctl->fasync, SIGIO, POLL_IN);
379 /* Compute a hash key for the corresponding ctl id
399 /* add hash entries to numid and ctl xarray tables */
897 static int snd_ctl_card_info(struct snd_card *card, struct snd_ctl_file * ctl,
1037 /* check whether the given integer ctl value is valid */
1158 struct snd_ctl_file *ctl)
1179 if (vd->owner == ctl)
1192 static int snd_ctl_elem_info(struct snd_ctl_file *ctl,
1195 struct snd_card *card = ctl->card;
1202 return __snd_ctl_elem_info(card, kctl, info, ctl);
1205 static int snd_ctl_elem_info_user(struct snd_ctl_file *ctl,
1213 result = snd_ctl_elem_info(ctl, &info);
1424 // check whether the addition (in bytes) of user ctl element may overflow the limit.
1924 struct snd_ctl_file *ctl;
1931 ctl = file->private_data;
1932 card = ctl->card;
1939 return snd_ctl_card_info(card, ctl, cmd, argp);
1943 return snd_ctl_elem_info_user(ctl, argp);
1947 return snd_ctl_elem_write_user(ctl, argp);
1949 return snd_ctl_elem_lock(ctl, argp);
1951 return snd_ctl_elem_unlock(ctl, argp);
1953 return snd_ctl_elem_add_user(ctl, argp, 0);
1955 return snd_ctl_elem_add_user(ctl, argp, 1);
1957 return snd_ctl_elem_remove(ctl, argp);
1959 return snd_ctl_subscribe_events(ctl, ip);
1961 scoped_guard(rwsem_read, &ctl->card->controls_rwsem)
1962 err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_READ);
1965 scoped_guard(rwsem_write, &ctl->card->controls_rwsem)
1966 err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_WRITE);
1969 scoped_guard(rwsem_write, &ctl->card->controls_rwsem)
1970 err = snd_ctl_tlv_ioctl(ctl, argp, SNDRV_CTL_TLV_OP_CMD);
1980 err = p->fioctl(card, ctl, cmd, arg);
1991 struct snd_ctl_file *ctl;
1995 ctl = file->private_data;
1996 if (snd_BUG_ON(!ctl || !ctl->card))
1998 if (!ctl->subscribed)
2002 spin_lock_irq(&ctl->read_lock);
2006 while (list_empty(&ctl->events)) {
2013 add_wait_queue(&ctl->change_sleep, &wait);
2015 spin_unlock_irq(&ctl->read_lock);
2017 remove_wait_queue(&ctl->change_sleep, &wait);
2018 if (ctl->card->shutdown)
2022 spin_lock_irq(&ctl->read_lock);
2024 kev = snd_kctl_event(ctl->events.next);
2029 spin_unlock_irq(&ctl->read_lock);
2035 spin_lock_irq(&ctl->read_lock);
2041 spin_unlock_irq(&ctl->read_lock);
2049 struct snd_ctl_file *ctl;
2051 ctl = file->private_data;
2052 if (!ctl->subscribed)
2054 poll_wait(file, &ctl->change_sleep, wait);
2057 if (!list_empty(&ctl->events))
2160 struct snd_ctl_file *ctl;
2162 ctl = file->private_data;
2163 return snd_fasync_helper(fd, file, on, &ctl->fasync);
2322 struct snd_ctl_file *ctl;
2325 list_for_each_entry(ctl, &card->ctl_files, list) {
2326 wake_up(&ctl->change_sleep);
2327 snd_kill_fasync(ctl->fasync, SIGIO, POLL_ERR);