aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2012-07-18 07:53:29 -0400
committerTakashi Iwai <tiwai@suse.de>2012-07-18 07:53:29 -0400
commitf0913cd16e8a6608cf9558ccbe8fdf4d428ca3de (patch)
treed6ea8cc44a9d55d29d38605165a09cf69ff9a536 /sound/core
parent61eab000f3536f080eab43fd5eed3fd817ded76e (diff)
parent59b1f084abd8690ffe68c67758ad08bbcb7d1af0 (diff)
Merge branch 'topic/misc' into for-next
Generic updates for sound 3.6
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/pcm_lib.c4
-rw-r--r--sound/core/pcm_misc.c18
2 files changed, 20 insertions, 2 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 8f312fa6c282..7ae671923393 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -1250,10 +1250,10 @@ static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params,
1250int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime, 1250int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
1251 unsigned int cond, 1251 unsigned int cond,
1252 snd_pcm_hw_param_t var, 1252 snd_pcm_hw_param_t var,
1253 struct snd_pcm_hw_constraint_list *l) 1253 const struct snd_pcm_hw_constraint_list *l)
1254{ 1254{
1255 return snd_pcm_hw_rule_add(runtime, cond, var, 1255 return snd_pcm_hw_rule_add(runtime, cond, var,
1256 snd_pcm_hw_rule_list, l, 1256 snd_pcm_hw_rule_list, (void *)l,
1257 var, -1); 1257 var, -1);
1258} 1258}
1259 1259
diff --git a/sound/core/pcm_misc.c b/sound/core/pcm_misc.c
index 9c9eff9afbac..d4fc1bfbe457 100644
--- a/sound/core/pcm_misc.c
+++ b/sound/core/pcm_misc.c
@@ -488,3 +488,21 @@ unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate)
488 return SNDRV_PCM_RATE_KNOT; 488 return SNDRV_PCM_RATE_KNOT;
489} 489}
490EXPORT_SYMBOL(snd_pcm_rate_to_rate_bit); 490EXPORT_SYMBOL(snd_pcm_rate_to_rate_bit);
491
492/**
493 * snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate
494 * @rate_bit: the rate bit to convert
495 *
496 * Returns the sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag
497 * or 0 for an unknown rate bit
498 */
499unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit)
500{
501 unsigned int i;
502
503 for (i = 0; i < snd_pcm_known_rates.count; i++)
504 if ((1u << i) == rate_bit)
505 return snd_pcm_known_rates.list[i];
506 return 0;
507}
508EXPORT_SYMBOL(snd_pcm_rate_bit_to_rate);