[ALSA] via82xx: tweak VT8251 workaround
authorBastiaan Jacques <b.jacques@planet.nl>
Thu, 20 Apr 2006 10:27:09 +0000 (12:27 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 27 Apr 2006 19:10:25 +0000 (21:10 +0200)
Move the workaround for the VT8251 up a bit, and check for STAT_EOL
rather than STAT_ACTIVE. This resolves issues some people were having
with certain ALSA clients (and allows the STAT_ACTIVE check to do what
it was intended to do).
This change was suggested by Andrew Daviel.

Signed-off-by: Bastiaan Jacques <b.jacques@planet.nl>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/via82xx.c

index 1b740dd4825b53f0c2f29f47405dcaf56c50b1c2..f7a22aa65a5e7c30156c6707193f2e3cf321a33c 100644 (file)
@@ -863,16 +863,14 @@ static snd_pcm_uframes_t snd_via8233_pcm_pointer(struct snd_pcm_substream *subst
        if (!status)
                status = inb(VIADEV_REG(viadev, OFFSET_STATUS));
 
+       /* An apparent bug in the 8251 is worked around by sending a 
+        * REG_CTRL_START. */
+       if (chip->revision == VIA_REV_8251 && (status & VIA_REG_STAT_EOL))
+               snd_via82xx_pcm_trigger(substream, SNDRV_PCM_TRIGGER_START);
+
        if (!(status & VIA_REG_STAT_ACTIVE)) {
-               /* An apparent bug in the 8251 is worked around by sending
-                * a REG_CTRL_START. */
-               if (chip->revision == VIA_REV_8251)
-                       snd_via82xx_pcm_trigger(substream,
-                                               SNDRV_PCM_TRIGGER_START);
-               else {
-                       res = 0;
-                       goto unlock;
-               }
+               res = 0;
+               goto unlock;
        }
        if (count & 0xffffff) {
                idx = count >> 24;