Lines Matching refs:vpcm

218 	struct virtio_pcm *vpcm;  in virtsnd_pcm_find()  local
220 list_for_each_entry(vpcm, &snd->pcm_list, list) in virtsnd_pcm_find()
221 if (vpcm->nid == nid) in virtsnd_pcm_find()
222 return vpcm; in virtsnd_pcm_find()
239 struct virtio_pcm *vpcm; in virtsnd_pcm_find_or_create() local
241 vpcm = virtsnd_pcm_find(snd, nid); in virtsnd_pcm_find_or_create()
242 if (!IS_ERR(vpcm)) in virtsnd_pcm_find_or_create()
243 return vpcm; in virtsnd_pcm_find_or_create()
245 vpcm = devm_kzalloc(&vdev->dev, sizeof(*vpcm), GFP_KERNEL); in virtsnd_pcm_find_or_create()
246 if (!vpcm) in virtsnd_pcm_find_or_create()
249 vpcm->nid = nid; in virtsnd_pcm_find_or_create()
250 list_add_tail(&vpcm->list, &snd->pcm_list); in virtsnd_pcm_find_or_create()
252 return vpcm; in virtsnd_pcm_find_or_create()
351 struct virtio_pcm *vpcm; in virtsnd_pcm_parse_cfg() local
365 vpcm = virtsnd_pcm_find_or_create(snd, vss->nid); in virtsnd_pcm_parse_cfg()
366 if (IS_ERR(vpcm)) { in virtsnd_pcm_parse_cfg()
367 rc = PTR_ERR(vpcm); in virtsnd_pcm_parse_cfg()
385 vpcm->streams[vss->direction].nsubstreams++; in virtsnd_pcm_parse_cfg()
404 struct virtio_pcm *vpcm; in virtsnd_pcm_build_devs() local
408 list_for_each_entry(vpcm, &snd->pcm_list, list) { in virtsnd_pcm_build_devs()
410 vpcm->streams[SNDRV_PCM_STREAM_PLAYBACK].nsubstreams; in virtsnd_pcm_build_devs()
412 vpcm->streams[SNDRV_PCM_STREAM_CAPTURE].nsubstreams; in virtsnd_pcm_build_devs()
417 rc = snd_pcm_new(snd->card, VIRTIO_SND_CARD_DRIVER, vpcm->nid, in virtsnd_pcm_build_devs()
418 npbs, ncps, &vpcm->pcm); in virtsnd_pcm_build_devs()
421 vpcm->nid, rc); in virtsnd_pcm_build_devs()
425 vpcm->pcm->info_flags = 0; in virtsnd_pcm_build_devs()
426 vpcm->pcm->dev_class = SNDRV_PCM_CLASS_GENERIC; in virtsnd_pcm_build_devs()
427 vpcm->pcm->dev_subclass = SNDRV_PCM_SUBCLASS_GENERIC_MIX; in virtsnd_pcm_build_devs()
428 snprintf(vpcm->pcm->name, sizeof(vpcm->pcm->name), in virtsnd_pcm_build_devs()
429 VIRTIO_SND_PCM_NAME " %u", vpcm->pcm->device); in virtsnd_pcm_build_devs()
430 vpcm->pcm->private_data = vpcm; in virtsnd_pcm_build_devs()
431 vpcm->pcm->nonatomic = true; in virtsnd_pcm_build_devs()
433 for (i = 0; i < ARRAY_SIZE(vpcm->streams); ++i) { in virtsnd_pcm_build_devs()
434 struct virtio_pcm_stream *stream = &vpcm->streams[i]; in virtsnd_pcm_build_devs()
454 vpcm = virtsnd_pcm_find(snd, vss->nid); in virtsnd_pcm_build_devs()
455 if (IS_ERR(vpcm)) in virtsnd_pcm_build_devs()
456 return PTR_ERR(vpcm); in virtsnd_pcm_build_devs()
458 vs = &vpcm->streams[vss->direction]; in virtsnd_pcm_build_devs()
462 list_for_each_entry(vpcm, &snd->pcm_list, list) { in virtsnd_pcm_build_devs()
463 for (i = 0; i < ARRAY_SIZE(vpcm->streams); ++i) { in virtsnd_pcm_build_devs()
464 struct virtio_pcm_stream *vs = &vpcm->streams[i]; in virtsnd_pcm_build_devs()
465 struct snd_pcm_str *ks = &vpcm->pcm->streams[i]; in virtsnd_pcm_build_devs()
474 snd_pcm_set_ops(vpcm->pcm, i, &virtsnd_pcm_ops); in virtsnd_pcm_build_devs()
477 snd_pcm_set_managed_buffer_all(vpcm->pcm, in virtsnd_pcm_build_devs()