diff options
author | Peter Rosin <peda@axentia.se> | 2015-01-28 15:16:06 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2015-01-28 19:27:15 +0000 |
commit | f66f898e953d56779367a6cbc39cbb4808b208c0 (patch) | |
tree | d0a7c9d3d6f9349080d5beca852723cd1574a1f6 /include/sound/pcm.h | |
parent | ba5295e55dd941425b10924f4f5c7af6eac4a1cb (diff) |
ALSA: pcm: Add snd_interval_ranges() and snd_pcm_hw_constraint_ranges()
Add helper functions to allow drivers to specify several disjoint
ranges for a variable. In particular, there is a codec (PCM512x) that
has a hole in its supported range of rates, due to PLL and divider
restrictions.
This is like snd_pcm_hw_constraint_list(), but for ranges instead of
points.
Signed-off-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Lars-Peter Clausen <lars@metafoo.de>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r-- | include/sound/pcm.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 1e7f74acc2ec..04fc037e0555 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -275,6 +275,12 @@ struct snd_pcm_hw_constraint_list { unsigned int mask; }; +struct snd_pcm_hw_constraint_ranges { + unsigned int count; + const struct snd_interval *ranges; + unsigned int mask; +}; + struct snd_pcm_hwptr_log; struct snd_pcm_runtime { @@ -910,6 +916,8 @@ void snd_interval_mulkdiv(const struct snd_interval *a, unsigned int k, const struct snd_interval *b, struct snd_interval *c); int snd_interval_list(struct snd_interval *i, unsigned int count, const unsigned int *list, unsigned int mask); +int snd_interval_ranges(struct snd_interval *i, unsigned int count, + const struct snd_interval *list, unsigned int mask); int snd_interval_ratnum(struct snd_interval *i, unsigned int rats_count, struct snd_ratnum *rats, unsigned int *nump, unsigned int *denp); @@ -934,6 +942,10 @@ int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, unsigned int cond, snd_pcm_hw_param_t var, const struct snd_pcm_hw_constraint_list *l); +int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime, + unsigned int cond, + snd_pcm_hw_param_t var, + const struct snd_pcm_hw_constraint_ranges *r); int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime, unsigned int cond, snd_pcm_hw_param_t var, |