aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/pmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/ppc/pmac.c')
-rw-r--r--sound/ppc/pmac.c57
1 files changed, 5 insertions, 52 deletions
diff --git a/sound/ppc/pmac.c b/sound/ppc/pmac.c
index 7a22f0f3784a..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++) {
@@ -551,9 +530,6 @@ static int snd_pmac_pcm_open(struct snd_pmac *chip, struct pmac_stream *rec,
551 530
552 runtime->hw.periods_max = rec->cmd.size - 1; 531 runtime->hw.periods_max = rec->cmd.size - 1;
553 532
554 if (chip->can_duplex)
555 snd_pcm_set_sync(subs);
556
557 /* constraints to fix choppy sound */ 533 /* constraints to fix choppy sound */
558 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); 534 snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS);
559 return 0; 535 return 0;
@@ -1035,29 +1011,6 @@ static int __init snd_pmac_detect(struct snd_pmac *chip)
1035 return 0; 1011 return 0;
1036} 1012}
1037 1013
1038/*
1039 * exported - boolean info callbacks for ease of programming
1040 */
1041int snd_pmac_boolean_stereo_info(struct snd_kcontrol *kcontrol,
1042 struct snd_ctl_elem_info *uinfo)
1043{
1044 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1045 uinfo->count = 2;
1046 uinfo->value.integer.min = 0;
1047 uinfo->value.integer.max = 1;
1048 return 0;
1049}
1050
1051int snd_pmac_boolean_mono_info(struct snd_kcontrol *kcontrol,
1052 struct snd_ctl_elem_info *uinfo)
1053{
1054 uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN;
1055 uinfo->count = 1;
1056 uinfo->value.integer.min = 0;
1057 uinfo->value.integer.max = 1;
1058 return 0;
1059}
1060
1061#ifdef PMAC_SUPPORT_AUTOMUTE 1014#ifdef PMAC_SUPPORT_AUTOMUTE
1062/* 1015/*
1063 * auto-mute 1016 * auto-mute