Commit c0ff26f2 authored by Jaroslav Kysela's avatar Jaroslav Kysela

[ALSA] Fix rate setting on multiple codecs

AC97 Codec
From Ron Cococcia <ron.cococcia@request.com>:

Fixed the PCM rate setting on multiple AC97 codecs.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 3bac07c8
......@@ -553,7 +553,7 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
{
ac97_bus_t *bus;
int i, cidx, r, ok_flag;
unsigned int reg_ok = 0;
unsigned int reg_ok[4] = {0,0,0,0};
unsigned char reg;
int err = 0;
......@@ -602,14 +602,14 @@ int snd_ac97_pcm_open(struct ac97_pcm *pcm, unsigned int rate,
snd_printk(KERN_ERR "invalid AC97 slot %i?\n", i);
continue;
}
if (reg_ok & (1 << (reg - AC97_PCM_FRONT_DAC_RATE)))
if (reg_ok[cidx] & (1 << (reg - AC97_PCM_FRONT_DAC_RATE)))
continue;
//printk(KERN_DEBUG "setting ac97 reg 0x%x to rate %d\n", reg, rate);
err = snd_ac97_set_rate(pcm->r[r].codec[cidx], reg, rate);
if (err < 0)
snd_printk(KERN_ERR "error in snd_ac97_set_rate: cidx=%d, reg=0x%x, rate=%d, err=%d\n", cidx, reg, rate, err);
else
reg_ok |= (1 << (reg - AC97_PCM_FRONT_DAC_RATE));
reg_ok[cidx] |= (1 << (reg - AC97_PCM_FRONT_DAC_RATE));
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment