Lines Matching defs:substream

20 #define snd_pcm_substream_chip(substream) ((substream)->private_data)
54 int (*open)(struct snd_pcm_substream *substream);
55 int (*close)(struct snd_pcm_substream *substream);
56 int (*ioctl)(struct snd_pcm_substream * substream,
58 int (*hw_params)(struct snd_pcm_substream *substream,
60 int (*hw_free)(struct snd_pcm_substream *substream);
61 int (*prepare)(struct snd_pcm_substream *substream);
62 int (*trigger)(struct snd_pcm_substream *substream, int cmd);
63 int (*sync_stop)(struct snd_pcm_substream *substream);
64 snd_pcm_uframes_t (*pointer)(struct snd_pcm_substream *substream);
65 int (*get_time_info)(struct snd_pcm_substream *substream,
69 int (*fill_silence)(struct snd_pcm_substream *substream, int channel,
71 int (*copy_user)(struct snd_pcm_substream *substream, int channel,
74 int (*copy_kernel)(struct snd_pcm_substream *substream, int channel,
76 struct page *(*page)(struct snd_pcm_substream *substream,
78 int (*mmap)(struct snd_pcm_substream *substream, struct vm_area_struct *vma);
79 int (*ack)(struct snd_pcm_substream *substream);
220 struct snd_pcm_substream *substream;
449 char name[32]; /* substream name */
463 /* -- next substream -- */
467 struct snd_pcm_group self_group; /* fake group for non linked substream (with substream lock inside) */
487 #define SUBSTREAM_BUSY(substream) ((substream)->ref_count > 0)
496 struct snd_pcm_substream *substream;
561 int snd_pcm_info(struct snd_pcm_substream *substream, struct snd_pcm_info *info);
562 int snd_pcm_info_user(struct snd_pcm_substream *substream,
564 int snd_pcm_status64(struct snd_pcm_substream *substream,
566 int snd_pcm_start(struct snd_pcm_substream *substream);
567 int snd_pcm_stop(struct snd_pcm_substream *substream, snd_pcm_state_t status);
568 int snd_pcm_drain_done(struct snd_pcm_substream *substream);
569 int snd_pcm_stop_xrun(struct snd_pcm_substream *substream);
578 int snd_pcm_kernel_ioctl(struct snd_pcm_substream *substream, unsigned int cmd, void *arg);
581 void snd_pcm_release_substream(struct snd_pcm_substream *substream);
584 void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
585 int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
589 void snd_pcm_debug_name(struct snd_pcm_substream *substream,
593 snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
604 * snd_pcm_stream_linked - Check whether the substream is linked with others
605 * @substream: substream to check
607 * Returns true if the given substream is being linked with others.
609 static inline int snd_pcm_stream_linked(struct snd_pcm_substream *substream)
611 return substream->group != &substream->self_group;
614 void snd_pcm_stream_lock(struct snd_pcm_substream *substream);
615 void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
616 void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
617 void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
618 unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
622 * @substream: PCM substream
629 #define snd_pcm_stream_lock_irqsave(substream, flags) \
632 flags = _snd_pcm_stream_lock_irqsave(substream); \
634 void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
640 * @substream: the substream
642 * Iterate over the all linked substreams to the given @substream.
643 * When @substream isn't linked with any others, this gives returns @substream
646 #define snd_pcm_group_for_each_entry(s, substream) \
647 list_for_each_entry(s, &substream->group->substreams, link_list)
655 * snd_pcm_running - Check whether the substream is in a running state
656 * @substream: substream to check
658 * Returns true if the given substream is in the state RUNNING, or in the
661 static inline int snd_pcm_running(struct snd_pcm_substream *substream)
663 return (substream->runtime->status->state == SNDRV_PCM_STATE_RUNNING ||
664 (substream->runtime->status->state == SNDRV_PCM_STATE_DRAINING &&
665 substream->stream == SNDRV_PCM_STREAM_PLAYBACK));
720 * @substream: PCM substream
722 static inline size_t snd_pcm_lib_buffer_bytes(struct snd_pcm_substream *substream)
724 struct snd_pcm_runtime *runtime = substream->runtime;
730 * @substream: PCM substream
732 static inline size_t snd_pcm_lib_period_bytes(struct snd_pcm_substream *substream)
734 struct snd_pcm_runtime *runtime = substream->runtime;
788 * @substream: the pcm substream instance
794 static inline int snd_pcm_playback_ready(struct snd_pcm_substream *substream)
796 struct snd_pcm_runtime *runtime = substream->runtime;
802 * @substream: the pcm substream instance
808 static inline int snd_pcm_capture_ready(struct snd_pcm_substream *substream)
810 struct snd_pcm_runtime *runtime = substream->runtime;
816 * @substream: the pcm substream instance
823 static inline int snd_pcm_playback_data(struct snd_pcm_substream *substream)
825 struct snd_pcm_runtime *runtime = substream->runtime;
834 * @substream: the pcm substream instance
840 static inline int snd_pcm_playback_empty(struct snd_pcm_substream *substream)
842 struct snd_pcm_runtime *runtime = substream->runtime;
848 * @substream: the pcm substream instance
854 static inline int snd_pcm_capture_empty(struct snd_pcm_substream *substream)
856 struct snd_pcm_runtime *runtime = substream->runtime;
861 * snd_pcm_trigger_done - Mark the master substream
862 * @substream: the pcm substream instance
863 * @master: the linked master substream
867 * in snd_pcm_group_for_each_entry() for marking the substream as "done".
869 * substream.
874 static inline void snd_pcm_trigger_done(struct snd_pcm_substream *substream,
877 substream->runtime->trigger_master = master;
982 int snd_pcm_hw_refine(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params);
1068 void snd_pcm_set_sync(struct snd_pcm_substream *substream);
1069 int snd_pcm_lib_ioctl(struct snd_pcm_substream *substream,
1071 void snd_pcm_period_elapsed(struct snd_pcm_substream *substream);
1072 snd_pcm_sframes_t __snd_pcm_lib_xfer(struct snd_pcm_substream *substream,
1077 snd_pcm_lib_write(struct snd_pcm_substream *substream,
1080 return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
1084 snd_pcm_lib_read(struct snd_pcm_substream *substream,
1087 return __snd_pcm_lib_xfer(substream, (void __force *)buf, true, frames, false);
1091 snd_pcm_lib_writev(struct snd_pcm_substream *substream,
1094 return __snd_pcm_lib_xfer(substream, (void *)bufs, false, frames, false);
1098 snd_pcm_lib_readv(struct snd_pcm_substream *substream,
1101 return __snd_pcm_lib_xfer(substream, (void *)bufs, false, frames, false);
1105 snd_pcm_kernel_write(struct snd_pcm_substream *substream,
1108 return __snd_pcm_lib_xfer(substream, (void *)buf, true, frames, true);
1112 snd_pcm_kernel_read(struct snd_pcm_substream *substream,
1115 return __snd_pcm_lib_xfer(substream, buf, true, frames, true);
1119 snd_pcm_kernel_writev(struct snd_pcm_substream *substream,
1122 return __snd_pcm_lib_xfer(substream, bufs, false, frames, true);
1126 snd_pcm_kernel_readv(struct snd_pcm_substream *substream,
1129 return __snd_pcm_lib_xfer(substream, bufs, false, frames, true);
1149 * @substream: PCM substream to set
1155 static inline void snd_pcm_set_runtime_buffer(struct snd_pcm_substream *substream,
1158 struct snd_pcm_runtime *runtime = substream->runtime;
1197 void snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream);
1199 void snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream,
1205 int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
1206 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
1208 void snd_pcm_set_managed_buffer(struct snd_pcm_substream *substream, int type,
1214 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,
1216 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);
1217 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream,
1221 * @substream: the substream to allocate the buffer to
1224 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is
1232 (struct snd_pcm_substream *substream, size_t size)
1234 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size,
1240 * @substream: the substream to allocate the buffer to
1250 (struct snd_pcm_substream *substream, size_t size)
1252 return _snd_pcm_lib_alloc_vmalloc_buffer(substream, size,
1256 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)
1262 #define snd_pcm_substream_sgbuf(substream) \
1263 snd_pcm_get_dma_buf(substream)->private_data
1268 * @substream: PCM substream
1272 snd_pcm_sgbuf_get_addr(struct snd_pcm_substream *substream, unsigned int ofs)
1274 return snd_sgbuf_get_addr(snd_pcm_get_dma_buf(substream), ofs);
1279 * @substream: PCM substream
1283 snd_pcm_sgbuf_get_ptr(struct snd_pcm_substream *substream, unsigned int ofs)
1285 return snd_sgbuf_get_ptr(snd_pcm_get_dma_buf(substream), ofs);
1291 * @substream: PCM substream
1296 snd_pcm_sgbuf_get_chunk_size(struct snd_pcm_substream *substream,
1299 return snd_sgbuf_get_chunk_size(snd_pcm_get_dma_buf(substream), ofs, size);
1310 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1311 atomic_inc(&substream->mmap_count);
1322 struct snd_pcm_substream *substream = (struct snd_pcm_substream *)area->vm_private_data;
1323 atomic_dec(&substream->mmap_count);
1326 int snd_pcm_lib_default_mmap(struct snd_pcm_substream *substream,
1331 int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_struct *area);
1360 * @substream: the pcm substream instance
1364 static inline const char *snd_pcm_stream_str(struct snd_pcm_substream *substream)
1366 if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
1393 * snd_pcm_chmap_substream - get the PCM substream assigned to the given chmap info
1395 * @idx: the substream number index
1401 for (s = info->pcm->streams[info->stream].substream; s; s = s->next)