]> err.no Git - linux-2.6/blobdiff - sound/ppc/pmac.c
Merge branch 'upstream' of git://ftp.linux-mips.org/pub/scm/upstream-linus
[linux-2.6] / sound / ppc / pmac.c
index 7a22f0f3784ab5e1f1c90401bdd8281d795cd2a5..4f9b19c90a430036ee834120b2b6c0d91e0c2454 100644 (file)
@@ -490,35 +490,14 @@ static int snd_pmac_pcm_open(struct snd_pmac *chip, struct pmac_stream *rec,
                             struct snd_pcm_substream *subs)
 {
        struct snd_pcm_runtime *runtime = subs->runtime;
-       int i, j, fflags;
-       static int typical_freqs[] = {
-               44100,
-               22050,
-               11025,
-               0,
-       };
-       static int typical_freq_flags[] = {
-               SNDRV_PCM_RATE_44100,
-               SNDRV_PCM_RATE_22050,
-               SNDRV_PCM_RATE_11025,
-               0,
-       };
+       int i;
 
        /* look up frequency table and fill bit mask */
        runtime->hw.rates = 0;
-       fflags = chip->freqs_ok;
-       for (i = 0; typical_freqs[i]; i++) {
-               for (j = 0; j < chip->num_freqs; j++) {
-                       if ((chip->freqs_ok & (1 << j)) &&
-                           chip->freq_table[j] == typical_freqs[i]) {
-                               runtime->hw.rates |= typical_freq_flags[i];
-                               fflags &= ~(1 << j);
-                               break;
-                       }
-               }
-       }
-       if (fflags) /* rest */
-               runtime->hw.rates |= SNDRV_PCM_RATE_KNOT;
+       for (i = 0; i < chip->num_freqs; i++)
+               if (chip->freqs_ok & (1 << i))
+                       runtime->hw.rates |=
+                               snd_pcm_rate_to_rate_bit(chip->freq_table[i]);
 
        /* check for minimum and maximum rates */
        for (i = 0; i < chip->num_freqs; i++) {
@@ -551,9 +530,6 @@ static int snd_pmac_pcm_open(struct snd_pmac *chip, struct pmac_stream *rec,
 
        runtime->hw.periods_max = rec->cmd.size - 1;
 
-       if (chip->can_duplex)
-               snd_pcm_set_sync(subs);
-
        /* constraints to fix choppy sound */
        snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
        return 0;
@@ -1035,29 +1011,6 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
        return 0;
 }
 
-/*
- * exported - boolean info callbacks for ease of programming
- */
-int snd_pmac_boolean_stereo_info(struct snd_kcontrol *kcontrol,
-                                struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-       uinfo->count = 2;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 1;
-       return 0;
-}
-
-int snd_pmac_boolean_mono_info(struct snd_kcontrol *kcontrol,
-                              struct snd_ctl_elem_info *uinfo)
-{
-       uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
-       uinfo->count = 1;
-       uinfo->value.integer.min = 0;
-       uinfo->value.integer.max = 1;
-       return 0;
-}
-
 #ifdef PMAC_SUPPORT_AUTOMUTE
 /*
  * auto-mute