Lines Matching defs:substream

21 #define snd_pcm_substream_chip(substream) ((substream)->private_data)
55 int (*open)(struct snd_pcm_substream *substream);
56 int (*close)(struct snd_pcm_substream *substream);
57 int (*ioctl)(struct snd_pcm_substream * substream,
59 int (*hw_params)(struct snd_pcm_substream *substream,
61 int (*hw_free)(struct snd_pcm_substream *substream);
62 int (*prepare)(struct snd_pcm_substream *substream);
63 int (*trigger)(struct snd_pcm_substream *substream, int cmd);
64 int (*sync_stop)(struct snd_pcm_substream *substream);
65 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
66 int (*get_time_info)(struct snd_pcm_substream *substream,
70 int (*fill_silence)(struct snd_pcm_substream *substream, int channel,
72 int (*copy)(struct snd_pcm_substream *substream, int channel,
74 struct page *(*page)(struct snd_pcm_substream *substream,
76 int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
77 int (*ack)(struct snd_pcm_substream *substream);
221 struct snd_pcm_substream *substream;
452 char name[32]; /* substream name */
466 /* -- next substream -- */
470 struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */
490 #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
499 struct snd_pcm_substream *substream;
564 int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
565 int snd_pcm_info_user(struct snd_pcm_substream *substream,
567 int snd_pcm_status64(struct snd_pcm_substream *substream,
569 int snd_pcm_start(struct snd_pcm_substream *substream);
570 int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
571 int snd_pcm_drain_done(struct snd_pcm_substream *substream);
572 int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
581 int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
584 void snd_pcm_release_substream(struct snd_pcm_substream *substream);
587 void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
588 int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
592 void snd_pcm_debug_name(struct snd_pcm_substream *substream,
596 snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
607 * snd_pcm_stream_linked - Check whether the substream is linked with others
608 * @substream: substream to check
610 * Return: true if the given substream is being linked with others
612 static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
614 return substream->group != &substream->self_group;
617 void snd_pcm_stream_lock(struct snd_pcm_substream *substream);
618 void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
619 void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
620 void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
621 unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
622 unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream);
626 * @substream: PCM substream
633 #define snd_pcm_stream_lock_irqsave(substream, flags) \
636 flags = _snd_pcm_stream_lock_irqsave(substream); \
638 void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
643 * @substream: PCM substream
649 #define snd_pcm_stream_lock_irqsave_nested(substream, flags) \
652 flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
658 * @substream: the substream
660 * Iterate over the all linked substreams to the given @substream.
661 * When @substream isn't linked with any others, this gives returns @substream
664 #define snd_pcm_group_for_each_entry(s, substream) \
665 list_for_each_entry(s, &substream->group->substreams, link_list)
673 * snd_pcm_running - Check whether the substream is in a running state
674 * @substream: substream to check
676 * Return: true if the given substream is in the state RUNNING, or in the
679 static inline int snd_pcm_running(struct snd_pcm_substream *substream)
681 return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING ||
682 (substream->runtime->state == SNDRV_PCM_STATE_DRAINING &&
683 substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
762 * @substream: PCM substream
766 static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream)
768 struct snd_pcm_runtime *runtime = substream->runtime;
774 * @substream: PCM substream
778 static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream)
780 struct snd_pcm_runtime *runtime = substream->runtime;
842 * @substream: the pcm substream instance
848 static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream)
850 struct snd_pcm_runtime *runtime = substream->runtime;
856 * @substream: the pcm substream instance
862 static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream)
864 struct snd_pcm_runtime *runtime = substream->runtime;
870 * @substream: the pcm substream instance
877 static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream)
879 struct snd_pcm_runtime *runtime = substream->runtime;
888 * @substream: the pcm substream instance
894 static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream)
896 struct snd_pcm_runtime *runtime = substream->runtime;
902 * @substream: the pcm substream instance
908 static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream)
910 struct snd_pcm_runtime *runtime = substream->runtime;
915 * snd_pcm_trigger_done - Mark the master substream
916 * @substream: the pcm substream instance
917 * @master: the linked master substream
921 * in snd_pcm_group_for_each_entry() for marking the substream as "done".
923 * substream.
928 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream,
931 substream->runtime->trigger_master = master;
1048 int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
1134 void snd_pcm_set_sync(struct snd_pcm_substream *substream);
1135 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
1137 void snd_pcm_period_elapsed_under_stream_lock(struct snd_pcm_substream *substream);
1138 void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
1139 snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
1144 snd_pcm_lib_write(struct snd_pcm_substream *substream,
1147 return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
1151 snd_pcm_lib_read(struct snd_pcm_substream *substream,
1154 return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
1158 snd_pcm_lib_writev(struct snd_pcm_substream *substream,
1161 return __snd_pcm_lib_xfer(substream, (void *)bufs, false, frames, false);
1165 snd_pcm_lib_readv(struct snd_pcm_substream *substream,
1168 return __snd_pcm_lib_xfer(substream, (void *)bufs, false, frames, false);
1172 snd_pcm_kernel_write(struct snd_pcm_substream *substream,
1175 return __snd_pcm_lib_xfer(substream, (void *)buf, true, frames, true);
1179 snd_pcm_kernel_read(struct snd_pcm_substream *substream,
1182 return __snd_pcm_lib_xfer(substream, buf, true, frames, true);
1186 snd_pcm_kernel_writev(struct snd_pcm_substream *substream,
1189 return __snd_pcm_lib_xfer(substream, bufs, false, frames, true);
1193 snd_pcm_kernel_readv(struct snd_pcm_substream *substream,
1196 return __snd_pcm_lib_xfer(substream, bufs, false, frames, true);
1216 * @substream: PCM substream to set
1222 static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
1225 struct snd_pcm_runtime *runtime = substream->runtime;
1264 void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
1266 void snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
1272 int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
1273 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
1275 int snd_pcm_set_managed_buffer(struct snd_pcm_substream *substream, int type,
1283 * @substream: the pcm substream instance
1296 snd_pcm_set_fixed_buffer(struct snd_pcm_substream *substream, int type,
1299 return snd_pcm_set_managed_buffer(substream, type, data, size, 0);
1310 * all substream. If any of allocation fails, it returns -ENOMEM, hence the
1322 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,
1324 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);
1325 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream,
1329 * @substream: the substream to allocate the buffer to
1332 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is
1340 (struct snd_pcm_substream *substream, size_t size)
1342 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size,
1348 * @substream: the substream to allocate the buffer to
1358 (struct snd_pcm_substream *substream, size_t size)
1360 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size,
1364 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)
1368 * @substream: PCM substream
1374 snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
1376 return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs);
1382 * @substream: PCM substream
1389 snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
1392 return snd_sgbuf_get_chunk_size(snd_pcm_get_dma_buf(substream), ofs, size);
1403 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1404 atomic_inc(&substream->mmap_count);
1415 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1416 atomic_dec(&substream->mmap_count);
1419 int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
1424 int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area);
1467 * @substream: the pcm substream instance
1471 static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
1473 return snd_pcm_direction_name(substream->stream);
1497 * snd_pcm_chmap_substream - get the PCM substream assigned to the given chmap info
1499 * @idx: the substream number index
1501 * Return: the matched PCM substream, or NULL if not found
1507 for (s = info->pcm->streams[info->stream].substream; s; s = s->next)