• Home
  • Raw
  • Download

Lines Matching refs:pcm

44 static int snd_pcm_free(struct snd_pcm *pcm);
51 struct snd_pcm *pcm; in snd_pcm_get() local
53 list_for_each_entry(pcm, &snd_pcm_devices, list) { in snd_pcm_get()
54 if (pcm->card == card && pcm->device == device) in snd_pcm_get()
55 return pcm; in snd_pcm_get()
62 struct snd_pcm *pcm; in snd_pcm_next() local
64 list_for_each_entry(pcm, &snd_pcm_devices, list) { in snd_pcm_next()
65 if (pcm->card == card && pcm->device > device) in snd_pcm_next()
66 return pcm->device; in snd_pcm_next()
67 else if (pcm->card->number > card->number) in snd_pcm_next()
75 struct snd_pcm *pcm; in snd_pcm_add() local
80 list_for_each_entry(pcm, &snd_pcm_devices, list) { in snd_pcm_add()
81 if (pcm->card == newpcm->card && pcm->device == newpcm->device) in snd_pcm_add()
83 if (pcm->card->number > newpcm->card->number || in snd_pcm_add()
84 (pcm->card == newpcm->card && in snd_pcm_add()
85 pcm->device > newpcm->device)) { in snd_pcm_add()
86 list_add(&newpcm->list, pcm->list.prev); in snd_pcm_add()
117 struct snd_pcm *pcm; in snd_pcm_control_ioctl() local
133 pcm = snd_pcm_get(card, device); in snd_pcm_control_ioctl()
134 if (pcm == NULL) { in snd_pcm_control_ioctl()
138 pstr = &pcm->streams[stream]; in snd_pcm_control_ioctl()
155 mutex_lock(&pcm->open_mutex); in snd_pcm_control_ioctl()
157 mutex_unlock(&pcm->open_mutex); in snd_pcm_control_ioctl()
393 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
421 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_hw_params_read()
430 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
449 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_sw_params_read()
460 mutex_lock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
485 mutex_unlock(&substream->pcm->open_mutex); in snd_pcm_substream_proc_status_read()
521 struct snd_pcm *pcm = pstr->pcm; in snd_pcm_stream_proc_init() local
525 sprintf(name, "pcm%i%c", pcm->device, in snd_pcm_stream_proc_init()
527 if ((entry = snd_info_create_card_entry(pcm->card, name, pcm->card->proc_root)) == NULL) in snd_pcm_stream_proc_init()
536 if ((entry = snd_info_create_card_entry(pcm->card, "info", pstr->proc_root)) != NULL) { in snd_pcm_stream_proc_init()
546 if ((entry = snd_info_create_card_entry(pcm->card, "xrun_debug", in snd_pcm_stream_proc_init()
581 card = substream->pcm->card; in snd_pcm_substream_proc_init()
692 int snd_pcm_new_stream(struct snd_pcm *pcm, int stream, int substream_count) in snd_pcm_new_stream() argument
695 struct snd_pcm_str *pstr = &pcm->streams[stream]; in snd_pcm_new_stream()
702 pstr->pcm = pcm; in snd_pcm_new_stream()
707 snd_device_initialize(&pstr->dev, pcm->card); in snd_pcm_new_stream()
709 dev_set_name(&pstr->dev, "pcmC%iD%i%c", pcm->card->number, pcm->device, in snd_pcm_new_stream()
712 if (!pcm->internal) { in snd_pcm_new_stream()
715 pcm_err(pcm, "Error in snd_pcm_stream_proc_init\n"); in snd_pcm_new_stream()
724 substream->pcm = pcm; in snd_pcm_new_stream()
735 if (!pcm->internal) { in snd_pcm_new_stream()
738 pcm_err(pcm, in snd_pcm_new_stream()
764 struct snd_pcm *pcm; in _snd_pcm_new() local
776 pcm = kzalloc(sizeof(*pcm), GFP_KERNEL); in _snd_pcm_new()
777 if (!pcm) in _snd_pcm_new()
779 pcm->card = card; in _snd_pcm_new()
780 pcm->device = device; in _snd_pcm_new()
781 pcm->internal = internal; in _snd_pcm_new()
782 mutex_init(&pcm->open_mutex); in _snd_pcm_new()
783 init_waitqueue_head(&pcm->open_wait); in _snd_pcm_new()
784 INIT_LIST_HEAD(&pcm->list); in _snd_pcm_new()
786 strlcpy(pcm->id, id, sizeof(pcm->id)); in _snd_pcm_new()
787 if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_PLAYBACK, playback_count)) < 0) { in _snd_pcm_new()
788 snd_pcm_free(pcm); in _snd_pcm_new()
791 if ((err = snd_pcm_new_stream(pcm, SNDRV_PCM_STREAM_CAPTURE, capture_count)) < 0) { in _snd_pcm_new()
792 snd_pcm_free(pcm); in _snd_pcm_new()
795 if ((err = snd_device_new(card, SNDRV_DEV_PCM, pcm, &ops)) < 0) { in _snd_pcm_new()
796 snd_pcm_free(pcm); in _snd_pcm_new()
800 *rpcm = pcm; in _snd_pcm_new()
860 struct snd_card *card = pstr->pcm->card; in free_chmap()
896 static int snd_pcm_free(struct snd_pcm *pcm) in snd_pcm_free() argument
900 if (!pcm) in snd_pcm_free()
902 if (!pcm->internal) { in snd_pcm_free()
904 notify->n_unregister(pcm); in snd_pcm_free()
906 if (pcm->private_free) in snd_pcm_free()
907 pcm->private_free(pcm); in snd_pcm_free()
908 snd_pcm_lib_preallocate_free_for_all(pcm); in snd_pcm_free()
909 snd_pcm_free_stream(&pcm->streams[SNDRV_PCM_STREAM_PLAYBACK]); in snd_pcm_free()
910 snd_pcm_free_stream(&pcm->streams[SNDRV_PCM_STREAM_CAPTURE]); in snd_pcm_free()
911 kfree(pcm); in snd_pcm_free()
917 struct snd_pcm *pcm = device->device_data; in snd_pcm_dev_free() local
918 return snd_pcm_free(pcm); in snd_pcm_dev_free()
921 int snd_pcm_attach_substream(struct snd_pcm *pcm, int stream, in snd_pcm_attach_substream() argument
932 if (snd_BUG_ON(!pcm || !rsubstream)) in snd_pcm_attach_substream()
938 pstr = &pcm->streams[stream]; in snd_pcm_attach_substream()
942 card = pcm->card; in snd_pcm_attach_substream()
945 if (pcm->info_flags & SNDRV_PCM_INFO_HALF_DUPLEX) { in snd_pcm_attach_substream()
948 for (substream = pcm->streams[opposite].substream; substream; in snd_pcm_attach_substream()
1012 substream->private_data = pcm->private_data; in snd_pcm_attach_substream()
1051 struct snd_pcm *pcm = pstr->pcm; in show_pcm_class() local
1060 if (pcm->dev_class > SNDRV_PCM_CLASS_LAST) in show_pcm_class()
1063 str = strs[pcm->dev_class]; in show_pcm_class()
1087 struct snd_pcm *pcm; in snd_pcm_dev_register() local
1091 pcm = device->device_data; in snd_pcm_dev_register()
1092 if (pcm->internal) in snd_pcm_dev_register()
1096 err = snd_pcm_add(pcm); in snd_pcm_dev_register()
1101 if (pcm->streams[cidx].substream == NULL) in snd_pcm_dev_register()
1112 err = snd_register_device(devtype, pcm->card, pcm->device, in snd_pcm_dev_register()
1113 &snd_pcm_f_ops[cidx], pcm, in snd_pcm_dev_register()
1114 &pcm->streams[cidx].dev); in snd_pcm_dev_register()
1116 list_del_init(&pcm->list); in snd_pcm_dev_register()
1120 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) in snd_pcm_dev_register()
1125 notify->n_register(pcm); in snd_pcm_dev_register()
1134 struct snd_pcm *pcm = device->device_data; in snd_pcm_dev_disconnect() local
1140 mutex_lock(&pcm->open_mutex); in snd_pcm_dev_disconnect()
1141 wake_up(&pcm->open_wait); in snd_pcm_dev_disconnect()
1142 list_del_init(&pcm->list); in snd_pcm_dev_disconnect()
1144 for (substream = pcm->streams[cidx].substream; substream; substream = substream->next) { in snd_pcm_dev_disconnect()
1154 if (!pcm->internal) { in snd_pcm_dev_disconnect()
1156 notify->n_disconnect(pcm); in snd_pcm_dev_disconnect()
1159 if (!pcm->internal) in snd_pcm_dev_disconnect()
1160 snd_unregister_device(&pcm->streams[cidx].dev); in snd_pcm_dev_disconnect()
1161 free_chmap(&pcm->streams[cidx]); in snd_pcm_dev_disconnect()
1163 mutex_unlock(&pcm->open_mutex); in snd_pcm_dev_disconnect()
1179 struct snd_pcm *pcm; in snd_pcm_notify() local
1189 list_for_each_entry(pcm, &snd_pcm_devices, list) in snd_pcm_notify()
1190 notify->n_unregister(pcm); in snd_pcm_notify()
1193 list_for_each_entry(pcm, &snd_pcm_devices, list) in snd_pcm_notify()
1194 notify->n_register(pcm); in snd_pcm_notify()
1209 struct snd_pcm *pcm; in snd_pcm_proc_read() local
1212 list_for_each_entry(pcm, &snd_pcm_devices, list) { in snd_pcm_proc_read()
1214 pcm->card->number, pcm->device, pcm->id, pcm->name); in snd_pcm_proc_read()
1215 if (pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream) in snd_pcm_proc_read()
1217 pcm->streams[SNDRV_PCM_STREAM_PLAYBACK].substream_count); in snd_pcm_proc_read()
1218 if (pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream) in snd_pcm_proc_read()
1220 pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream_count); in snd_pcm_proc_read()