[PATCH]Fix for joystick support with es1371

Oliver Neukum (neukum@fachschaft.org.chemie.uni-muenchen.de)
Sat, 24 Oct 1998 17:19:28 +0200 (MEST)


Hello Developers,

here i have a patch that should allow the gameport on a es1371 based
soundcard to work. It is the same fix as in es1370.c. However in this case
i lack the hardware to test. The patch is against 2.1.126. Testers for
this combination seem to be rare. Therefore i am posting here at the place
with the greateat number of testers. Please direct any reply directly to
me, or preferably to linux-joystick@atrey.karlin.mff.cuni.cz

Regards
Oliver Neukum

--- linux/drivers/sound/es1371.c Wed Sep 16 17:26:04 1998
+++ linux/drivers/sound/es1371.c Sat Oct 24 16:50:09 1998
@@ -24,11 +24,8 @@
*
* Module command line parameters:
* joystick if 1 enables the joystick interface on the card; but it still
- * needs a separate joystick driver (presumably PC standard, although
- * the chip doc doesn't say anything and it looks slightly fishy from
- * the PCI standpoint...)
- *
- *
+ * needs a separate joystick driver
+ *
* Supported devices:
* /dev/dsp standard /dev/dsp device, (mostly) OSS compatible
* /dev/mixer standard /dev/mixer device, (mostly) OSS compatible
@@ -2681,7 +2678,11 @@
/* maximum number of devices */
#define NR_DEVICE 5

+#if CONFIG_SOUND_ES1371_JOYPORT_BOOT
+static int joystick[NR_DEVICE] = { 1, 0, };
+#else
static int joystick[NR_DEVICE] = { 0, };
+#endif

/* --------------------------------------------------------------------- */

@@ -2767,7 +2768,6 @@
printk(KERN_ERR "es1371: joystick address 0x%x already in use\n", joystick[index]);
else {
s->ctrl |= CTRL_JYSTK_EN | (((joystick[index] >> 3) & CTRL_JOY_MASK) << CTRL_JOY_SHIFT);
- request_region(joystick[index], JOY_EXTENT, "es1371");
}
}
s->sctrl = 0;
@@ -2889,8 +2889,6 @@
synchronize_irq();
free_irq(s->irq, s);
release_region(s->io, ES1371_EXTENT);
- if (s->ctrl & CTRL_JYSTK_EN)
- release_region(((((s->ctrl >> CTRL_JOY_SHIFT) & CTRL_JOY_MASK) << 3) | 0x200), JOY_EXTENT);
unregister_sound_dsp(s->dev_audio);
unregister_sound_mixer(s->dev_mixer);
unregister_sound_dsp(s->dev_dac);
--- linux/drivers/sound/Config.in Sat Oct 24 14:01:49 1998
+++ linux/drivers/sound/Config.in Sat Oct 24 16:45:10 1998
@@ -15,6 +15,9 @@
bool 'Joystick support at boot time' CONFIG_SOUND_ES1370_JOYPORT_BOOT
fi
dep_tristate 'Creative Ensoniq AudioPCI 97 (ES1371)' CONFIG_SOUND_ES1371 $CONFIG_SOUND
+ if [ "$CONFIG_SOUND_ES1371" = "y" ]; then
+ bool 'Joystick support at boot time' CONFIG_SOUND_ES1371_JOYPORT_BOOT
+ fi
dep_tristate 'S3 SonicVibes' CONFIG_SOUND_SONICVIBES $CONFIG_SOUND
fi

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/