[ALSA] ac97: Fix volume control bit size detection for STAC9704.

AC97 Codec

Signed-off-by: James Courtier-Dutton <James@superbug.co.uk>

authored by James Courtier-Dutton and committed by Jaroslav Kysela c9eab129 7c1d549a

+5
+5
sound/pci/ac97/ac97_codec.c
··· 1078 1078 for (i = 0 ; i < ARRAY_SIZE(cbit); i++) { 1079 1079 unsigned short val; 1080 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 1086 val = snd_ac97_read(ac97, reg); 1082 1087 if (! *lo_max && (val & 0x7f) == cbit[i]) 1083 1088 *lo_max = max[i];