Update of /cvsroot/alsa/alsa-driver/pci
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22454

Modified Files:
        atiixp_modem.c 
Log Message:
Fixed trigger with GPIO handling

Index: atiixp_modem.c
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/pci/atiixp_modem.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- atiixp_modem.c      24 May 2004 13:27:31 -0000      1.1
+++ atiixp_modem.c      27 May 2004 18:19:47 -0000      1.2
@@ -682,33 +682,36 @@
 {
        atiixp_t *chip = snd_pcm_substream_chip(substream);
        atiixp_dma_t *dma = (atiixp_dma_t *)substream->runtime->private_data;
-       int err = 0;
+       int i;
 
        snd_assert(dma->ops->enable_transfer && dma->ops->flush_dma, return -EINVAL);
 
+       if (cmd != SNDRV_PCM_TRIGGER_START && cmd != SNDRV_PCM_TRIGGER_STOP)
+               return -EINVAL;
+
+       for (i = 0; i < NUM_ATI_CODECS; i++) {
+               if (chip->ac97[i])
+                       snd_ac97_update_bits(chip->ac97[i], AC97_GPIO_STATUS,
+                                            AC97_GPIO_LINE1_OH,
+                                            cmd == SNDRV_PCM_TRIGGER_START ?
+                                            AC97_GPIO_LINE1_OH : 0);
+       }
+
        spin_lock(&chip->reg_lock);
-       switch (cmd) {
-       case SNDRV_PCM_TRIGGER_START:
+       if (cmd == SNDRV_PCM_TRIGGER_START) {
                dma->ops->enable_transfer(chip, 1);
                dma->running = 1;
-               break;
-       case SNDRV_PCM_TRIGGER_STOP:
+       } else {
                dma->ops->enable_transfer(chip, 0);
                dma->running = 0;
-               break;
-       default:
-               err = -EINVAL;
-               break;
        }
-       if (! err) {
+       snd_atiixp_check_bus_busy(chip);
+       if (cmd == SNDRV_PCM_TRIGGER_STOP) {
+               dma->ops->flush_dma(chip);
                snd_atiixp_check_bus_busy(chip);
-               if (cmd == SNDRV_PCM_TRIGGER_STOP) {
-                       dma->ops->flush_dma(chip);
-                       snd_atiixp_check_bus_busy(chip);
-               }
        }
        spin_unlock(&chip->reg_lock);
-       return err;
+       return 0;
 }
 
 



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to