Merge branch 'topic/misc' into for-next

Generic updates for sound 3.6
This commit is contained in:
Takashi Iwai
2012-07-18 13:53:29 +02:00
20 changed files with 360 additions and 538 deletions

View File

@@ -1250,10 +1250,10 @@ static int snd_pcm_hw_rule_list(struct snd_pcm_hw_params *params,
int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
unsigned int cond,
snd_pcm_hw_param_t var,
struct snd_pcm_hw_constraint_list *l)
const struct snd_pcm_hw_constraint_list *l)
{
return snd_pcm_hw_rule_add(runtime, cond, var,
snd_pcm_hw_rule_list, l,
snd_pcm_hw_rule_list, (void *)l,
var, -1);
}

View File

@@ -488,3 +488,21 @@ unsigned int snd_pcm_rate_to_rate_bit(unsigned int rate)
return SNDRV_PCM_RATE_KNOT;
}
EXPORT_SYMBOL(snd_pcm_rate_to_rate_bit);
/**
* snd_pcm_rate_bit_to_rate - converts SNDRV_PCM_RATE_xxx bit to sample rate
* @rate_bit: the rate bit to convert
*
* Returns the sample rate that corresponds to the given SNDRV_PCM_RATE_xxx flag
* or 0 for an unknown rate bit
*/
unsigned int snd_pcm_rate_bit_to_rate(unsigned int rate_bit)
{
unsigned int i;
for (i = 0; i < snd_pcm_known_rates.count; i++)
if ((1u << i) == rate_bit)
return snd_pcm_known_rates.list[i];
return 0;
}
EXPORT_SYMBOL(snd_pcm_rate_bit_to_rate);