~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/sound/core/pcm_local.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0-only */
  2 /*
  3  * pcm_local.h - a local header file for snd-pcm module.
  4  *
  5  * Copyright (c) Takashi Sakamoto <o-takashi@sakamocchi.jp>
  6  */
  7 
  8 #ifndef __SOUND_CORE_PCM_LOCAL_H
  9 #define __SOUND_CORE_PCM_LOCAL_H
 10 
 11 extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
 12 
 13 void snd_interval_mul(const struct snd_interval *a,
 14                       const struct snd_interval *b, struct snd_interval *c);
 15 void snd_interval_div(const struct snd_interval *a,
 16                       const struct snd_interval *b, struct snd_interval *c);
 17 void snd_interval_muldivk(const struct snd_interval *a,
 18                           const struct snd_interval *b,
 19                           unsigned int k, struct snd_interval *c);
 20 void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
 21                           const struct snd_interval *b, struct snd_interval *c);
 22 
 23 int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime,
 24                                snd_pcm_hw_param_t var, u_int32_t mask);
 25 
 26 int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream,
 27                            snd_pcm_uframes_t appl_ptr);
 28 int snd_pcm_update_state(struct snd_pcm_substream *substream,
 29                          struct snd_pcm_runtime *runtime);
 30 int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
 31 
 32 void snd_pcm_playback_silence(struct snd_pcm_substream *substream,
 33                               snd_pcm_uframes_t new_hw_ptr);
 34 
 35 static inline snd_pcm_uframes_t
 36 snd_pcm_avail(struct snd_pcm_substream *substream)
 37 {
 38         if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 39                 return snd_pcm_playback_avail(substream->runtime);
 40         else
 41                 return snd_pcm_capture_avail(substream->runtime);
 42 }
 43 
 44 static inline snd_pcm_uframes_t
 45 snd_pcm_hw_avail(struct snd_pcm_substream *substream)
 46 {
 47         if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
 48                 return snd_pcm_playback_hw_avail(substream->runtime);
 49         else
 50                 return snd_pcm_capture_hw_avail(substream->runtime);
 51 }
 52 
 53 #ifdef CONFIG_SND_PCM_TIMER
 54 void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
 55 void snd_pcm_timer_init(struct snd_pcm_substream *substream);
 56 void snd_pcm_timer_done(struct snd_pcm_substream *substream);
 57 #else
 58 static inline void
 59 snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) {}
 60 static inline void snd_pcm_timer_init(struct snd_pcm_substream *substream) {}
 61 static inline void snd_pcm_timer_done(struct snd_pcm_substream *substream) {}
 62 #endif
 63 
 64 void __snd_pcm_xrun(struct snd_pcm_substream *substream);
 65 void snd_pcm_group_init(struct snd_pcm_group *group);
 66 void snd_pcm_sync_stop(struct snd_pcm_substream *substream, bool sync_irq);
 67 
 68 #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime)
 69 
 70 /* loop over all PCM substreams */
 71 #define for_each_pcm_substream(pcm, str, subs) \
 72         for ((str) = 0; (str) < 2; (str)++) \
 73                 for ((subs) = (pcm)->streams[str].substream; (subs); \
 74                      (subs) = (subs)->next)
 75 
 76 static inline void snd_pcm_dma_buffer_sync(struct snd_pcm_substream *substream,
 77                                            enum snd_dma_sync_mode mode)
 78 {
 79         if (substream->runtime->info & SNDRV_PCM_INFO_EXPLICIT_SYNC)
 80                 snd_dma_buffer_sync(snd_pcm_get_dma_buf(substream), mode);
 81 }
 82 
 83 #endif  /* __SOUND_CORE_PCM_LOCAL_H */
 84 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php