tree 3cb907f6c4bb5c712a8350c1cd0803401653f835
parent 7c1d549aa9b22365fe5405c372f840cdbc6315f5
author James Courtier-Dutton <[EMAIL PROTECTED]> Sun, 10 Jul 2005 12:04:29 +0200
committer Jaroslav Kysela <[EMAIL PROTECTED]> Thu, 28 Jul 2005 12:22:27 +0200

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

AC97 Codec

Signed-off-by: James Courtier-Dutton <[EMAIL PROTECTED]>

 sound/pci/ac97/ac97_codec.c |    5 +++++
 1 files changed, 5 insertions(+)

diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -1078,6 +1078,11 @@ static void check_volume_resolution(ac97
        for (i = 0 ; i < ARRAY_SIZE(cbit); i++) {
                unsigned short val;
                snd_ac97_write(ac97, reg, 0x8080 | cbit[i] | (cbit[i] << 8));
+               /* Do the read twice due to buffers on some ac97 codecs.
+                * e.g. The STAC9704 returns exactly what you wrote the the 
register
+                * if you read it immediately. This causes the detect routine 
to fail.
+                */
+               val = snd_ac97_read(ac97, reg);
                val = snd_ac97_read(ac97, reg);
                if (! *lo_max && (val & 0x7f) == cbit[i])
                        *lo_max = max[i];
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to