xref: /openbmc/linux/sound/core/pcm_local.h (revision d236d361)
1 /*
2  * pcm_local.h - a local header file for snd-pcm module.
3  *
4  * Copyright (c) Takashi Sakamoto <o-takashi@sakamocchi.jp>
5  *
6  * Licensed under the terms of the GNU General Public License, version 2.
7  */
8 
9 #ifndef __SOUND_CORE_PCM_LOCAL_H
10 #define __SOUND_CORE_PCM_LOCAL_H
11 
12 extern const struct snd_pcm_hw_constraint_list snd_pcm_known_rates;
13 
14 void snd_interval_mul(const struct snd_interval *a,
15 		      const struct snd_interval *b, struct snd_interval *c);
16 void snd_interval_div(const struct snd_interval *a,
17 		      const struct snd_interval *b, struct snd_interval *c);
18 void snd_interval_muldivk(const struct snd_interval *a,
19 			  const struct snd_interval *b,
20 			  unsigned int k, struct snd_interval *c);
21 void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k,
22 			  const struct snd_interval *b, struct snd_interval *c);
23 
24 int snd_pcm_hw_constraints_init(struct snd_pcm_substream *substream);
25 int snd_pcm_hw_constraints_complete(struct snd_pcm_substream *substream);
26 
27 int snd_pcm_hw_params_choose(struct snd_pcm_substream *substream,
28 			     struct snd_pcm_hw_params *params);
29 
30 int snd_pcm_hw_constraint_mask(struct snd_pcm_runtime *runtime,
31 			       snd_pcm_hw_param_t var, u_int32_t mask);
32 
33 int snd_pcm_update_state(struct snd_pcm_substream *substream,
34 			 struct snd_pcm_runtime *runtime);
35 int snd_pcm_update_hw_ptr(struct snd_pcm_substream *substream);
36 
37 void snd_pcm_playback_silence(struct snd_pcm_substream *substream,
38 			      snd_pcm_uframes_t new_hw_ptr);
39 
40 #ifdef CONFIG_SND_PCM_TIMER
41 void snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream);
42 void snd_pcm_timer_init(struct snd_pcm_substream *substream);
43 void snd_pcm_timer_done(struct snd_pcm_substream *substream);
44 #else
45 static inline void
46 snd_pcm_timer_resolution_change(struct snd_pcm_substream *substream) {}
47 static inline void snd_pcm_timer_init(struct snd_pcm_substream *substream) {}
48 static inline void snd_pcm_timer_done(struct snd_pcm_substream *substream) {}
49 #endif
50 
51 #endif	/* __SOUND_CORE_PCM_LOCAL_H */
52