Subject: Re: port-i386/23620
To: None <jmcneill@netbsd.org>
From: Jared D. McNeill <jmcneill@invisible.ca>
List: netbsd-bugs
Date: 08/13/2005 12:53:26
Hi Andreas, can you try the following patch?

Index: esa.c
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/esa.c,v
retrieving revision 1.29
diff -u -r1.29 esa.c
--- esa.c       28 Jun 2005 00:28:42 -0000      1.29
+++ esa.c       13 Aug 2005 15:50:28 -0000
@@ -83,13 +83,14 @@
         uint16_t pci_product_id;
         int type;
         int delay1, delay2;
+       char swap;
} esa_card_types[] = {
         { PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_ALLEGRO1,
-         ESS_ALLEGRO1, 50, 800 },
+         ESS_ALLEGRO1, 50, 800, 'Y' },
         { PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO3,
-         ESS_MAESTRO3, 20, 500 },
+         ESS_MAESTRO3, 20, 500, 'N' },
         { PCI_VENDOR_ESSTECH, PCI_PRODUCT_ESSTECH_MAESTRO3_2,
-         ESS_MAESTRO3, 20, 500 },
+         ESS_MAESTRO3, 20, 500, 'N' },
         { 0, 0, 0, 0, 0 }

};
@@ -1026,6 +1027,7 @@
                         sc->type = card->type;
                         sc->delay1 = card->delay1;
                         sc->delay2 = card->delay2;
+                       sc->swap = card->swap;
                         break;
                 }

@@ -1083,16 +1085,10 @@
                 return;
         }

-       /*
-        * Every card I've seen has had their channels swapped with  
respect
-        * to the mixer. Ie:
-        *  $ mixerctl -w outputs.master=0,191
-        * Would result in the _right_ speaker being turned off.
-        *
-        * So, we will swap the left and right mixer channels to  
compensate
-        * for this.
-        */
-       sc->codec_flags = AC97_HOST_SWAPPED_CHANNELS;
+       if (sc->swap == 'Y')
+               sc->codec_flags = AC97_HOST_SWAPPED_CHANNELS;
+       else
+               sc->codec_flags = 0;

         /* Attach AC97 host interface */
         sc->host_if.arg = self;
Index: esavar.h
===================================================================
RCS file: /cvsroot/src/sys/dev/pci/esavar.h,v
retrieving revision 1.6
diff -u -r1.6 esavar.h
--- esavar.h    24 Mar 2005 22:35:12 -0000      1.6
+++ esavar.h    13 Aug 2005 15:50:28 -0000
@@ -131,6 +131,7 @@

         int                     type;           /* Allegro-1 or  
Maestro 3? */
         int                     delay1, delay2;
+       char                    swap;

         void                    *powerhook;
         uint16_t                *savemem;