Blame view

sound/core/pcm_local.h 2.6 KB
da607e196   Thomas Gleixner   treewide: Replace...
1
  /* SPDX-License-Identifier: GPL-2.0-only */
2c4842d3b   Takashi Sakamoto   ALSA: pcm: add lo...
2
3
4
5
  /*
   * pcm_local.h - a local header file for snd-pcm module.
   *
   * Copyright (c) Takashi Sakamoto <o-takashi@sakamocchi.jp>
2c4842d3b   Takashi Sakamoto   ALSA: pcm: add lo...
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
   */
  
  #ifndef __SOUND_CORE_PCM_LOCAL_H
  #define __SOUND_CORE_PCM_LOCAL_H
  
  extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
  
  void snd_interval_mul(const struct snd_interval *a,
  		      const struct snd_interval *b, struct snd_interval *c);
  void snd_interval_div(const struct snd_interval *a,
  		      const struct snd_interval *b, struct snd_interval *c);
  void snd_interval_muldivk(const struct snd_interval *a,
  			  const struct snd_interval *b,
  			  unsigned int k, struct snd_interval *c);
  void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
  			  const struct snd_interval *b, struct snd_interval *c);
2c4842d3b   Takashi Sakamoto   ALSA: pcm: add lo...
22
23
  int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime,
  			       snd_pcm_hw_param_t var, u_int32_t mask);
66e01a5cf   Takashi Sakamoto   ALSA: pcm: unify ...
24
25
  int pcm_lib_apply_appl_ptr(struct snd_pcm_substream *substream,
  			   snd_pcm_uframes_t appl_ptr);
2c4842d3b   Takashi Sakamoto   ALSA: pcm: add lo...
26
27
28
29
30
31
  int snd_pcm_update_state(struct snd_pcm_substream *substream,
  			 struct snd_pcm_runtime *runtime);
  int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
  
  void snd_pcm_playback_silence(struct snd_pcm_substream *substream,
  			      snd_pcm_uframes_t new_hw_ptr);
763e5067a   Takashi Iwai   ALSA: pcm: Clean ...
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
  static inline snd_pcm_uframes_t
  snd_pcm_avail(struct snd_pcm_substream *substream)
  {
  	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  		return snd_pcm_playback_avail(substream->runtime);
  	else
  		return snd_pcm_capture_avail(substream->runtime);
  }
  
  static inline snd_pcm_uframes_t
  snd_pcm_hw_avail(struct snd_pcm_substream *substream)
  {
  	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
  		return snd_pcm_playback_hw_avail(substream->runtime);
  	else
  		return snd_pcm_capture_hw_avail(substream->runtime);
  }
2c4842d3b   Takashi Sakamoto   ALSA: pcm: add lo...
49
50
51
52
53
54
55
56
57
58
  #ifdef CONFIG_SND_PCM_TIMER
  void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
  void snd_pcm_timer_init(struct snd_pcm_substream *substream);
  void snd_pcm_timer_done(struct snd_pcm_substream *substream);
  #else
  static inline void
  snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) {}
  static inline void snd_pcm_timer_init(struct snd_pcm_substream *substream) {}
  static inline void snd_pcm_timer_done(struct snd_pcm_substream *substream) {}
  #endif
9cd641ed3   Takashi Iwai   ALSA: pcm: trace ...
59
  void __snd_pcm_xrun(struct snd_pcm_substream *substream);
73365cb10   Takashi Iwai   ALSA: pcm: Unify ...
60
  void snd_pcm_group_init(struct snd_pcm_group *group);
9cd641ed3   Takashi Iwai   ALSA: pcm: trace ...
61

fc7af6bc2   Takashi Iwai   ALSA: pcm: Unexpo...
62
63
64
65
  #ifdef CONFIG_SND_DMA_SGBUF
  struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream,
  				    unsigned long offset);
  #endif
0821fd77a   Takashi Iwai   ALSA: pcm: Move P...
66
  #define PCM_RUNTIME_CHECK(sub) snd_BUG_ON(!(sub) || !(sub)->runtime)
2c4842d3b   Takashi Sakamoto   ALSA: pcm: add lo...
67
  #endif	/* __SOUND_CORE_PCM_LOCAL_H */