2.4.20-pre5-ac4: Add support for ALi 5451 gameport

2.4.20-pre5-ac4: Add support for ALi 5451 gameport

Post by Pascal Schmid » Wed, 11 Sep 2002 08:30:08



Hi all!

This patch adds support for the gameport found on ALi 5451 chips to
drivers/sound/trident.c and drivers/char/joystick/pcigame.c. The ALi
5451 gameport works just like a Trident 4DWave gameport, so the patch
just adds the ALi device id in the relevant places.

Patch against 2.4.20-pre5-ac4 since that has the necessary code to
use trident and pcigame at the same time.

Tested and found working on a Soyo K7ADA motherboard (ALi Magik1 chipset).

Please cc me on any comments.

diff -urN linux-2.4.20-pre5-ac4/Documentation/Configure.help linux-mod/Documentation/Configure.help
--- linux-2.4.20-pre5-ac4/Documentation/Configure.help  Tue Sep 10 00:06:15 2002

   The module will be called cs461x.o.  If you want to compile it as a
   module, say M here and read <file:Documentation/modules.txt>.

-Aureal Vortex and Trident 4DWave gameports
+Aureal Vortex, Trident 4DWave, and ALi 5451 gameports
 CONFIG_INPUT_PCIGAME
   Say Y here if you have a Trident 4DWave DX/NX or Aureal Vortex 1/2
-  card. For more information on how to use the driver please read
+  card or an ALi 5451 chip on your motherboard. For more information
+  on how to use the driver please read
   <file:Documentation/input/joystick.txt>.

   This driver is also available as a module ( = code which can be
diff -urN linux-2.4.20-pre5-ac4/drivers/char/joystick/Config.in linux-mod/drivers/char/joystick/Config.in
--- linux-2.4.20-pre5-ac4/drivers/char/joystick/Config.in       Mon Sep 24 22:43:30 2001

    dep_tristate 'Game port support' CONFIG_INPUT_GAMEPORT $CONFIG_INPUT
       dep_tristate '  Classic ISA/PnP gameports' CONFIG_INPUT_NS558 $CONFIG_INPUT_GAMEPORT
       dep_tristate '  PDPI Lightning 4 gamecard' CONFIG_INPUT_LIGHTNING $CONFIG_INPUT_GAMEPORT
-      dep_tristate '  Aureal Vortex and Trident 4DWave gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT_GAMEPORT
+      dep_tristate '  Aureal Vortex, Trident 4DWave, and ALi 5451 gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT_GAMEPORT
       dep_tristate '  Crystal SoundFusion gameports' CONFIG_INPUT_CS461X  $CONFIG_INPUT_GAMEPORT
       dep_tristate '  SoundBlaster Live! gameports' CONFIG_INPUT_EMU10K1 $CONFIG_INPUT_GAMEPORT
    tristate 'Serial port device support' CONFIG_INPUT_SERIO
diff -urN linux-2.4.20-pre5-ac4/drivers/char/joystick/pcigame.c linux-mod/drivers/char/joystick/pcigame.c
--- linux-2.4.20-pre5-ac4/drivers/char/joystick/pcigame.c       Tue Sep 10 00:06:15 2002

 #if !defined(CONFIG_SOUND_TRIDENT) && !defined(CONFIG_SOUND_TRIDENT_MODULE)
  { PCI_VENDOR_ID_TRIDENT, 0x2000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_4DWAVE  },
  { PCI_VENDOR_ID_TRIDENT, 0x2001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_4DWAVE  },
+ { PCI_VENDOR_ID_AL,      0x5451, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_4DWAVE  },
 #endif
  { PCI_VENDOR_ID_AUREAL,  0x0001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_VORTEX  },
  { PCI_VENDOR_ID_AUREAL,  0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_VORTEX2 },
diff -urN linux-2.4.20-pre5-ac4/drivers/sound/trident.c linux-mod/drivers/sound/trident.c
--- linux-2.4.20-pre5-ac4/drivers/sound/trident.c       Tue Sep 10 00:06:27 2002

  *     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  *
  *  History
+ *  v0.14.10h

+ *     added support for ALi 5451 joystick port
  *  v0.14.10g


  *     adapt to new pci joystick attachment interface
  *  v0.14.10f

 #include "trident.h"

-#define DRIVER_VERSION "0.14.10f"
+#define DRIVER_VERSION "0.14.10h"

 /* magic numbers to protect our data structures */

        trident_enable_loop_interrupts(card);

        /* Attach joystick */
-       if(pci_dev->vendor == PCI_VENDOR_ID_TRIDENT)
+       if((pci_dev->vendor == PCI_VENDOR_ID_TRIDENT) ||
+          (pci_dev->vendor == PCI_VENDOR_ID_AL))
                card->joystick = pcigame_attach(pci_dev, PCIGAME_4DWAVE);
 out:   return rc;
 out_unregister_sound_dsp:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.4.20-pre5-ac4: Add support for ALi 5451 gameport

Post by Vojtech Pavli » Wed, 11 Sep 2002 14:40:05



> Hi all!

> This patch adds support for the gameport found on ALi 5451 chips to
> drivers/sound/trident.c and drivers/char/joystick/pcigame.c. The ALi
> 5451 gameport works just like a Trident 4DWave gameport, so the patch
> just adds the ALi device id in the relevant places.

> Patch against 2.4.20-pre5-ac4 since that has the necessary code to
> use trident and pcigame at the same time.

> Tested and found working on a Soyo K7ADA motherboard (ALi Magik1 chipset).

> Please cc me on any comments.

Very nice. I think this is for Alan. For normal 2.4, as you said,
the pcigame.c code isn't much useful, because doesn't cooperate well
with the trident.c code. For 2.5, pcigame code is embedded into
trident.c to make things simpler.

> diff -urN linux-2.4.20-pre5-ac4/Documentation/Configure.help linux-mod/Documentation/Configure.help
> --- linux-2.4.20-pre5-ac4/Documentation/Configure.help     Tue Sep 10 00:06:15 2002
> +++ linux-mod/Documentation/Configure.help Tue Sep 10 01:06:15 2002

>    The module will be called cs461x.o.  If you want to compile it as a
>    module, say M here and read <file:Documentation/modules.txt>.

> -Aureal Vortex and Trident 4DWave gameports
> +Aureal Vortex, Trident 4DWave, and ALi 5451 gameports
>  CONFIG_INPUT_PCIGAME
>    Say Y here if you have a Trident 4DWave DX/NX or Aureal Vortex 1/2
> -  card. For more information on how to use the driver please read
> +  card or an ALi 5451 chip on your motherboard. For more information
> +  on how to use the driver please read
>    <file:Documentation/input/joystick.txt>.

>    This driver is also available as a module ( = code which can be
> diff -urN linux-2.4.20-pre5-ac4/drivers/char/joystick/Config.in linux-mod/drivers/char/joystick/Config.in
> --- linux-2.4.20-pre5-ac4/drivers/char/joystick/Config.in  Mon Sep 24 22:43:30 2001
> +++ linux-mod/drivers/char/joystick/Config.in      Tue Sep 10 01:04:42 2002

>     dep_tristate 'Game port support' CONFIG_INPUT_GAMEPORT $CONFIG_INPUT
>        dep_tristate '  Classic ISA/PnP gameports' CONFIG_INPUT_NS558 $CONFIG_INPUT_GAMEPORT
>        dep_tristate '  PDPI Lightning 4 gamecard' CONFIG_INPUT_LIGHTNING $CONFIG_INPUT_GAMEPORT
> -      dep_tristate '  Aureal Vortex and Trident 4DWave gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT_GAMEPORT
> +      dep_tristate '  Aureal Vortex, Trident 4DWave, and ALi 5451 gameports' CONFIG_INPUT_PCIGAME $CONFIG_INPUT_GAMEPORT
>        dep_tristate '  Crystal SoundFusion gameports' CONFIG_INPUT_CS461X  $CONFIG_INPUT_GAMEPORT
>        dep_tristate '  SoundBlaster Live! gameports' CONFIG_INPUT_EMU10K1 $CONFIG_INPUT_GAMEPORT
>     tristate 'Serial port device support' CONFIG_INPUT_SERIO
> diff -urN linux-2.4.20-pre5-ac4/drivers/char/joystick/pcigame.c linux-mod/drivers/char/joystick/pcigame.c
> --- linux-2.4.20-pre5-ac4/drivers/char/joystick/pcigame.c  Tue Sep 10 00:06:15 2002
> +++ linux-mod/drivers/char/joystick/pcigame.c      Tue Sep 10 00:10:42 2002

>  #if !defined(CONFIG_SOUND_TRIDENT) && !defined(CONFIG_SOUND_TRIDENT_MODULE)
>   { PCI_VENDOR_ID_TRIDENT, 0x2000, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_4DWAVE  },
>   { PCI_VENDOR_ID_TRIDENT, 0x2001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_4DWAVE  },
> + { PCI_VENDOR_ID_AL,      0x5451, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_4DWAVE  },
>  #endif
>   { PCI_VENDOR_ID_AUREAL,  0x0001, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_VORTEX  },
>   { PCI_VENDOR_ID_AUREAL,  0x0002, PCI_ANY_ID, PCI_ANY_ID, 0, 0, PCIGAME_VORTEX2 },
> diff -urN linux-2.4.20-pre5-ac4/drivers/sound/trident.c linux-mod/drivers/sound/trident.c
> --- linux-2.4.20-pre5-ac4/drivers/sound/trident.c  Tue Sep 10 00:06:27 2002
> +++ linux-mod/drivers/sound/trident.c      Tue Sep 10 00:19:51 2002

>   *        Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
>   *
>   *  History
> + *  v0.14.10h

> + *        added support for ALi 5451 joystick port
>   *  v0.14.10g


>   *        adapt to new pci joystick attachment interface
>   *  v0.14.10f


>  #include "trident.h"

> -#define DRIVER_VERSION "0.14.10f"
> +#define DRIVER_VERSION "0.14.10h"

>  /* magic numbers to protect our data structures */
>  #define TRIDENT_CARD_MAGIC        0x5072696E /* "Prin" */

>    trident_enable_loop_interrupts(card);

>    /* Attach joystick */
> -  if(pci_dev->vendor == PCI_VENDOR_ID_TRIDENT)
> +  if((pci_dev->vendor == PCI_VENDOR_ID_TRIDENT) ||
> +     (pci_dev->vendor == PCI_VENDOR_ID_AL))
>            card->joystick = pcigame_attach(pci_dev, PCIGAME_4DWAVE);
>  out:      return rc;
>  out_unregister_sound_dsp:

--
Vojtech Pavlik
SuSE Labs
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
 
 

2.4.20-pre5-ac4: Add support for ALi 5451 gameport

Post by Alan Co » Wed, 11 Sep 2002 22:40:07



> Very nice. I think this is for Alan. For normal 2.4, as you said,
> the pcigame.c code isn't much useful, because doesn't cooperate well
> with the trident.c code. For 2.5, pcigame code is embedded into
> trident.c to make things simpler.

I fixed that in 2.4 by making pcigame look for devices if the sound card
isnt compiled in for them, otherwise provide pcigame_attach and
pcigame_release functions that drivers can use to attach pci mmio
joystick interfaces to their hardware. Works very nicely and saves
embedded one completely in the other.

Alan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/