aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJames Courtier-Dutton <James@superbug.co.uk>2005-07-10 06:04:29 -0400
committerJaroslav Kysela <perex@suse.cz>2005-07-28 06:22:27 -0400
commitc9eab129fcbcef364b34fb3a70cb2531847e1edf (patch)
tree3cb907f6c4bb5c712a8350c1cd0803401653f835
parent7c1d549aa9b22365fe5405c372f840cdbc6315f5 (diff)
[ALSA] ac97: Fix volume control bit size detection for STAC9704.
AC97 Codec Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>
-rw-r--r--sound/pci/ac97/ac97_codec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 94cd989cff20..1f09653dc0f3 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1078,6 +1078,11 @@ static void check_volume_resolution(ac97_t *ac97, int reg, unsigned char *lo_max
1078 for (i = 0 ; i < ARRAY_SIZE(cbit); i++) { 1078 for (i = 0 ; i < ARRAY_SIZE(cbit); i++) {
1079 unsigned short val; 1079 unsigned short val;
1080 snd_ac97_write(ac97, reg, 0x8080 | cbit[i] | (cbit[i] << 8)); 1080 snd_ac97_write(ac97, reg, 0x8080 | cbit[i] | (cbit[i] << 8));
1081 /* Do the read twice due to buffers on some ac97 codecs.
1082 * e.g. The STAC9704 returns exactly what you wrote the the register
1083 * if you read it immediately. This causes the detect routine to fail.
1084 */
1085 val = snd_ac97_read(ac97, reg);
1081 val = snd_ac97_read(ac97, reg); 1086 val = snd_ac97_read(ac97, reg);
1082 if (! *lo_max && (val & 0x7f) == cbit[i]) 1087 if (! *lo_max && (val & 0x7f) == cbit[i])
1083 *lo_max = max[i]; 1088 *lo_max = max[i];