aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc')
-rw-r--r--sound/ppc/pmac.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 04b95ae5c3aa..4f9b19c90a43 100644
--- a/sound/ppc/pmac.c
+++ b/sound/ppc/pmac.c
@@ -490,35 +490,14 @@ static int snd_pmac_pcm_open(struct snd_pmac *chip, struct pmac_stream *rec,
490 struct snd_pcm_substream *subs) 490 struct snd_pcm_substream *subs)
491{ 491{
492 struct snd_pcm_runtime *runtime = subs->runtime; 492 struct snd_pcm_runtime *runtime = subs->runtime;
493 int i, j, fflags; 493 int i;
494 static int typical_freqs[] = {
495 44100,
496 22050,
497 11025,
498 0,
499 };
500 static int typical_freq_flags[] = {
501 SNDRV_PCM_RATE_44100,
502 SNDRV_PCM_RATE_22050,
503 SNDRV_PCM_RATE_11025,
504 0,
505 };
506 494
507 /* look up frequency table and fill bit mask */ 495 /* look up frequency table and fill bit mask */
508 runtime->hw.rates = 0; 496 runtime->hw.rates = 0;
509 fflags = chip->freqs_ok; 497 for (i = 0; i < chip->num_freqs; i++)
510 for (i = 0; typical_freqs[i]; i++) { 498 if (chip->freqs_ok & (1 << i))
511 for (j = 0; j < chip->num_freqs; j++) { 499 runtime->hw.rates |=
512 if ((chip->freqs_ok & (1 << j)) && 500 snd_pcm_rate_to_rate_bit(chip->freq_table[i]);
513 chip->freq_table[j] == typical_freqs[i]) {
514 runtime->hw.rates |= typical_freq_flags[i];
515 fflags &= ~(1 << j);
516 break;
517 }
518 }
519 }
520 if (fflags) /* rest */
521 runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
522 501
523 /* check for minimum and maximum rates */ 502 /* check for minimum and maximum rates */
524 for (i = 0; i < chip->num_freqs; i++) { 503 for (i = 0; i < chip->num_freqs; i++) {