Update of /cvsroot/alsa/alsa-kernel/pci
In directory sc8-pr-cvs1:/tmp/cvs-serv13252/pci

Modified Files:
        als4000.c ens1370.c 
Log Message:
added auto-detection of joystick port.


Index: als4000.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/als4000.c,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- als4000.c   14 Oct 2003 13:59:20 -0000      1.22
+++ als4000.c   24 Oct 2003 13:42:41 -0000      1.23
@@ -652,9 +652,18 @@
 
        /* disable all legacy ISA stuff except for joystick */
 #ifdef SUPPORT_JOYSTICK
-       if (joystick_port[dev] > 0 &&
-           (acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 
gameport")) != NULL)
+       if (joystick_port[dev] == 1) {
+               /* auto-detect */
+               long p;
+               for (p = 0x200; p <= 0x218; p += 8)
+                       if ((acard->res_joystick = request_region(p, 8, "ALS4000 
gameport")) != NULL)
+                               break;
+       } else if (joystick_port[dev] > 0)
+               acard->res_joystick = request_region(joystick_port[dev], 8, "ALS4000 
gameport");
+       if (acard->res_joystick)
                joystick = joystick_port[dev];
+       else
+               joystick = 0;
 #endif
        snd_als4000_set_addr(gcr, 0, 0, 0, joystick);
        

Index: ens1370.c
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/pci/ens1370.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- ens1370.c   23 Oct 2003 14:34:52 -0000      1.52
+++ ens1370.c   24 Oct 2003 13:42:41 -0000      1.53
@@ -1685,11 +1685,24 @@
 #ifdef SUPPORT_JOYSTICK
 static int snd_ensoniq_joystick(ensoniq_t *ensoniq, long port)
 {
-       ensoniq->gameport.io = port;
-       if (!request_region(ensoniq->gameport.io, 8, "ens137x: gameport")) {
-               snd_printk("gameport io port 0x%03x in use", ensoniq->gameport.io);
-               return -EBUSY;
+#ifdef CHIP1371
+       if (port == 1) { /* auto-detect */
+               for (port = 0x200; port <= 0x218; port += 8)
+                       if (request_region(port, 8, "ens137x: gameport"))
+                               break;
+               if (port > 0x218) {
+                       snd_printk("no gameport available\n");
+                       return -EBUSY;
+               }
+       } else
+#endif
+       {
+               if (!request_region(port, 8, "ens137x: gameport")) {
+                       snd_printk("gameport io port 0x%03x in use", 
ensoniq->gameport.io);
+                       return -EBUSY;
+               }
        }
+       ensoniq->gameport.io = port;
        ensoniq->ctrl |= ES_JYSTK_EN;
 #ifdef CHIP1371
        ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
@@ -2251,6 +2264,7 @@
 #ifdef SUPPORT_JOYSTICK
 #ifdef CHIP1371
        switch (joystick_port[dev]) {
+       case 1: /* auto-detect */
        case 0x200:
        case 0x208:
        case 0x210:



-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to