aboutsummaryrefslogtreecommitdiffstats
path: root/sound/ppc/pmac.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 10:13:38 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 10:13:38 -0700
commitfc8a327db6c46de783b1a4276d846841b9abc24c (patch)
treebee512c142cccea93511debd98ef954581693727 /sound/ppc/pmac.c
parentMerge branch 'for-linus' of git://git.kernel.dk/data/git/linux-2.6-block (diff)
parent[ALSA] version 1.0.15 (diff)
downloadlinux-dev-fc8a327db6c46de783b1a4276d846841b9abc24c.tar.xz
linux-dev-fc8a327db6c46de783b1a4276d846841b9abc24c.zip
Merge branch 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa
* 'linus' of master.kernel.org:/pub/scm/linux/kernel/git/perex/alsa: (264 commits) [ALSA] version 1.0.15 [ALSA] Fix thinko in cs4231 mce down check [ALSA] sun-cs4231: improved waiting after MCE down [ALSA] sun-cs4231: use cs4231-regs.h [ALSA] This simplifies and fixes waiting loops of the mce_down() [ALSA] This patch adds support for a wavetable chip on [ALSA] This patch removes open_mutex from the ad1848-lib as [ALSA] fix bootup crash in snd_gus_interrupt() [ALSA] hda-codec - Fix SKU ID function for realtek codecs [ALSA] Support ASUS P701 eeepc [0x1043 0x82a1] support [ALSA] hda-codec - Add array terminator for dmic in STAC codec [ALSA] hdsp - Fix zero division [ALSA] usb-audio - Fix double comment [ALSA] hda-codec - Fix STAC922x volume knob control [ALSA] Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz [ALSA] hda-codec - Fix for Fujitsu Lifebook C1410 [ALSA] mpu-401: remove MPU401_INFO_UART_ONLY flag [ALSA] mpu-401: do not require an ACK byte for the ENTER_UART command [ALSA] via82xx - Add DXS quirk for Shuttle AK31v2 [ALSA] hda-codec - Fix input_mux numbers for vaio stac92xx ...
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,
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