linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] SOUND: kill gameport bits
@ 2014-08-19 16:41 Dmitry Torokhov
  2014-08-19 16:41 ` [PATCH 2/2] Input: remove gameport subsystem Dmitry Torokhov
  2014-08-20  7:33 ` [PATCH 1/2] SOUND: kill gameport bits Clemens Ladisch
  0 siblings, 2 replies; 23+ messages in thread
From: Dmitry Torokhov @ 2014-08-19 16:41 UTC (permalink / raw)
  To: linux-input
  Cc: linux-kernel, Vojtech Pavlik, Jiri Kosina, Takashi Iwai, Dmitry Torokhov

Gameport support hasn't been working well ever since cpufreq became
mainstream and it becomes increasingly hard to find hardware and software
that would run on such old hardware.

This patch deletes support of gamecon interfaces from sound cards in
preparation of gamecon subsystem removal.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---

Takashi,

If you are OK with the patch I'd like to queue it in my queue for 3.18 together
with the patch that removes gameport completely.

Thanks!

 include/sound/core.h             |   7 --
 sound/isa/cmi8328.c              |  49 +-------
 sound/isa/sc6000.c               |   9 +-
 sound/isa/sscape.c               |   6 -
 sound/pci/als4000.c              |  89 ---------------
 sound/pci/au88x0/au8810.c        |   1 -
 sound/pci/au88x0/au88x0.c        |   5 -
 sound/pci/au88x0/au88x0.h        |   5 -
 sound/pci/au88x0/au88x0_game.c   | 133 ----------------------
 sound/pci/azt3328.c              | 238 +--------------------------------------
 sound/pci/cmipci.c               |  84 +-------------
 sound/pci/cs4281.c               | 114 -------------------
 sound/pci/cs46xx/cs46xx.c        |   2 -
 sound/pci/cs46xx/cs46xx.h        |   4 -
 sound/pci/cs46xx/cs46xx_lib.c    | 105 -----------------
 sound/pci/ens1370.c              | 129 ---------------------
 sound/pci/es1938.c               |  46 --------
 sound/pci/es1968.c               |  72 ------------
 sound/pci/riptide/riptide.c      | 109 +-----------------
 sound/pci/sonicvibes.c           |  55 ---------
 sound/pci/trident/trident.c      |   2 -
 sound/pci/trident/trident.h      |   3 -
 sound/pci/trident/trident_main.c | 103 -----------------
 sound/pci/via82xx.c              |  77 -------------
 sound/pci/ymfpci/ymfpci.c        |  99 ----------------
 sound/pci/ymfpci/ymfpci.h        |   9 --
 sound/pci/ymfpci/ymfpci_main.c   |   1 -
 27 files changed, 8 insertions(+), 1548 deletions(-)
 delete mode 100644 sound/pci/au88x0/au88x0_game.c

diff --git a/include/sound/core.h b/include/sound/core.h
index 1df3f2f..3f087e1 100644
--- a/include/sound/core.h
+++ b/include/sound/core.h
@@ -421,13 +421,6 @@ static inline void snd_printdd(const char *format, ...) {}
 
 #define SNDRV_OSS_VERSION         ((3<<16)|(8<<8)|(1<<4)|(0))	/* 3.8.1a */
 
-/* for easier backward-porting */
-#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
-#define gameport_set_dev_parent(gp,xdev) ((gp)->dev.parent = (xdev))
-#define gameport_set_port_data(gp,r) ((gp)->port_data = (r))
-#define gameport_get_port_data(gp) (gp)->port_data
-#endif
-
 /* PCI quirk list helper */
 struct snd_pci_quirk {
 	unsigned short subvendor;	/* PCI subvendor ID */
diff --git a/sound/isa/cmi8328.c b/sound/isa/cmi8328.c
index 4778852..ac60f04 100644
--- a/sound/isa/cmi8328.c
+++ b/sound/isa/cmi8328.c
@@ -11,7 +11,6 @@
 #include <linux/init.h>
 #include <linux/isa.h>
 #include <linux/module.h>
-#include <linux/gameport.h>
 #include <asm/dma.h>
 #include <sound/core.h>
 #include <sound/wss.h>
@@ -26,10 +25,6 @@ MODULE_AUTHOR("Ondrej Zary <linux@rainbow-software.org>");
 MODULE_DESCRIPTION("C-Media CMI8328");
 MODULE_LICENSE("GPL");
 
-#if defined(CONFIG_GAMEPORT) || defined(CONFIG_GAMEPORT_MODULE)
-#define SUPPORT_JOYSTICK 1
-#endif
-
 /* I/O port is configured by jumpers on the card to one of these */
 static int cmi8328_ports[] = { 0x530, 0xe80, 0xf40, 0x604 };
 #define CMI8328_MAX	ARRAY_SIZE(cmi8328_ports)
@@ -42,9 +37,6 @@ static int dma1[CMI8328_MAX] =      {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_DMA};
 static int dma2[CMI8328_MAX] =      {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_DMA};
 static long mpuport[CMI8328_MAX] =  {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_PORT};
 static int mpuirq[CMI8328_MAX] =    {[0 ... (CMI8328_MAX-1)] = SNDRV_AUTO_IRQ};
-#ifdef SUPPORT_JOYSTICK
-static bool gameport[CMI8328_MAX] = {[0 ... (CMI8328_MAX-1)] = true};
-#endif
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for CMI8328 soundcard.");
@@ -64,10 +56,6 @@ module_param_array(mpuport, long, NULL, 0444);
 MODULE_PARM_DESC(mpuport, "MPU-401 port # for CMI8328 driver.");
 module_param_array(mpuirq, int, NULL, 0444);
 MODULE_PARM_DESC(mpuirq, "IRQ # for CMI8328 MPU-401 port.");
-#ifdef SUPPORT_JOYSTICK
-module_param_array(gameport, bool, NULL, 0444);
-MODULE_PARM_DESC(gameport, "Enable gameport.");
-#endif
 
 struct snd_cmi8328 {
 	u16 port;
@@ -75,9 +63,6 @@ struct snd_cmi8328 {
 	u8 wss_cfg;
 	struct snd_card *card;
 	struct snd_wss *wss;
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 };
 
 /* CMI8328 configuration registers */
@@ -371,34 +356,11 @@ static int snd_cmi8328_probe(struct device *pdev, unsigned int ndev)
 	err = snd_card_register(card);
 	if (err < 0)
 		goto error;
-#ifdef SUPPORT_JOYSTICK
-	if (!gameport[ndev])
-		return 0;
-	/* gameport is hardwired to 0x200 */
-	res = request_region(0x200, 8, "CMI8328 gameport");
-	if (!res)
-		snd_printk(KERN_WARNING "unable to allocate gameport I/O port\n");
-	else {
-		struct gameport *gp = cmi->gameport = gameport_allocate_port();
-		if (!cmi->gameport)
-			release_and_free_resource(res);
-		else {
-			gameport_set_name(gp, "CMI8328 Gameport");
-			gameport_set_phys(gp, "%s/gameport0", dev_name(pdev));
-			gameport_set_dev_parent(gp, pdev);
-			gp->io = 0x200;
-			gameport_set_port_data(gp, res);
-			/* Enable gameport */
-			snd_cmi8328_cfg_write(port, CFG1,
-					CFG1_SB_DISABLE | CFG1_GAMEPORT);
-			gameport_register_port(gp);
-		}
-	}
-#endif
+
 	return 0;
+
 error:
 	snd_card_free(card);
-
 	return err;
 }
 
@@ -407,13 +369,6 @@ static int snd_cmi8328_remove(struct device *pdev, unsigned int dev)
 	struct snd_card *card = dev_get_drvdata(pdev);
 	struct snd_cmi8328 *cmi = card->private_data;
 
-#ifdef SUPPORT_JOYSTICK
-	if (cmi->gameport) {
-		struct resource *res = gameport_get_port_data(cmi->gameport);
-		gameport_unregister_port(cmi->gameport);
-		release_and_free_resource(res);
-	}
-#endif
 	/* disable everything */
 	snd_cmi8328_cfg_write(cmi->port, CFG1, CFG1_SB_DISABLE);
 	snd_cmi8328_cfg_write(cmi->port, CFG2, 0);
diff --git a/sound/isa/sc6000.c b/sound/isa/sc6000.c
index 15a152e..05d3e81 100644
--- a/sound/isa/sc6000.c
+++ b/sound/isa/sc6000.c
@@ -56,7 +56,6 @@ static long mpu_port[SNDRV_CARDS] = SNDRV_DEFAULT_PORT;
 						/* 0x300, 0x310, 0x320, 0x330 */
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;	/* 5, 7, 9, 10, 0 */
 static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;	/* 0, 1, 3 */
-static bool joystick[SNDRV_CARDS] = { [0 ... (SNDRV_CARDS-1)] = false };
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for sc-6000 based soundcard.");
@@ -76,8 +75,6 @@ module_param_array(mpu_irq, int, NULL, 0444);
 MODULE_PARM_DESC(mpu_irq, "MPU-401 IRQ # for sc-6000 driver.");
 module_param_array(dma, int, NULL, 0444);
 MODULE_PARM_DESC(dma, "DMA # for sc-6000 driver.");
-module_param_array(joystick, bool, NULL, 0444);
-MODULE_PARM_DESC(joystick, "Enable gameport.");
 
 /*
  * Commands of SC6000's DSP (SBPRO+special).
@@ -366,7 +363,7 @@ static int sc6000_init_mss(char __iomem *vport, int config,
 
 static void sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
 				 long xport, long xmpu,
-				 long xmss_port, int joystick)
+				 long xmss_port)
 {
 	cfg[0] = 0;
 	cfg[1] = 0;
@@ -379,8 +376,6 @@ static void sc6000_hw_cfg_encode(char __iomem *vport, int *cfg,
 	if (xmss_port == 0xe80)
 		cfg[0] |= 0x10;
 	cfg[0] |= 0x40;		/* always set */
-	if (!joystick)
-		cfg[0] |= 0x02;
 	cfg[1] |= 0x80;		/* enable WSS system */
 	cfg[1] &= ~0x40;	/* disable IDE */
 	snd_printd("hw cfg %x, %x\n", cfg[0], cfg[1]);
@@ -432,7 +427,7 @@ static int sc6000_init_board(char __iomem *vport,
 	if (!old) {
 		int cfg[2];
 		sc6000_hw_cfg_encode(vport, &cfg[0], port[dev], mpu_port[dev],
-				     mss_port[dev], joystick[dev]);
+				     mss_port[dev]);
 		if (sc6000_hw_cfg_write(vport, cfg) < 0) {
 			snd_printk(KERN_ERR "sc6000_hw_cfg_write: failed!\n");
 			return -EIO;
diff --git a/sound/isa/sscape.c b/sound/isa/sscape.c
index 44405df..dd21079 100644
--- a/sound/isa/sscape.c
+++ b/sound/isa/sscape.c
@@ -54,7 +54,6 @@ static int irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
 static int mpu_irq[SNDRV_CARDS] = SNDRV_DEFAULT_IRQ;
 static int dma[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
 static int dma2[SNDRV_CARDS] = SNDRV_DEFAULT_DMA;
-static bool joystick[SNDRV_CARDS];
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index number for SoundScape soundcard");
@@ -80,9 +79,6 @@ MODULE_PARM_DESC(dma, "DMA # for SoundScape driver.");
 module_param_array(dma2, int, NULL, 0444);
 MODULE_PARM_DESC(dma2, "DMA2 # for SoundScape driver.");
 
-module_param_array(joystick, bool, NULL, 0444);
-MODULE_PARM_DESC(joystick, "Enable gameport.");
-
 #ifdef CONFIG_PNP
 static int isa_registered;
 static int pnp_registered;
@@ -1049,8 +1045,6 @@ static int create_sscape(int dev, struct snd_card *card)
 
 	mpu_irq_cfg |= mpu_irq_cfg << 2;
 	val = sscape_read_unsafe(sscape->io_base, GA_HMCTL_REG) & 0xF7;
-	if (joystick[dev])
-		val |= 8;
 	sscape_write_unsafe(sscape->io_base, GA_HMCTL_REG, val | 0x10);
 	sscape_write_unsafe(sscape->io_base, GA_INTCFG_REG, 0xf0 | mpu_irq_cfg);
 	sscape_write_unsafe(sscape->io_base,
diff --git a/sound/pci/als4000.c b/sound/pci/als4000.c
index b751c38..567fbf9 100644
--- a/sound/pci/als4000.c
+++ b/sound/pci/als4000.c
@@ -68,7 +68,6 @@
 #include <asm/io.h>
 #include <linux/init.h>
 #include <linux/pci.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 #include <sound/core.h>
@@ -84,16 +83,9 @@ MODULE_DESCRIPTION("Avance Logic ALS4000");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{Avance Logic,ALS4000}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
-#ifdef SUPPORT_JOYSTICK
-static int joystick_port[SNDRV_CARDS];
-#endif
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for ALS4000 soundcard.");
@@ -101,19 +93,12 @@ module_param_array(id, charp, NULL, 0444);
 MODULE_PARM_DESC(id, "ID string for ALS4000 soundcard.");
 module_param_array(enable, bool, NULL, 0444);
 MODULE_PARM_DESC(enable, "Enable ALS4000 soundcard.");
-#ifdef SUPPORT_JOYSTICK
-module_param_array(joystick_port, int, NULL, 0444);
-MODULE_PARM_DESC(joystick_port, "Joystick port address for ALS4000 soundcard. (0 = disabled)");
-#endif
 
 struct snd_card_als4000 {
 	/* most frequent access first */
 	unsigned long iobase;
 	struct pci_dev *pci;
 	struct snd_sb *chip;
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 };
 
 static DEFINE_PCI_DEVICE_TABLE(snd_als4000_ids) = {
@@ -769,72 +754,6 @@ static void snd_als4000_configure(struct snd_sb *chip)
 	spin_unlock_irq(&chip->reg_lock);
 }
 
-#ifdef SUPPORT_JOYSTICK
-static int snd_als4000_create_gameport(struct snd_card_als4000 *acard, int dev)
-{
-	struct gameport *gp;
-	struct resource *r;
-	int io_port;
-
-	if (joystick_port[dev] == 0)
-		return -ENODEV;
-
-	if (joystick_port[dev] == 1) { /* auto-detect */
-		for (io_port = 0x200; io_port <= 0x218; io_port += 8) {
-			r = request_region(io_port, 8, "ALS4000 gameport");
-			if (r)
-				break;
-		}
-	} else {
-		io_port = joystick_port[dev];
-		r = request_region(io_port, 8, "ALS4000 gameport");
-	}
-
-	if (!r) {
-		dev_warn(&acard->pci->dev, "cannot reserve joystick ports\n");
-		return -EBUSY;
-	}
-
-	acard->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(&acard->pci->dev, "cannot allocate memory for gameport\n");
-		release_and_free_resource(r);
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "ALS4000 Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(acard->pci));
-	gameport_set_dev_parent(gp, &acard->pci->dev);
-	gp->io = io_port;
-	gameport_set_port_data(gp, r);
-
-	/* Enable legacy joystick port */
-	snd_als4000_set_addr(acard->iobase, 0, 0, 0, 1);
-
-	gameport_register_port(acard->gameport);
-
-	return 0;
-}
-
-static void snd_als4000_free_gameport(struct snd_card_als4000 *acard)
-{
-	if (acard->gameport) {
-		struct resource *r = gameport_get_port_data(acard->gameport);
-
-		gameport_unregister_port(acard->gameport);
-		acard->gameport = NULL;
-
-		/* disable joystick */
-		snd_als4000_set_addr(acard->iobase, 0, 0, 0, 0);
-
-		release_and_free_resource(r);
-	}
-}
-#else
-static inline int snd_als4000_create_gameport(struct snd_card_als4000 *acard, int dev) { return -ENOSYS; }
-static inline void snd_als4000_free_gameport(struct snd_card_als4000 *acard) { }
-#endif
-
 static void snd_card_als4000_free( struct snd_card *card )
 {
 	struct snd_card_als4000 *acard = card->private_data;
@@ -842,7 +761,6 @@ static void snd_card_als4000_free( struct snd_card *card )
 	/* make sure that interrupts are disabled */
 	snd_als4k_gcr_write_addr(acard->iobase, ALS4K_GCR8C_MISC_CTRL, 0);
 	/* free resources */
-	snd_als4000_free_gameport(acard);
 	pci_release_regions(acard->pci);
 	pci_disable_device(acard->pci);
 }
@@ -963,8 +881,6 @@ static int snd_card_als4000_probe(struct pci_dev *pci,
 		}
 	}
 
-	snd_als4000_create_gameport(acard, dev);
-
 	if ((err = snd_card_register(card)) < 0) {
 		goto out_err;
 	}
@@ -1024,11 +940,6 @@ static int snd_als4000_resume(struct device *dev)
 	snd_sbdsp_reset(chip);
 	snd_sbmixer_resume(chip);
 
-#ifdef SUPPORT_JOYSTICK
-	if (acard->gameport)
-		snd_als4000_set_addr(acard->iobase, 0, 0, 0, 1);
-#endif
-
 	snd_power_change_state(card, SNDRV_CTL_POWER_D0);
 	return 0;
 }
diff --git a/sound/pci/au88x0/au8810.c b/sound/pci/au88x0/au8810.c
index aa51cc7..394c847 100644
--- a/sound/pci/au88x0/au8810.c
+++ b/sound/pci/au88x0/au8810.c
@@ -9,7 +9,6 @@ static DEFINE_PCI_DEVICE_TABLE(snd_vortex_ids) = {
 #include "au88x0_pcm.c"
 #include "au88x0_mixer.c"
 #include "au88x0_mpu401.c"
-#include "au88x0_game.c"
 #include "au88x0_eq.c"
 #include "au88x0_a3d.c"
 #include "au88x0_xtalk.c"
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c
index afb1b44..208ead1 100644
--- a/sound/pci/au88x0/au88x0.c
+++ b/sound/pci/au88x0/au88x0.c
@@ -123,7 +123,6 @@ static int snd_vortex_dev_free(struct snd_device *device)
 {
 	vortex_t *vortex = device->device_data;
 
-	vortex_gameport_unregister(vortex);
 	vortex_core_shutdown(vortex);
 	// Take down PCI interface.
 	free_irq(vortex->irq, vortex);
@@ -225,8 +224,6 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip)
 	pci_release_regions(chip->pci_dev);
       regions_out:
 	pci_disable_device(chip->pci_dev);
-	//FIXME: this not the right place to unregister the gameport
-	vortex_gameport_unregister(chip);
 	kfree(chip);
 	return err;
 }
@@ -309,8 +306,6 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 		return err;
 	}
 
-	vortex_gameport_register(chip);
-
 #if 0
 	if (snd_seq_device_new(card, 1, SNDRV_SEQ_DEV_ID_VORTEX_SYNTH,
 			       sizeof(snd_vortex_synth_arg_t), &wave) < 0
diff --git a/sound/pci/au88x0/au88x0.h b/sound/pci/au88x0/au88x0.h
index 466a5c8..69cd47e 100644
--- a/sound/pci/au88x0/au88x0.h
+++ b/sound/pci/au88x0/au88x0.h
@@ -180,9 +180,6 @@ struct snd_vortex {
 
 	int isquad;		/* cache of extended ID codec flag. */
 
-	/* Gameport stuff. */
-	struct gameport *gameport;
-
 	/* PCI hardware resources */
 	unsigned long io;
 	void __iomem *mmio;
@@ -282,8 +279,6 @@ static void vortex_Vort3D_InitializeSource(a3dsrc_t * a, int en);
 #endif
 
 /* Driver stuff. */
-static int vortex_gameport_register(vortex_t * card);
-static void vortex_gameport_unregister(vortex_t * card);
 #ifndef CHIP_AU8820
 static int vortex_eq_init(vortex_t * vortex);
 static int vortex_eq_free(vortex_t * vortex);
diff --git a/sound/pci/au88x0/au88x0_game.c b/sound/pci/au88x0/au88x0_game.c
deleted file mode 100644
index 280f86d..0000000
--- a/sound/pci/au88x0/au88x0_game.c
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- *  Manuel Jander.
- *
- *  Based on the work of:
- *  Vojtech Pavlik
- *  Raymond Ingles
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@suse.cz>, or by paper mail:
- * Vojtech Pavlik, Ucitelska 1576, Prague 8, 182 00 Czech Republic
- *
- * Based 90% on Vojtech Pavlik pcigame driver.
- * Merged and modified by Manuel Jander, for the OpenVortex
- * driver. (email: mjander@embedded.cl).
- */
-
-#include <linux/time.h>
-#include <linux/delay.h>
-#include <linux/init.h>
-#include <sound/core.h>
-#include "au88x0.h"
-#include <linux/gameport.h>
-#include <linux/export.h>
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-
-#define VORTEX_GAME_DWAIT	20	/* 20 ms */
-
-static unsigned char vortex_game_read(struct gameport *gameport)
-{
-	vortex_t *vortex = gameport_get_port_data(gameport);
-	return hwread(vortex->mmio, VORTEX_GAME_LEGACY);
-}
-
-static void vortex_game_trigger(struct gameport *gameport)
-{
-	vortex_t *vortex = gameport_get_port_data(gameport);
-	hwwrite(vortex->mmio, VORTEX_GAME_LEGACY, 0xff);
-}
-
-static int
-vortex_game_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	vortex_t *vortex = gameport_get_port_data(gameport);
-	int i;
-
-	*buttons = (~hwread(vortex->mmio, VORTEX_GAME_LEGACY) >> 4) & 0xf;
-
-	for (i = 0; i < 4; i++) {
-		axes[i] =
-		    hwread(vortex->mmio, VORTEX_GAME_AXIS + (i * AXIS_SIZE));
-		if (axes[i] == AXIS_RANGE)
-			axes[i] = -1;
-	}
-	return 0;
-}
-
-static int vortex_game_open(struct gameport *gameport, int mode)
-{
-	vortex_t *vortex = gameport_get_port_data(gameport);
-
-	switch (mode) {
-	case GAMEPORT_MODE_COOKED:
-		hwwrite(vortex->mmio, VORTEX_CTRL2,
-			hwread(vortex->mmio,
-			       VORTEX_CTRL2) | CTRL2_GAME_ADCMODE);
-		msleep(VORTEX_GAME_DWAIT);
-		return 0;
-	case GAMEPORT_MODE_RAW:
-		hwwrite(vortex->mmio, VORTEX_CTRL2,
-			hwread(vortex->mmio,
-			       VORTEX_CTRL2) & ~CTRL2_GAME_ADCMODE);
-		return 0;
-	default:
-		return -1;
-	}
-
-	return 0;
-}
-
-static int vortex_gameport_register(vortex_t *vortex)
-{
-	struct gameport *gp;
-
-	vortex->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		printk(KERN_ERR "vortex: cannot allocate memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "AU88x0 Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(vortex->pci_dev));
-	gameport_set_dev_parent(gp, &vortex->pci_dev->dev);
-
-	gp->read = vortex_game_read;
-	gp->trigger = vortex_game_trigger;
-	gp->cooked_read = vortex_game_cooked_read;
-	gp->open = vortex_game_open;
-
-	gameport_set_port_data(gp, vortex);
-	gp->fuzz = 64;
-
-	gameport_register_port(gp);
-
-	return 0;
-}
-
-static void vortex_gameport_unregister(vortex_t * vortex)
-{
-	if (vortex->gameport) {
-		gameport_unregister_port(vortex->gameport);
-		vortex->gameport = NULL;
-	}
-}
-
-#else
-static inline int vortex_gameport_register(vortex_t * vortex) { return -ENOSYS; }
-static inline void vortex_gameport_unregister(vortex_t * vortex) { }
-#endif
diff --git a/sound/pci/azt3328.c b/sound/pci/azt3328.c
index c9216c0..0fee67e 100644
--- a/sound/pci/azt3328.c
+++ b/sound/pci/azt3328.c
@@ -156,9 +156,6 @@
  *    (e.g. kmix, gamix) - unfortunately several are!!
  *  - locking is not entirely clean, especially the audio stream activity
  *    ints --> may be racy
- *  - an _unconnected_ secondary joystick at the gameport will be reported
- *    to be "active" (floating values, not precisely -1) due to the way we need
- *    to read the Digital Enhanced Game Port. Not sure whether it is fixable.
  *
  * TODO
  *  - use PCI_VDEVICE
@@ -185,7 +182,6 @@
 #include <linux/pci.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 #include <sound/core.h>
@@ -212,10 +208,6 @@ MODULE_DESCRIPTION("Aztech AZF3328 (PCI168)");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{Aztech,AZF3328}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_GAMEPORT 1
-#endif
-
 /* === Debug settings ===
   Further diagnostic functionality than the settings below
   does not need to be provided, since one can easily write a POSIX shell script
@@ -296,11 +288,6 @@ struct snd_azf3328 {
 	struct snd_card *card;
 	struct snd_rawmidi *rmidi;
 
-#ifdef SUPPORT_GAMEPORT
-	struct gameport *gameport;
-	u16 axes[4];
-#endif
-
 	struct pci_dev *pci;
 	int irq;
 
@@ -1661,226 +1648,6 @@ snd_azf3328_pcm_pointer(struct snd_pcm_substream *substream
 
 /******************************************************************/
 
-#ifdef SUPPORT_GAMEPORT
-static inline void
-snd_azf3328_gameport_irq_enable(struct snd_azf3328 *chip,
-				bool enable
-)
-{
-	snd_azf3328_io_reg_setb(
-		chip->game_io+IDX_GAME_HWCONFIG,
-		GAME_HWCFG_IRQ_ENABLE,
-		enable
-	);
-}
-
-static inline void
-snd_azf3328_gameport_legacy_address_enable(struct snd_azf3328 *chip,
-					   bool enable
-)
-{
-	snd_azf3328_io_reg_setb(
-		chip->game_io+IDX_GAME_HWCONFIG,
-		GAME_HWCFG_LEGACY_ADDRESS_ENABLE,
-		enable
-	);
-}
-
-static void
-snd_azf3328_gameport_set_counter_frequency(struct snd_azf3328 *chip,
-					   unsigned int freq_cfg
-)
-{
-	snd_azf3328_io_reg_setb(
-		chip->game_io+IDX_GAME_HWCONFIG,
-		0x02,
-		(freq_cfg & 1) != 0
-	);
-	snd_azf3328_io_reg_setb(
-		chip->game_io+IDX_GAME_HWCONFIG,
-		0x04,
-		(freq_cfg & 2) != 0
-	);
-}
-
-static inline void
-snd_azf3328_gameport_axis_circuit_enable(struct snd_azf3328 *chip, bool enable)
-{
-	snd_azf3328_ctrl_reg_6AH_update(
-		chip, IO_6A_SOMETHING2_GAMEPORT, enable
-	);
-}
-
-static inline void
-snd_azf3328_gameport_interrupt(struct snd_azf3328 *chip)
-{
-	/*
-	 * skeleton handler only
-	 * (we do not want axis reading in interrupt handler - too much load!)
-	 */
-	dev_dbg(chip->card->dev, "gameport irq\n");
-
-	 /* this should ACK the gameport IRQ properly, hopefully. */
-	snd_azf3328_game_inw(chip, IDX_GAME_AXIS_VALUE);
-}
-
-static int
-snd_azf3328_gameport_open(struct gameport *gameport, int mode)
-{
-	struct snd_azf3328 *chip = gameport_get_port_data(gameport);
-	int res;
-
-	dev_dbg(chip->card->dev, "gameport_open, mode %d\n", mode);
-	switch (mode) {
-	case GAMEPORT_MODE_COOKED:
-	case GAMEPORT_MODE_RAW:
-		res = 0;
-		break;
-	default:
-		res = -1;
-		break;
-	}
-
-	snd_azf3328_gameport_set_counter_frequency(chip,
-				GAME_HWCFG_ADC_COUNTER_FREQ_STD);
-	snd_azf3328_gameport_axis_circuit_enable(chip, (res == 0));
-
-	return res;
-}
-
-static void
-snd_azf3328_gameport_close(struct gameport *gameport)
-{
-	struct snd_azf3328 *chip = gameport_get_port_data(gameport);
-
-	dev_dbg(chip->card->dev, "gameport_close\n");
-	snd_azf3328_gameport_set_counter_frequency(chip,
-				GAME_HWCFG_ADC_COUNTER_FREQ_1_200);
-	snd_azf3328_gameport_axis_circuit_enable(chip, 0);
-}
-
-static int
-snd_azf3328_gameport_cooked_read(struct gameport *gameport,
-				 int *axes,
-				 int *buttons
-)
-{
-	struct snd_azf3328 *chip = gameport_get_port_data(gameport);
-	int i;
-	u8 val;
-	unsigned long flags;
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-
-	spin_lock_irqsave(&chip->reg_lock, flags);
-	val = snd_azf3328_game_inb(chip, IDX_GAME_LEGACY_COMPATIBLE);
-	*buttons = (~(val) >> 4) & 0xf;
-
-	/* ok, this one is a bit dirty: cooked_read is being polled by a timer,
-	 * thus we're atomic and cannot actively wait in here
-	 * (which would be useful for us since it probably would be better
-	 * to trigger a measurement in here, then wait a short amount of
-	 * time until it's finished, then read values of _this_ measurement).
-	 *
-	 * Thus we simply resort to reading values if they're available already
-	 * and trigger the next measurement.
-	 */
-
-	val = snd_azf3328_game_inb(chip, IDX_GAME_AXES_CONFIG);
-	if (val & GAME_AXES_SAMPLING_READY) {
-		for (i = 0; i < ARRAY_SIZE(chip->axes); ++i) {
-			/* configure the axis to read */
-			val = (i << 4) | 0x0f;
-			snd_azf3328_game_outb(chip, IDX_GAME_AXES_CONFIG, val);
-
-			chip->axes[i] = snd_azf3328_game_inw(
-						chip, IDX_GAME_AXIS_VALUE
-					);
-		}
-	}
-
-	/* trigger next sampling of axes, to be evaluated the next time we
-	 * enter this function */
-
-	/* for some very, very strange reason we cannot enable
-	 * Measurement Ready monitoring for all axes here,
-	 * at least not when only one joystick connected */
-	val = 0x03; /* we're able to monitor axes 1 and 2 only */
-	snd_azf3328_game_outb(chip, IDX_GAME_AXES_CONFIG, val);
-
-	snd_azf3328_game_outw(chip, IDX_GAME_AXIS_VALUE, 0xffff);
-	spin_unlock_irqrestore(&chip->reg_lock, flags);
-
-	for (i = 0; i < ARRAY_SIZE(chip->axes); i++) {
-		axes[i] = chip->axes[i];
-		if (axes[i] == 0xffff)
-			axes[i] = -1;
-	}
-
-	dev_dbg(chip->card->dev, "cooked_read: axes %d %d %d %d buttons %d\n",
-		axes[0], axes[1], axes[2], axes[3], *buttons);
-
-	return 0;
-}
-
-static int
-snd_azf3328_gameport(struct snd_azf3328 *chip, int dev)
-{
-	struct gameport *gp;
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev, "cannot alloc memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "AZF3328 Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gp->io = chip->game_io;
-	gameport_set_port_data(gp, chip);
-
-	gp->open = snd_azf3328_gameport_open;
-	gp->close = snd_azf3328_gameport_close;
-	gp->fuzz = 16; /* seems ok */
-	gp->cooked_read = snd_azf3328_gameport_cooked_read;
-
-	/* DISABLE legacy address: we don't need it! */
-	snd_azf3328_gameport_legacy_address_enable(chip, 0);
-
-	snd_azf3328_gameport_set_counter_frequency(chip,
-				GAME_HWCFG_ADC_COUNTER_FREQ_1_200);
-	snd_azf3328_gameport_axis_circuit_enable(chip, 0);
-
-	gameport_register_port(chip->gameport);
-
-	return 0;
-}
-
-static void
-snd_azf3328_gameport_free(struct snd_azf3328 *chip)
-{
-	if (chip->gameport) {
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-	}
-	snd_azf3328_gameport_irq_enable(chip, 0);
-}
-#else
-static inline int
-snd_azf3328_gameport(struct snd_azf3328 *chip, int dev) { return -ENOSYS; }
-static inline void
-snd_azf3328_gameport_free(struct snd_azf3328 *chip) { }
-static inline void
-snd_azf3328_gameport_interrupt(struct snd_azf3328 *chip)
-{
-	dev_warn(chip->card->dev, "huh, game port IRQ occurred!?\n");
-}
-#endif /* SUPPORT_GAMEPORT */
-
-/******************************************************************/
-
 static inline void
 snd_azf3328_irq_log_unknown_type(struct snd_azf3328 *chip, u8 which)
 {
@@ -1966,7 +1733,7 @@ snd_azf3328_interrupt(int irq, void *dev_id)
 		snd_azf3328_pcm_interrupt(chip, chip->codecs, status);
 
 	if (status & IRQ_GAMEPORT)
-		snd_azf3328_gameport_interrupt(chip);
+		dev_warn(chip->card->dev, "huh, game port IRQ occurred!?\n");
 
 	/* MPU401 has less critical IRQ requirements
 	 * than timer and playback/recording, right? */
@@ -2296,7 +2063,6 @@ snd_azf3328_free(struct snd_azf3328 *chip)
 	snd_azf3328_mixer_reset(chip);
 
 	snd_azf3328_timer_stop(chip->timer);
-	snd_azf3328_gameport_free(chip);
 
 	if (chip->irq >= 0)
 		synchronize_irq(chip->irq);
@@ -2607,8 +2373,6 @@ snd_azf3328_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 		 1024000 / seqtimer_scaling, seqtimer_scaling);
 #endif
 
-	snd_azf3328_gameport(chip, dev);
-
 	pci_set_drvdata(pci, card);
 	dev++;
 
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c
index 12c318e..023a9d2 100644
--- a/sound/pci/cmipci.c
+++ b/sound/pci/cmipci.c
@@ -26,7 +26,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <sound/core.h>
@@ -48,19 +47,12 @@ MODULE_SUPPORTED_DEVICE("{{C-Media,CMI8738},"
 		"{C-Media,CMI8338A},"
 		"{C-Media,CMI8338B}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
 static long mpu_port[SNDRV_CARDS];
 static long fm_port[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
 static bool soft_ac3[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS-1)]=1};
-#ifdef SUPPORT_JOYSTICK
-static int joystick_port[SNDRV_CARDS];
-#endif
 
 module_param_array(index, int, NULL, 0444);
 MODULE_PARM_DESC(index, "Index value for C-Media PCI soundcard.");
@@ -74,10 +66,6 @@ module_param_array(fm_port, long, NULL, 0444);
 MODULE_PARM_DESC(fm_port, "FM port.");
 module_param_array(soft_ac3, bool, NULL, 0444);
 MODULE_PARM_DESC(soft_ac3, "Software-conversion of raw SPDIF packets (model 033 only).");
-#ifdef SUPPORT_JOYSTICK
-module_param_array(joystick_port, int, NULL, 0444);
-MODULE_PARM_DESC(joystick_port, "Joystick port address.");
-#endif
 
 /*
  * CM8x38 registers definition
@@ -498,10 +486,6 @@ struct cmipci {
 	/* external MIDI */
 	struct snd_rawmidi *rmidi;
 
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
-
 	spinlock_t reg_lock;
 
 #ifdef CONFIG_PM_SLEEP
@@ -2865,70 +2849,6 @@ static void query_chip(struct cmipci *cm)
 	}
 }
 
-#ifdef SUPPORT_JOYSTICK
-static int snd_cmipci_create_gameport(struct cmipci *cm, int dev)
-{
-	static int ports[] = { 0x201, 0x200, 0 }; /* FIXME: majority is 0x201? */
-	struct gameport *gp;
-	struct resource *r = NULL;
-	int i, io_port = 0;
-
-	if (joystick_port[dev] == 0)
-		return -ENODEV;
-
-	if (joystick_port[dev] == 1) { /* auto-detect */
-		for (i = 0; ports[i]; i++) {
-			io_port = ports[i];
-			r = request_region(io_port, 1, "CMIPCI gameport");
-			if (r)
-				break;
-		}
-	} else {
-		io_port = joystick_port[dev];
-		r = request_region(io_port, 1, "CMIPCI gameport");
-	}
-
-	if (!r) {
-		dev_warn(cm->card->dev, "cannot reserve joystick ports\n");
-		return -EBUSY;
-	}
-
-	cm->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(cm->card->dev, "cannot allocate memory for gameport\n");
-		release_and_free_resource(r);
-		return -ENOMEM;
-	}
-	gameport_set_name(gp, "C-Media Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(cm->pci));
-	gameport_set_dev_parent(gp, &cm->pci->dev);
-	gp->io = io_port;
-	gameport_set_port_data(gp, r);
-
-	snd_cmipci_set_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
-
-	gameport_register_port(cm->gameport);
-
-	return 0;
-}
-
-static void snd_cmipci_free_gameport(struct cmipci *cm)
-{
-	if (cm->gameport) {
-		struct resource *r = gameport_get_port_data(cm->gameport);
-
-		gameport_unregister_port(cm->gameport);
-		cm->gameport = NULL;
-
-		snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
-		release_and_free_resource(r);
-	}
-}
-#else
-static inline int snd_cmipci_create_gameport(struct cmipci *cm, int dev) { return -ENOSYS; }
-static inline void snd_cmipci_free_gameport(struct cmipci *cm) { }
-#endif
-
 static int snd_cmipci_free(struct cmipci *cm)
 {
 	if (cm->irq >= 0) {
@@ -2946,7 +2866,6 @@ static int snd_cmipci_free(struct cmipci *cm)
 		free_irq(cm->irq, cm);
 	}
 
-	snd_cmipci_free_gameport(cm);
 	pci_release_regions(cm->pci);
 	pci_disable_device(cm->pci);
 	kfree(cm);
@@ -3254,8 +3173,7 @@ static int snd_cmipci_create(struct snd_card *card, struct pci_dev *pci,
 	snd_cmipci_set_bit(cm, CM_REG_MISC_CTRL, CM_SPDIF48K|CM_SPDF_AC97);
 #endif /* USE_VAR48KRATE */
 
-	if (snd_cmipci_create_gameport(cm, dev) < 0)
-		snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
+	snd_cmipci_clear_bit(cm, CM_REG_FUNCTRL1, CM_JYSTK_EN);
 
 	*rcmipci = cm;
 	return 0;
diff --git a/sound/pci/cs4281.c b/sound/pci/cs4281.c
index 43d1f91..4639250 100644
--- a/sound/pci/cs4281.c
+++ b/sound/pci/cs4281.c
@@ -25,7 +25,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <sound/core.h>
 #include <sound/control.h>
@@ -484,8 +483,6 @@ struct cs4281 {
 	unsigned int midcr;
 	unsigned int uartm;
 
-	struct gameport *gameport;
-
 #ifdef CONFIG_PM_SLEEP
 	u32 suspend_regs[SUSPEND_REGISTERS];
 #endif
@@ -1195,118 +1192,8 @@ static void snd_cs4281_proc_init(struct cs4281 *chip)
 	}
 }
 
-/*
- * joystick support
- */
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-
-static void snd_cs4281_gameport_trigger(struct gameport *gameport)
-{
-	struct cs4281 *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return;
-	snd_cs4281_pokeBA0(chip, BA0_JSPT, 0xff);
-}
-
-static unsigned char snd_cs4281_gameport_read(struct gameport *gameport)
-{
-	struct cs4281 *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-	return snd_cs4281_peekBA0(chip, BA0_JSPT);
-}
-
-#ifdef COOKED_MODE
-static int snd_cs4281_gameport_cooked_read(struct gameport *gameport,
-					   int *axes, int *buttons)
-{
-	struct cs4281 *chip = gameport_get_port_data(gameport);
-	unsigned js1, js2, jst;
-	
-	if (snd_BUG_ON(!chip))
-		return 0;
-
-	js1 = snd_cs4281_peekBA0(chip, BA0_JSC1);
-	js2 = snd_cs4281_peekBA0(chip, BA0_JSC2);
-	jst = snd_cs4281_peekBA0(chip, BA0_JSPT);
-	
-	*buttons = (~jst >> 4) & 0x0F; 
-	
-	axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
-	axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
-	axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
-	axes[3] = ((js2 & JSC2_X2V_MASK) >> JSC2_X2V_SHIFT) & 0xFFFF;
-
-	for (jst = 0; jst < 4; ++jst)
-		if (axes[jst] == 0xFFFF) axes[jst] = -1;
-	return 0;
-}
-#else
-#define snd_cs4281_gameport_cooked_read	NULL
-#endif
-
-static int snd_cs4281_gameport_open(struct gameport *gameport, int mode)
-{
-	switch (mode) {
-#ifdef COOKED_MODE
-	case GAMEPORT_MODE_COOKED:
-		return 0;
-#endif
-	case GAMEPORT_MODE_RAW:
-		return 0;
-	default:
-		return -1;
-	}
-	return 0;
-}
-
-static int snd_cs4281_create_gameport(struct cs4281 *chip)
-{
-	struct gameport *gp;
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "CS4281 Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gp->open = snd_cs4281_gameport_open;
-	gp->read = snd_cs4281_gameport_read;
-	gp->trigger = snd_cs4281_gameport_trigger;
-	gp->cooked_read = snd_cs4281_gameport_cooked_read;
-	gameport_set_port_data(gp, chip);
-
-	snd_cs4281_pokeBA0(chip, BA0_JSIO, 0xFF); // ?
-	snd_cs4281_pokeBA0(chip, BA0_JSCTL, JSCTL_SP_MEDIUM_SLOW);
-
-	gameport_register_port(gp);
-
-	return 0;
-}
-
-static void snd_cs4281_free_gameport(struct cs4281 *chip)
-{
-	if (chip->gameport) {
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-	}
-}
-#else
-static inline int snd_cs4281_create_gameport(struct cs4281 *chip) { return -ENOSYS; }
-static inline void snd_cs4281_free_gameport(struct cs4281 *chip) { }
-#endif /* CONFIG_GAMEPORT || (MODULE && CONFIG_GAMEPORT_MODULE) */
-
 static int snd_cs4281_free(struct cs4281 *chip)
 {
-	snd_cs4281_free_gameport(chip);
-
 	if (chip->irq >= 0)
 		synchronize_irq(chip->irq);
 
@@ -1960,7 +1847,6 @@ static int snd_cs4281_probe(struct pci_dev *pci,
 		snd_card_free(card);
 		return err;
 	}
-	snd_cs4281_create_gameport(chip);
 	strcpy(card->driver, "CS4281");
 	strcpy(card->shortname, "Cirrus Logic CS4281");
 	sprintf(card->longname, "%s at 0x%lx, irq %d",
diff --git a/sound/pci/cs46xx/cs46xx.c b/sound/pci/cs46xx/cs46xx.c
index af0eacb..05d8ae2 100644
--- a/sound/pci/cs46xx/cs46xx.c
+++ b/sound/pci/cs46xx/cs46xx.c
@@ -136,8 +136,6 @@ static int snd_card_cs46xx_probe(struct pci_dev *pci,
 	}
 
 
-	snd_cs46xx_gameport(chip);
-
 	strcpy(card->driver, "CS46xx");
 	strcpy(card->shortname, "Sound Fusion CS46xx");
 	sprintf(card->longname, "%s at 0x%lx/0x%lx, irq %i",
diff --git a/sound/pci/cs46xx/cs46xx.h b/sound/pci/cs46xx/cs46xx.h
index c49a082..1b09df8 100644
--- a/sound/pci/cs46xx/cs46xx.h
+++ b/sound/pci/cs46xx/cs46xx.h
@@ -1706,8 +1706,6 @@ struct snd_cs46xx {
 	int accept_valid;	/* accept mmap valid (for OSS) */
 	int in_suspend;
 
-	struct gameport *gameport;
-
 #ifdef CONFIG_SND_CS46XX_NEW_DSP
 	struct mutex spos_mutex;
 
@@ -1744,6 +1742,4 @@ int snd_cs46xx_pcm_center_lfe(struct snd_cs46xx *chip, int device, struct snd_pc
 int snd_cs46xx_mixer(struct snd_cs46xx *chip, int spdif_device);
 int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rmidi);
 int snd_cs46xx_start_dsp(struct snd_cs46xx *chip);
-int snd_cs46xx_gameport(struct snd_cs46xx *chip);
-
 #endif /* __SOUND_CS46XX_H */
diff --git a/sound/pci/cs46xx/cs46xx_lib.c b/sound/pci/cs46xx/cs46xx_lib.c
index 32b44f2..9f87155 100644
--- a/sound/pci/cs46xx/cs46xx_lib.c
+++ b/sound/pci/cs46xx/cs46xx_lib.c
@@ -51,7 +51,6 @@
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/mutex.h>
 #include <linux/export.h>
 #include <linux/module.h>
@@ -2745,108 +2744,6 @@ int snd_cs46xx_midi(struct snd_cs46xx *chip, int device, struct snd_rawmidi **rr
 }
 
 
-/*
- * gameport interface
- */
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-
-static void snd_cs46xx_gameport_trigger(struct gameport *gameport)
-{
-	struct snd_cs46xx *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return;
-	snd_cs46xx_pokeBA0(chip, BA0_JSPT, 0xFF);  //outb(gameport->io, 0xFF);
-}
-
-static unsigned char snd_cs46xx_gameport_read(struct gameport *gameport)
-{
-	struct snd_cs46xx *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-	return snd_cs46xx_peekBA0(chip, BA0_JSPT); //inb(gameport->io);
-}
-
-static int snd_cs46xx_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	struct snd_cs46xx *chip = gameport_get_port_data(gameport);
-	unsigned js1, js2, jst;
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-
-	js1 = snd_cs46xx_peekBA0(chip, BA0_JSC1);
-	js2 = snd_cs46xx_peekBA0(chip, BA0_JSC2);
-	jst = snd_cs46xx_peekBA0(chip, BA0_JSPT);
-	
-	*buttons = (~jst >> 4) & 0x0F; 
-	
-	axes[0] = ((js1 & JSC1_Y1V_MASK) >> JSC1_Y1V_SHIFT) & 0xFFFF;
-	axes[1] = ((js1 & JSC1_X1V_MASK) >> JSC1_X1V_SHIFT) & 0xFFFF;
-	axes[2] = ((js2 & JSC2_Y2V_MASK) >> JSC2_Y2V_SHIFT) & 0xFFFF;
-	axes[3] = ((js2 & JSC2_X2V_MASK) >> JSC2_X2V_SHIFT) & 0xFFFF;
-
-	for(jst=0;jst<4;++jst)
-		if(axes[jst]==0xFFFF) axes[jst] = -1;
-	return 0;
-}
-
-static int snd_cs46xx_gameport_open(struct gameport *gameport, int mode)
-{
-	switch (mode) {
-	case GAMEPORT_MODE_COOKED:
-		return 0;
-	case GAMEPORT_MODE_RAW:
-		return 0;
-	default:
-		return -1;
-	}
-	return 0;
-}
-
-int snd_cs46xx_gameport(struct snd_cs46xx *chip)
-{
-	struct gameport *gp;
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "CS46xx Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gameport_set_port_data(gp, chip);
-
-	gp->open = snd_cs46xx_gameport_open;
-	gp->read = snd_cs46xx_gameport_read;
-	gp->trigger = snd_cs46xx_gameport_trigger;
-	gp->cooked_read = snd_cs46xx_gameport_cooked_read;
-
-	snd_cs46xx_pokeBA0(chip, BA0_JSIO, 0xFF); // ?
-	snd_cs46xx_pokeBA0(chip, BA0_JSCTL, JSCTL_SP_MEDIUM_SLOW);
-
-	gameport_register_port(gp);
-
-	return 0;
-}
-
-static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip)
-{
-	if (chip->gameport) {
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-	}
-}
-#else
-int snd_cs46xx_gameport(struct snd_cs46xx *chip) { return -ENOSYS; }
-static inline void snd_cs46xx_remove_gameport(struct snd_cs46xx *chip) { }
-#endif /* CONFIG_GAMEPORT */
-
 #ifdef CONFIG_PROC_FS
 /*
  *  proc interface
@@ -2961,8 +2858,6 @@ static int snd_cs46xx_free(struct snd_cs46xx *chip)
 	if (chip->active_ctrl)
 		chip->active_ctrl(chip, 1);
 
-	snd_cs46xx_remove_gameport(chip);
-
 	if (chip->amplifier_ctrl)
 		chip->amplifier_ctrl(chip, -chip->amplifier); /* force to off */
 	
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c
index 29cd339..a4fe6d8 100644
--- a/sound/pci/ens1370.c
+++ b/sound/pci/ens1370.c
@@ -32,7 +32,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 
@@ -79,20 +78,9 @@ MODULE_SUPPORTED_DEVICE("{{Ensoniq,AudioPCI ES1371/73},"
 		"{Ectiva,EV1938}}");
 #endif
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable switches */
-#ifdef SUPPORT_JOYSTICK
-#ifdef CHIP1371
-static int joystick_port[SNDRV_CARDS];
-#else
-static bool joystick[SNDRV_CARDS];
-#endif
-#endif
 #ifdef CHIP1371
 static int spdif[SNDRV_CARDS];
 static int lineio[SNDRV_CARDS];
@@ -104,15 +92,6 @@ module_param_array(id, charp, NULL, 0444);
 MODULE_PARM_DESC(id, "ID string for Ensoniq AudioPCI soundcard.");
 module_param_array(enable, bool, NULL, 0444);
 MODULE_PARM_DESC(enable, "Enable Ensoniq AudioPCI soundcard.");
-#ifdef SUPPORT_JOYSTICK
-#ifdef CHIP1371
-module_param_array(joystick_port, int, NULL, 0444);
-MODULE_PARM_DESC(joystick_port, "Joystick port address.");
-#else
-module_param_array(joystick, bool, NULL, 0444);
-MODULE_PARM_DESC(joystick, "Enable joystick.");
-#endif
-#endif /* SUPPORT_JOYSTICK */
 #ifdef CHIP1371
 module_param_array(spdif, int, NULL, 0444);
 MODULE_PARM_DESC(spdif, "S/PDIF output (-1 = none, 0 = auto, 1 = force).");
@@ -438,10 +417,6 @@ struct ensoniq {
 #ifdef CHIP1370
 	struct snd_dma_buffer dma_bug;
 #endif
-
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 };
 
 static irqreturn_t snd_audiopci_interrupt(int irq, void *dev_id);
@@ -1793,107 +1768,6 @@ static int snd_ensoniq_1370_mixer(struct ensoniq *ensoniq)
 
 #endif /* CHIP1370 */
 
-#ifdef SUPPORT_JOYSTICK
-
-#ifdef CHIP1371
-static int snd_ensoniq_get_joystick_port(struct ensoniq *ensoniq, int dev)
-{
-	switch (joystick_port[dev]) {
-	case 0: /* disabled */
-	case 1: /* auto-detect */
-	case 0x200:
-	case 0x208:
-	case 0x210:
-	case 0x218:
-		return joystick_port[dev];
-
-	default:
-		dev_err(ensoniq->card->dev,
-			"invalid joystick port %#x", joystick_port[dev]);
-		return 0;
-	}
-}
-#else
-static int snd_ensoniq_get_joystick_port(struct ensoniq *ensoniq, int dev)
-{
-	return joystick[dev] ? 0x200 : 0;
-}
-#endif
-
-static int snd_ensoniq_create_gameport(struct ensoniq *ensoniq, int dev)
-{
-	struct gameport *gp;
-	int io_port;
-
-	io_port = snd_ensoniq_get_joystick_port(ensoniq, dev);
-
-	switch (io_port) {
-	case 0:
-		return -ENOSYS;
-
-	case 1: /* auto_detect */
-		for (io_port = 0x200; io_port <= 0x218; io_port += 8)
-			if (request_region(io_port, 8, "ens137x: gameport"))
-				break;
-		if (io_port > 0x218) {
-			dev_warn(ensoniq->card->dev,
-				 "no gameport ports available\n");
-			return -EBUSY;
-		}
-		break;
-
-	default:
-		if (!request_region(io_port, 8, "ens137x: gameport")) {
-			dev_warn(ensoniq->card->dev,
-				 "gameport io port %#x in use\n",
-			       io_port);
-			return -EBUSY;
-		}
-		break;
-	}
-
-	ensoniq->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(ensoniq->card->dev,
-			"cannot allocate memory for gameport\n");
-		release_region(io_port, 8);
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "ES137x");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(ensoniq->pci));
-	gameport_set_dev_parent(gp, &ensoniq->pci->dev);
-	gp->io = io_port;
-
-	ensoniq->ctrl |= ES_JYSTK_EN;
-#ifdef CHIP1371
-	ensoniq->ctrl &= ~ES_1371_JOY_ASELM;
-	ensoniq->ctrl |= ES_1371_JOY_ASEL((io_port - 0x200) / 8);
-#endif
-	outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
-
-	gameport_register_port(ensoniq->gameport);
-
-	return 0;
-}
-
-static void snd_ensoniq_free_gameport(struct ensoniq *ensoniq)
-{
-	if (ensoniq->gameport) {
-		int port = ensoniq->gameport->io;
-
-		gameport_unregister_port(ensoniq->gameport);
-		ensoniq->gameport = NULL;
-		ensoniq->ctrl &= ~ES_JYSTK_EN;
-		outl(ensoniq->ctrl, ES_REG(ensoniq, CONTROL));
-		release_region(port, 8);
-	}
-}
-#else
-static inline int snd_ensoniq_create_gameport(struct ensoniq *ensoniq, long port) { return -ENOSYS; }
-static inline void snd_ensoniq_free_gameport(struct ensoniq *ensoniq) { }
-#endif /* SUPPORT_JOYSTICK */
-
 /*
 
  */
@@ -1931,7 +1805,6 @@ static void snd_ensoniq_proc_init(struct ensoniq *ensoniq)
 
 static int snd_ensoniq_free(struct ensoniq *ensoniq)
 {
-	snd_ensoniq_free_gameport(ensoniq);
 	if (ensoniq->irq < 0)
 		goto __hw_end;
 #ifdef CHIP1370
@@ -2475,8 +2348,6 @@ static int snd_audiopci_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	snd_ensoniq_create_gameport(ensoniq, dev);
-
 	strcpy(card->driver, DRIVER_NAME);
 
 	strcpy(card->shortname, "Ensoniq AudioPCI");
diff --git a/sound/pci/es1938.c b/sound/pci/es1938.c
index 34d95bf..7b39573 100644
--- a/sound/pci/es1938.c
+++ b/sound/pci/es1938.c
@@ -51,7 +51,6 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/delay.h>
 #include <linux/dma-mapping.h>
@@ -73,10 +72,6 @@ MODULE_SUPPORTED_DEVICE("{{ESS,ES1938},"
                 "{ESS,ES1969},"
 		"{TerraTec,128i PCI}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
@@ -233,9 +228,6 @@ struct es1938 {
 	spinlock_t mixer_lock;
         struct snd_info_entry *proc_entry;
 
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 #ifdef CONFIG_PM_SLEEP
 	unsigned char saved_regs[SAVED_REG_SIZE];
 #endif
@@ -1526,40 +1518,6 @@ static SIMPLE_DEV_PM_OPS(es1938_pm, es1938_suspend, es1938_resume);
 #define ES1938_PM_OPS	NULL
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef SUPPORT_JOYSTICK
-static int snd_es1938_create_gameport(struct es1938 *chip)
-{
-	struct gameport *gp;
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "ES1938");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gp->io = chip->game_port;
-
-	gameport_register_port(gp);
-
-	return 0;
-}
-
-static void snd_es1938_free_gameport(struct es1938 *chip)
-{
-	if (chip->gameport) {
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-	}
-}
-#else
-static inline int snd_es1938_create_gameport(struct es1938 *chip) { return -ENOSYS; }
-static inline void snd_es1938_free_gameport(struct es1938 *chip) { }
-#endif /* SUPPORT_JOYSTICK */
-
 static int snd_es1938_free(struct es1938 *chip)
 {
 	/* disable irqs */
@@ -1567,8 +1525,6 @@ static int snd_es1938_free(struct es1938 *chip)
 	if (chip->rmidi)
 		snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0);
 
-	snd_es1938_free_gameport(chip);
-
 	if (chip->irq >= 0)
 		free_irq(chip->irq, chip);
 	pci_release_regions(chip->pci);
@@ -1855,8 +1811,6 @@ static int snd_es1938_probe(struct pci_dev *pci,
 		snd_es1938_mixer_bits(chip, ESSSB_IREG_MPU401CONTROL, 0x40, 0x40);
 	}
 
-	snd_es1938_create_gameport(chip);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
diff --git a/sound/pci/es1968.c b/sound/pci/es1968.c
index 5bb1cf6..2cc324f 100644
--- a/sound/pci/es1968.c
+++ b/sound/pci/es1968.c
@@ -101,7 +101,6 @@
 #include <linux/pci.h>
 #include <linux/dma-mapping.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/mutex.h>
 #include <linux/input.h>
@@ -126,10 +125,6 @@ MODULE_SUPPORTED_DEVICE("{{ESS,Maestro 2e},"
 		"{ESS,Maestro 1},"
 		"{TerraTec,DMX}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 1-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
@@ -139,9 +134,6 @@ static int pcm_substreams_c[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 1 };
 static int clock[SNDRV_CARDS];
 static int use_pm[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
 static int enable_mpu[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = 2};
-#ifdef SUPPORT_JOYSTICK
-static bool joystick[SNDRV_CARDS];
-#endif
 static int radio_nr[SNDRV_CARDS] = {[0 ... (SNDRV_CARDS - 1)] = -1};
 
 module_param_array(index, int, NULL, 0444);
@@ -162,10 +154,6 @@ module_param_array(use_pm, int, NULL, 0444);
 MODULE_PARM_DESC(use_pm, "Toggle power-management.  (0 = off, 1 = on, 2 = auto)");
 module_param_array(enable_mpu, int, NULL, 0444);
 MODULE_PARM_DESC(enable_mpu, "Enable MPU401.  (0 = off, 1 = on, 2 = auto)");
-#ifdef SUPPORT_JOYSTICK
-module_param_array(joystick, bool, NULL, 0444);
-MODULE_PARM_DESC(joystick, "Enable joystick.");
-#endif
 module_param_array(radio_nr, int, NULL, 0444);
 MODULE_PARM_DESC(radio_nr, "Radio device numbers");
 
@@ -548,10 +536,6 @@ struct es1968 {
 	u16 apu_map[NR_APUS][NR_APU_REGS];
 #endif
 
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
-
 #ifdef CONFIG_SND_ES1968_INPUT
 	struct input_dev *input_dev;
 	char phys[64];			/* physical device path */
@@ -2465,59 +2449,6 @@ static SIMPLE_DEV_PM_OPS(es1968_pm, es1968_suspend, es1968_resume);
 #define ES1968_PM_OPS	NULL
 #endif /* CONFIG_PM_SLEEP */
 
-#ifdef SUPPORT_JOYSTICK
-#define JOYSTICK_ADDR	0x200
-static int snd_es1968_create_gameport(struct es1968 *chip, int dev)
-{
-	struct gameport *gp;
-	struct resource *r;
-	u16 val;
-
-	if (!joystick[dev])
-		return -ENODEV;
-
-	r = request_region(JOYSTICK_ADDR, 8, "ES1968 gameport");
-	if (!r)
-		return -EBUSY;
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		release_and_free_resource(r);
-		return -ENOMEM;
-	}
-
-	pci_read_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, &val);
-	pci_write_config_word(chip->pci, ESM_LEGACY_AUDIO_CONTROL, val | 0x04);
-
-	gameport_set_name(gp, "ES1968 Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gp->io = JOYSTICK_ADDR;
-	gameport_set_port_data(gp, r);
-
-	gameport_register_port(gp);
-
-	return 0;
-}
-
-static void snd_es1968_free_gameport(struct es1968 *chip)
-{
-	if (chip->gameport) {
-		struct resource *r = gameport_get_port_data(chip->gameport);
-
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-
-		release_and_free_resource(r);
-	}
-}
-#else
-static inline int snd_es1968_create_gameport(struct es1968 *chip, int dev) { return -ENOSYS; }
-static inline void snd_es1968_free_gameport(struct es1968 *chip) { }
-#endif
-
 #ifdef CONFIG_SND_ES1968_INPUT
 static int snd_es1968_input_register(struct es1968 *chip)
 {
@@ -2653,7 +2584,6 @@ static int snd_es1968_free(struct es1968 *chip)
 
 	if (chip->irq >= 0)
 		free_irq(chip->irq, chip);
-	snd_es1968_free_gameport(chip);
 	pci_release_regions(chip->pci);
 	pci_disable_device(chip->pci);
 	kfree(chip);
@@ -2908,8 +2838,6 @@ static int snd_es1968_probe(struct pci_dev *pci,
 		}
 	}
 
-	snd_es1968_create_gameport(chip, dev);
-
 #ifdef CONFIG_SND_ES1968_INPUT
 	err = snd_es1968_input_register(chip);
 	if (err)
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index b4a8278..8ee3267 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -94,7 +94,6 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/wait.h>
-#include <linux/gameport.h>
 #include <linux/device.h>
 #include <linux/firmware.h>
 #include <linux/kernel.h>
@@ -110,10 +109,6 @@
 #include <sound/opl3.h>
 #include <sound/initval.h>
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 MODULE_AUTHOR("Peter Gruber <nokos@gmx.net>");
 MODULE_DESCRIPTION("riptide");
 MODULE_LICENSE("GPL");
@@ -449,9 +444,6 @@ struct snd_riptide {
 	unsigned long port;
 	unsigned short mpuaddr;
 	unsigned short opladdr;
-#ifdef SUPPORT_JOYSTICK
-	unsigned short gameaddr;
-#endif
 	struct resource *res_port;
 
 	unsigned short device_id;
@@ -2023,51 +2015,6 @@ static int snd_riptide_mixer(struct snd_riptide *chip)
 	return err;
 }
 
-#ifdef SUPPORT_JOYSTICK
-
-static int
-snd_riptide_joystick_probe(struct pci_dev *pci, const struct pci_device_id *id)
-{
-	static int dev;
-	struct gameport *gameport;
-
-	if (dev >= SNDRV_CARDS)
-		return -ENODEV;
-	if (!enable[dev]) {
-		dev++;
-		return -ENOENT;
-	}
-
-	if (!joystick_port[dev++])
-		return 0;
-
-	gameport = gameport_allocate_port();
-	if (!gameport)
-		return -ENOMEM;
-	if (!request_region(joystick_port[dev], 8, "Riptide gameport")) {
-		snd_printk(KERN_WARNING
-			   "Riptide: cannot grab gameport 0x%x\n",
-			   joystick_port[dev]);
-		gameport_free_port(gameport);
-		return -EBUSY;
-	}
-
-	gameport->io = joystick_port[dev];
-	gameport_register_port(gameport);
-	pci_set_drvdata(pci, gameport);
-	return 0;
-}
-
-static void snd_riptide_joystick_remove(struct pci_dev *pci)
-{
-	struct gameport *gameport = pci_get_drvdata(pci);
-	if (gameport) {
-		release_region(gameport->io, 8);
-		gameport_unregister_port(gameport);
-	}
-}
-#endif
-
 static int
 snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 {
@@ -2102,10 +2049,6 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 	val = LEGACY_ENABLE_ALL;
 	if (opl3_port[dev])
 		val |= LEGACY_ENABLE_FM;
-#ifdef SUPPORT_JOYSTICK
-	if (joystick_port[dev])
-		val |= LEGACY_ENABLE_GAMEPORT;
-#endif
 	if (mpu_port[dev])
 		val |= LEGACY_ENABLE_MPU_INT | LEGACY_ENABLE_MPU;
 	val |= (chip->irq << 4) & 0xf0;
@@ -2140,27 +2083,13 @@ snd_card_riptide_probe(struct pci_dev *pci, const struct pci_device_id *pci_id)
 					   "Riptide: Can't Allocate OPL3-HWDEP\n");
 		}
 	}
-#ifdef SUPPORT_JOYSTICK
-	if (joystick_port[dev]) {
-		val = joystick_port[dev];
-		pci_write_config_word(chip->pci, PCI_EXT_Game_Base, val);
-		chip->gameaddr = val;
-	}
-#endif
 
 	strcpy(card->driver, "RIPTIDE");
 	strcpy(card->shortname, "Riptide");
-#ifdef SUPPORT_JOYSTICK
-	snprintf(card->longname, sizeof(card->longname),
-		 "%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x gameport 0x%x",
-		 card->shortname, chip->port, chip->irq, chip->mpuaddr,
-		 chip->opladdr, chip->gameaddr);
-#else
 	snprintf(card->longname, sizeof(card->longname),
 		 "%s at 0x%lx, irq %i mpu 0x%x opl3 0x%x",
 		 card->shortname, chip->port, chip->irq, chip->mpuaddr,
 		 chip->opladdr);
-#endif
 	snd_riptide_proc_init(chip);
 	err = snd_card_register(card);
 	if (err < 0)
@@ -2179,7 +2108,7 @@ static void snd_card_riptide_remove(struct pci_dev *pci)
 	snd_card_free(pci_get_drvdata(pci));
 }
 
-static struct pci_driver driver = {
+static struct pci_driver riptide_driver = {
 	.name = KBUILD_MODNAME,
 	.id_table = snd_riptide_ids,
 	.probe = snd_card_riptide_probe,
@@ -2188,38 +2117,4 @@ static struct pci_driver driver = {
 		.pm = RIPTIDE_PM_OPS,
 	},
 };
-
-#ifdef SUPPORT_JOYSTICK
-static struct pci_driver joystick_driver = {
-	.name = KBUILD_MODNAME "-joystick",
-	.id_table = snd_riptide_joystick_ids,
-	.probe = snd_riptide_joystick_probe,
-	.remove = snd_riptide_joystick_remove,
-};
-#endif
-
-static int __init alsa_card_riptide_init(void)
-{
-	int err;
-	err = pci_register_driver(&driver);
-	if (err < 0)
-		return err;
-#if defined(SUPPORT_JOYSTICK)
-	err = pci_register_driver(&joystick_driver);
-	/* On failure unregister formerly registered audio driver */
-	if (err < 0)
-		pci_unregister_driver(&driver);
-#endif
-	return err;
-}
-
-static void __exit alsa_card_riptide_exit(void)
-{
-	pci_unregister_driver(&driver);
-#if defined(SUPPORT_JOYSTICK)
-	pci_unregister_driver(&joystick_driver);
-#endif
-}
-
-module_init(alsa_card_riptide_init);
-module_exit(alsa_card_riptide_exit);
+module_pci_driver(riptide_driver);
diff --git a/sound/pci/sonicvibes.c b/sound/pci/sonicvibes.c
index 2044dc7..6d23df6 100644
--- a/sound/pci/sonicvibes.c
+++ b/sound/pci/sonicvibes.c
@@ -27,7 +27,6 @@
 #include <linux/interrupt.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <linux/dma-mapping.h>
 
@@ -46,10 +45,6 @@ MODULE_DESCRIPTION("S3 SonicVibes PCI");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{S3,SonicVibes PCI}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX;	/* Index 0-MAX */
 static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR;	/* ID for this card */
 static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP;	/* Enable this card */
@@ -236,10 +231,6 @@ struct sonicvibes {
 
 	struct snd_kcontrol *master_mute;
 	struct snd_kcontrol *master_volume;
-
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 };
 
 static DEFINE_PCI_DEVICE_TABLE(snd_sonic_ids) = {
@@ -1187,52 +1178,8 @@ static void snd_sonicvibes_proc_init(struct sonicvibes *sonic)
 		snd_info_set_text_ops(entry, sonic, snd_sonicvibes_proc_read);
 }
 
-/*
-
- */
-
-#ifdef SUPPORT_JOYSTICK
-static struct snd_kcontrol_new snd_sonicvibes_game_control =
-SONICVIBES_SINGLE("Joystick Speed", 0, SV_IREG_GAME_PORT, 1, 15, 0);
-
-static int snd_sonicvibes_create_gameport(struct sonicvibes *sonic)
-{
-	struct gameport *gp;
-
-	sonic->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(sonic->card->dev,
-			"sonicvibes: cannot allocate memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "SonicVibes Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(sonic->pci));
-	gameport_set_dev_parent(gp, &sonic->pci->dev);
-	gp->io = sonic->game_port;
-
-	gameport_register_port(gp);
-
-	snd_ctl_add(sonic->card, snd_ctl_new1(&snd_sonicvibes_game_control, sonic));
-
-	return 0;
-}
-
-static void snd_sonicvibes_free_gameport(struct sonicvibes *sonic)
-{
-	if (sonic->gameport) {
-		gameport_unregister_port(sonic->gameport);
-		sonic->gameport = NULL;
-	}
-}
-#else
-static inline int snd_sonicvibes_create_gameport(struct sonicvibes *sonic) { return -ENOSYS; }
-static inline void snd_sonicvibes_free_gameport(struct sonicvibes *sonic) { }
-#endif
-
 static int snd_sonicvibes_free(struct sonicvibes *sonic)
 {
-	snd_sonicvibes_free_gameport(sonic);
 	pci_write_config_dword(sonic->pci, 0x40, sonic->dmaa_port);
 	pci_write_config_dword(sonic->pci, 0x48, sonic->dmac_port);
 	if (sonic->irq >= 0)
@@ -1525,8 +1472,6 @@ static int snd_sonic_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	snd_sonicvibes_create_gameport(sonic);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
diff --git a/sound/pci/trident/trident.c b/sound/pci/trident/trident.c
index d852458..927d386 100644
--- a/sound/pci/trident/trident.c
+++ b/sound/pci/trident/trident.c
@@ -156,8 +156,6 @@ static int snd_trident_probe(struct pci_dev *pci,
 		return err;
 	}
 
-	snd_trident_create_gameport(trident);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
diff --git a/sound/pci/trident/trident.h b/sound/pci/trident/trident.h
index 5f110eb..251455a 100644
--- a/sound/pci/trident/trident.h
+++ b/sound/pci/trident/trident.h
@@ -408,8 +408,6 @@ struct snd_trident {
 	struct snd_kcontrol *ctl_cvol;	/* center volume */
 
 	spinlock_t reg_lock;
-
-	struct gameport *gameport;
 };
 
 int snd_trident_create(struct snd_card *card,
@@ -418,7 +416,6 @@ int snd_trident_create(struct snd_card *card,
 		       int pcm_spdif_device,
 		       int max_wavetable_size,
 		       struct snd_trident ** rtrident);
-int snd_trident_create_gameport(struct snd_trident *trident);
 
 int snd_trident_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
 int snd_trident_foldback_pcm(struct snd_trident * trident, int device, struct snd_pcm **rpcm);
diff --git a/sound/pci/trident/trident_main.c b/sound/pci/trident/trident_main.c
index 1272c18..ff4ec6c 100644
--- a/sound/pci/trident/trident_main.c
+++ b/sound/pci/trident/trident_main.c
@@ -33,7 +33,6 @@
 #include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/vmalloc.h>
-#include <linux/gameport.h>
 #include <linux/dma-mapping.h>
 #include <linux/export.h>
 
@@ -3133,107 +3132,6 @@ static int snd_trident_mixer(struct snd_trident *trident, int pcm_spdif_device)
 }
 
 /*
- * gameport interface
- */
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-
-static unsigned char snd_trident_gameport_read(struct gameport *gameport)
-{
-	struct snd_trident *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-	return inb(TRID_REG(chip, GAMEPORT_LEGACY));
-}
-
-static void snd_trident_gameport_trigger(struct gameport *gameport)
-{
-	struct snd_trident *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return;
-	outb(0xff, TRID_REG(chip, GAMEPORT_LEGACY));
-}
-
-static int snd_trident_gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	struct snd_trident *chip = gameport_get_port_data(gameport);
-	int i;
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-
-	*buttons = (~inb(TRID_REG(chip, GAMEPORT_LEGACY)) >> 4) & 0xf;
-
-	for (i = 0; i < 4; i++) {
-		axes[i] = inw(TRID_REG(chip, GAMEPORT_AXES + i * 2));
-		if (axes[i] == 0xffff) axes[i] = -1;
-	}
-        
-        return 0;
-}
-
-static int snd_trident_gameport_open(struct gameport *gameport, int mode)
-{
-	struct snd_trident *chip = gameport_get_port_data(gameport);
-
-	if (snd_BUG_ON(!chip))
-		return 0;
-
-	switch (mode) {
-		case GAMEPORT_MODE_COOKED:
-			outb(GAMEPORT_MODE_ADC, TRID_REG(chip, GAMEPORT_GCR));
-			msleep(20);
-			return 0;
-		case GAMEPORT_MODE_RAW:
-			outb(0, TRID_REG(chip, GAMEPORT_GCR));
-			return 0;
-		default:
-			return -1;
-	}
-}
-
-int snd_trident_create_gameport(struct snd_trident *chip)
-{
-	struct gameport *gp;
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "Trident 4DWave");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-
-	gameport_set_port_data(gp, chip);
-	gp->fuzz = 64;
-	gp->read = snd_trident_gameport_read;
-	gp->trigger = snd_trident_gameport_trigger;
-	gp->cooked_read = snd_trident_gameport_cooked_read;
-	gp->open = snd_trident_gameport_open;
-
-	gameport_register_port(gp);
-
-	return 0;
-}
-
-static inline void snd_trident_free_gameport(struct snd_trident *chip)
-{
-	if (chip->gameport) {
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-	}
-}
-#else
-int snd_trident_create_gameport(struct snd_trident *chip) { return -ENOSYS; }
-static inline void snd_trident_free_gameport(struct snd_trident *chip) { }
-#endif /* CONFIG_GAMEPORT */
-
-/*
  * delay for 1 tick
  */
 static inline void do_delay(struct snd_trident *chip)
@@ -3690,7 +3588,6 @@ int snd_trident_create(struct snd_card *card,
 
 static int snd_trident_free(struct snd_trident *trident)
 {
-	snd_trident_free_gameport(trident);
 	snd_trident_disable_eso(trident);
 	// Disable S/PDIF out
 	if (trident->device == TRIDENT_DEVICE_ID_NX)
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c
index 95b98f5..ee90b1a 100644
--- a/sound/pci/via82xx.c
+++ b/sound/pci/via82xx.c
@@ -52,7 +52,6 @@
 #include <linux/init.h>
 #include <linux/pci.h>
 #include <linux/slab.h>
-#include <linux/gameport.h>
 #include <linux/module.h>
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -72,16 +71,9 @@ MODULE_DESCRIPTION("VIA VT82xx audio");
 MODULE_LICENSE("GPL");
 MODULE_SUPPORTED_DEVICE("{{VIA,VT82C686A/B/C,pci},{VIA,VT8233A/C,8235}}");
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK 1
-#endif
-
 static int index = SNDRV_DEFAULT_IDX1;	/* Index 0-MAX */
 static char *id = SNDRV_DEFAULT_STR1;	/* ID for this card */
 static long mpu_port;
-#ifdef SUPPORT_JOYSTICK
-static bool joystick;
-#endif
 static int ac97_clock = 48000;
 static char *ac97_quirk;
 static int dxs_support;
@@ -94,10 +86,6 @@ module_param(id, charp, 0444);
 MODULE_PARM_DESC(id, "ID string for VIA 82xx bridge.");
 module_param(mpu_port, long, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 port. (VT82C686x only)");
-#ifdef SUPPORT_JOYSTICK
-module_param(joystick, bool, 0444);
-MODULE_PARM_DESC(joystick, "Enable joystick. (VT82C686x only)");
-#endif
 module_param(ac97_clock, int, 0444);
 MODULE_PARM_DESC(ac97_clock, "AC'97 codec clock (default 48000Hz).");
 module_param(ac97_quirk, charp, 0444);
@@ -398,10 +386,6 @@ struct via82xx {
 
 	spinlock_t reg_lock;
 	struct snd_info_entry *proc_entry;
-
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 };
 
 static DEFINE_PCI_DEVICE_TABLE(snd_via82xx_ids) = {
@@ -1934,64 +1918,6 @@ static int snd_via82xx_mixer_new(struct via82xx *chip, const char *quirk_overrid
 	return 0;
 }
 
-#ifdef SUPPORT_JOYSTICK
-#define JOYSTICK_ADDR	0x200
-static int snd_via686_create_gameport(struct via82xx *chip, unsigned char *legacy)
-{
-	struct gameport *gp;
-	struct resource *r;
-
-	if (!joystick)
-		return -ENODEV;
-
-	r = request_region(JOYSTICK_ADDR, 8, "VIA686 gameport");
-	if (!r) {
-		dev_warn(chip->card->dev, "cannot reserve joystick port %#x\n",
-		       JOYSTICK_ADDR);
-		return -EBUSY;
-	}
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		release_and_free_resource(r);
-		return -ENOMEM;
-	}
-
-	gameport_set_name(gp, "VIA686 Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gp->io = JOYSTICK_ADDR;
-	gameport_set_port_data(gp, r);
-
-	/* Enable legacy joystick port */
-	*legacy |= VIA_FUNC_ENABLE_GAME;
-	pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, *legacy);
-
-	gameport_register_port(chip->gameport);
-
-	return 0;
-}
-
-static void snd_via686_free_gameport(struct via82xx *chip)
-{
-	if (chip->gameport) {
-		struct resource *r = gameport_get_port_data(chip->gameport);
-
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-		release_and_free_resource(r);
-	}
-}
-#else
-static inline int snd_via686_create_gameport(struct via82xx *chip, unsigned char *legacy)
-{
-	return -ENOSYS;
-}
-static inline void snd_via686_free_gameport(struct via82xx *chip) { }
-#endif
-
 
 /*
  *
@@ -2120,8 +2046,6 @@ static int snd_via686_init_misc(struct via82xx *chip)
 		pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, legacy);
 	}
 
-	snd_via686_create_gameport(chip, &legacy);
-
 #ifdef CONFIG_PM_SLEEP
 	chip->legacy_saved = legacy;
 	chip->legacy_cfg_saved = legacy_cfg;
@@ -2364,7 +2288,6 @@ static int snd_via82xx_free(struct via82xx *chip)
 	pci_release_regions(chip->pci);
 
 	if (chip->chip_type == TYPE_VIA686) {
-		snd_via686_free_gameport(chip);
 		pci_write_config_byte(chip->pci, VIA_FUNC_ENABLE, chip->old_legacy);
 		pci_write_config_byte(chip->pci, VIA_PNP_CONTROL, chip->old_legacy_cfg);
 	}
diff --git a/sound/pci/ymfpci/ymfpci.c b/sound/pci/ymfpci/ymfpci.c
index 82eed16..7c62d76 100644
--- a/sound/pci/ymfpci/ymfpci.c
+++ b/sound/pci/ymfpci/ymfpci.c
@@ -59,10 +59,6 @@ module_param_array(mpu_port, long, NULL, 0444);
 MODULE_PARM_DESC(mpu_port, "MPU-401 Port.");
 module_param_array(fm_port, long, NULL, 0444);
 MODULE_PARM_DESC(fm_port, "FM OPL-3 Port.");
-#ifdef SUPPORT_JOYSTICK
-module_param_array(joystick_port, long, NULL, 0444);
-MODULE_PARM_DESC(joystick_port, "Joystick port address");
-#endif
 module_param_array(rear_switch, bool, NULL, 0444);
 MODULE_PARM_DESC(rear_switch, "Enable shared rear/line-in switch");
 
@@ -78,99 +74,6 @@ static DEFINE_PCI_DEVICE_TABLE(snd_ymfpci_ids) = {
 
 MODULE_DEVICE_TABLE(pci, snd_ymfpci_ids);
 
-#ifdef SUPPORT_JOYSTICK
-static int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev,
-				      int legacy_ctrl, int legacy_ctrl2)
-{
-	struct gameport *gp;
-	struct resource *r = NULL;
-	int io_port = joystick_port[dev];
-
-	if (!io_port)
-		return -ENODEV;
-
-	if (chip->pci->device >= 0x0010) { /* YMF 744/754 */
-
-		if (io_port == 1) {
-			/* auto-detect */
-			if (!(io_port = pci_resource_start(chip->pci, 2)))
-				return -ENODEV;
-		}
-	} else {
-		if (io_port == 1) {
-			/* auto-detect */
-			for (io_port = 0x201; io_port <= 0x205; io_port++) {
-				if (io_port == 0x203)
-					continue;
-				if ((r = request_region(io_port, 1, "YMFPCI gameport")) != NULL)
-					break;
-			}
-			if (!r) {
-				dev_err(chip->card->dev,
-					"no gameport ports available\n");
-				return -EBUSY;
-			}
-		}
-		switch (io_port) {
-		case 0x201: legacy_ctrl2 |= 0 << 6; break;
-		case 0x202: legacy_ctrl2 |= 1 << 6; break;
-		case 0x204: legacy_ctrl2 |= 2 << 6; break;
-		case 0x205: legacy_ctrl2 |= 3 << 6; break;
-		default:
-			dev_err(chip->card->dev,
-				"invalid joystick port %#x", io_port);
-			return -EINVAL;
-		}
-	}
-
-	if (!r && !(r = request_region(io_port, 1, "YMFPCI gameport"))) {
-		dev_err(chip->card->dev,
-			"joystick port %#x is in use.\n", io_port);
-		return -EBUSY;
-	}
-
-	chip->gameport = gp = gameport_allocate_port();
-	if (!gp) {
-		dev_err(chip->card->dev,
-			"cannot allocate memory for gameport\n");
-		release_and_free_resource(r);
-		return -ENOMEM;
-	}
-
-
-	gameport_set_name(gp, "Yamaha YMF Gameport");
-	gameport_set_phys(gp, "pci%s/gameport0", pci_name(chip->pci));
-	gameport_set_dev_parent(gp, &chip->pci->dev);
-	gp->io = io_port;
-	gameport_set_port_data(gp, r);
-
-	if (chip->pci->device >= 0x0010) /* YMF 744/754 */
-		pci_write_config_word(chip->pci, PCIR_DSXG_JOYBASE, io_port);
-
-	pci_write_config_word(chip->pci, PCIR_DSXG_LEGACY, legacy_ctrl | YMFPCI_LEGACY_JPEN);
-	pci_write_config_word(chip->pci, PCIR_DSXG_ELEGACY, legacy_ctrl2);
-
-	gameport_register_port(chip->gameport);
-
-	return 0;
-}
-
-void snd_ymfpci_free_gameport(struct snd_ymfpci *chip)
-{
-	if (chip->gameport) {
-		struct resource *r = gameport_get_port_data(chip->gameport);
-
-		gameport_unregister_port(chip->gameport);
-		chip->gameport = NULL;
-
-		release_and_free_resource(r);
-	}
-}
-#else
-static inline int snd_ymfpci_create_gameport(struct snd_ymfpci *chip, int dev, int l, int l2) { return -ENOSYS; }
-void snd_ymfpci_free_gameport(struct snd_ymfpci *chip) { }
-#endif /* SUPPORT_JOYSTICK */
-
 static int snd_card_ymfpci_probe(struct pci_dev *pci,
 				 const struct pci_device_id *pci_id)
 {
@@ -342,8 +245,6 @@ static int snd_card_ymfpci_probe(struct pci_dev *pci,
 		}
 	}
 
-	snd_ymfpci_create_gameport(chip, dev, legacy_ctrl, legacy_ctrl2);
-
 	if ((err = snd_card_register(card)) < 0) {
 		snd_card_free(card);
 		return err;
diff --git a/sound/pci/ymfpci/ymfpci.h b/sound/pci/ymfpci/ymfpci.h
index 4631a23..a3d469a 100644
--- a/sound/pci/ymfpci/ymfpci.h
+++ b/sound/pci/ymfpci/ymfpci.h
@@ -26,7 +26,6 @@
 #include <sound/rawmidi.h>
 #include <sound/ac97_codec.h>
 #include <sound/timer.h>
-#include <linux/gameport.h>
 
 /*
  *  Direct registers
@@ -176,10 +175,6 @@
 #define YMFPCI_LEGACY2_IMOD	(1 << 15)	/* legacy IRQ mode */
 /* SIEN:IMOD 0:0 = legacy irq, 0:1 = INTA, 1:0 = serialized IRQ */
 
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-#define SUPPORT_JOYSTICK
-#endif
-
 /*
  *
  */
@@ -295,9 +290,6 @@ struct snd_ymfpci {
 	struct resource *mpu_res;
 
 	unsigned short old_legacy_ctrl;
-#ifdef SUPPORT_JOYSTICK
-	struct gameport *gameport;
-#endif
 
 	struct snd_dma_buffer work_ptr;
 
@@ -375,7 +367,6 @@ int snd_ymfpci_create(struct snd_card *card,
 		      struct pci_dev *pci,
 		      unsigned short old_legacy_ctrl,
 		      struct snd_ymfpci ** rcodec);
-void snd_ymfpci_free_gameport(struct snd_ymfpci *chip);
 
 extern const struct dev_pm_ops snd_ymfpci_pm;
 
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c
index 81c916a..2ade07e 100644
--- a/sound/pci/ymfpci/ymfpci_main.c
+++ b/sound/pci/ymfpci/ymfpci_main.c
@@ -2271,7 +2271,6 @@ static int snd_ymfpci_free(struct snd_ymfpci *chip)
 		free_irq(chip->irq, chip);
 	release_and_free_resource(chip->mpu_res);
 	release_and_free_resource(chip->fm_res);
-	snd_ymfpci_free_gameport(chip);
 	if (chip->reg_area_virt)
 		iounmap(chip->reg_area_virt);
 	if (chip->work_ptr.area)
-- 
2.1.0.rc2.206.gedb03e5


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* [PATCH 2/2] Input: remove gameport subsystem
  2014-08-19 16:41 [PATCH 1/2] SOUND: kill gameport bits Dmitry Torokhov
@ 2014-08-19 16:41 ` Dmitry Torokhov
  2014-08-20  7:33 ` [PATCH 1/2] SOUND: kill gameport bits Clemens Ladisch
  1 sibling, 0 replies; 23+ messages in thread
From: Dmitry Torokhov @ 2014-08-19 16:41 UTC (permalink / raw)
  To: linux-input
  Cc: linux-kernel, Vojtech Pavlik, Jiri Kosina, Takashi Iwai, Dmitry Torokhov

Gameport support hasn't been working well ever since cpufreq became
mainstream and it becomes increasingly hard to find hardware and software
that would run on such old hardware.

It is time to retire it.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/Makefile                    |   1 -
 drivers/input/Kconfig               |   2 -
 drivers/input/gameport/Kconfig      |  63 ---
 drivers/input/gameport/Makefile     |  11 -
 drivers/input/gameport/emu10k1-gp.c | 127 ------
 drivers/input/gameport/fm801-gp.c   | 159 -------
 drivers/input/gameport/gameport.c   | 823 ------------------------------------
 drivers/input/gameport/lightning.c  | 341 ---------------
 drivers/input/gameport/ns558.c      | 286 -------------
 drivers/input/joystick/Kconfig      | 127 ------
 drivers/input/joystick/Makefile     |  12 -
 drivers/input/joystick/a3d.c        | 415 ------------------
 drivers/input/joystick/adi.c        | 568 -------------------------
 drivers/input/joystick/analog.c     | 769 ---------------------------------
 drivers/input/joystick/cobra.c      | 263 ------------
 drivers/input/joystick/gf2k.c       | 375 ----------------
 drivers/input/joystick/grip.c       | 426 -------------------
 drivers/input/joystick/grip_mp.c    | 689 ------------------------------
 drivers/input/joystick/guillemot.c  | 283 -------------
 drivers/input/joystick/interact.c   | 313 --------------
 drivers/input/joystick/joydump.c    | 161 -------
 drivers/input/joystick/sidewinder.c | 822 -----------------------------------
 drivers/input/joystick/tmdc.c       | 438 -------------------
 include/linux/gameport.h            | 219 ----------
 include/uapi/linux/Kbuild           |   1 -
 include/uapi/linux/gameport.h       |  28 --
 26 files changed, 7722 deletions(-)
 delete mode 100644 drivers/input/gameport/Kconfig
 delete mode 100644 drivers/input/gameport/Makefile
 delete mode 100644 drivers/input/gameport/emu10k1-gp.c
 delete mode 100644 drivers/input/gameport/fm801-gp.c
 delete mode 100644 drivers/input/gameport/gameport.c
 delete mode 100644 drivers/input/gameport/lightning.c
 delete mode 100644 drivers/input/gameport/ns558.c
 delete mode 100644 drivers/input/joystick/a3d.c
 delete mode 100644 drivers/input/joystick/adi.c
 delete mode 100644 drivers/input/joystick/analog.c
 delete mode 100644 drivers/input/joystick/cobra.c
 delete mode 100644 drivers/input/joystick/gf2k.c
 delete mode 100644 drivers/input/joystick/grip.c
 delete mode 100644 drivers/input/joystick/grip_mp.c
 delete mode 100644 drivers/input/joystick/guillemot.c
 delete mode 100644 drivers/input/joystick/interact.c
 delete mode 100644 drivers/input/joystick/joydump.c
 delete mode 100644 drivers/input/joystick/sidewinder.c
 delete mode 100644 drivers/input/joystick/tmdc.c
 delete mode 100644 include/linux/gameport.h
 delete mode 100644 include/uapi/linux/gameport.h

diff --git a/drivers/Makefile b/drivers/Makefile
index f98b50d..e9e0278 100644
--- a/drivers/Makefile
+++ b/drivers/Makefile
@@ -92,7 +92,6 @@ obj-$(CONFIG_USB)		+= usb/
 obj-$(CONFIG_PCI)		+= usb/
 obj-$(CONFIG_USB_GADGET)	+= usb/
 obj-$(CONFIG_SERIO)		+= input/serio/
-obj-$(CONFIG_GAMEPORT)		+= input/gameport/
 obj-$(CONFIG_INPUT)		+= input/
 obj-$(CONFIG_I2O)		+= message/
 obj-$(CONFIG_RTC_LIB)		+= rtc/
diff --git a/drivers/input/Kconfig b/drivers/input/Kconfig
index 1f68e5a..edef9e6 100644
--- a/drivers/input/Kconfig
+++ b/drivers/input/Kconfig
@@ -196,8 +196,6 @@ menu "Hardware I/O ports"
 
 source "drivers/input/serio/Kconfig"
 
-source "drivers/input/gameport/Kconfig"
-
 endmenu
 
 endmenu
diff --git a/drivers/input/gameport/Kconfig b/drivers/input/gameport/Kconfig
deleted file mode 100644
index d279454..0000000
--- a/drivers/input/gameport/Kconfig
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# Gameport configuration
-#
-config GAMEPORT
-	tristate "Gameport support"
-	---help---
-	  Gameport support is for the standard 15-pin PC gameport. If you
-	  have a joystick, gamepad, gameport card, a soundcard with a gameport
-	  or anything else that uses the gameport, say Y or M here and also to
-	  at least one of the hardware specific drivers.
-
-	  For Ensoniq AudioPCI (ES1370), AudioPCI 97 (ES1371), ESS Solo1,
-	  S3 SonicVibes, Trident 4DWave, SiS7018, and ALi 5451 gameport
-	  support is provided by the sound drivers, so you won't need any
-	  from the below listed modules. You still need to say Y here.
-
-	  If unsure, say Y.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called gameport.
-
-if GAMEPORT
-
-config GAMEPORT_NS558
-	tristate "Classic ISA and PnP gameport support"
-	help
-	  Say Y here if you have an ISA or PnP gameport.
-
-	  If unsure, say Y.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called ns558.
-
-config GAMEPORT_L4
-	tristate "PDPI Lightning 4 gamecard support"
-	help
-	  Say Y here if you have a PDPI Lightning 4 gamecard.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called lightning.
-
-config GAMEPORT_EMU10K1
-	tristate "SB Live and Audigy gameport support"
-	depends on PCI
-	help
-	  Say Y here if you have a SoundBlaster Live! or SoundBlaster
-	  Audigy card and want to use its gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called emu10k1-gp.
-
-config GAMEPORT_FM801
-	tristate "ForteMedia FM801 gameport support"
-	depends on PCI
-	help
-	  Say Y here if you have ForteMedia FM801 PCI audio controller
-	  (Abit AU10, Genius Sound Maker, HP Workstation zx2000,
-	  and others), and want to use its gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called fm801-gp.
-
-endif
diff --git a/drivers/input/gameport/Makefile b/drivers/input/gameport/Makefile
deleted file mode 100644
index b6f6097..0000000
--- a/drivers/input/gameport/Makefile
+++ /dev/null
@@ -1,11 +0,0 @@
-#
-# Makefile for the gameport drivers.
-#
-
-# Each configuration option enables a list of files.
-
-obj-$(CONFIG_GAMEPORT)		+= gameport.o
-obj-$(CONFIG_GAMEPORT_EMU10K1)	+= emu10k1-gp.o
-obj-$(CONFIG_GAMEPORT_FM801)	+= fm801-gp.o
-obj-$(CONFIG_GAMEPORT_L4)	+= lightning.o
-obj-$(CONFIG_GAMEPORT_NS558)	+= ns558.o
diff --git a/drivers/input/gameport/emu10k1-gp.c b/drivers/input/gameport/emu10k1-gp.c
deleted file mode 100644
index 2909e95..0000000
--- a/drivers/input/gameport/emu10k1-gp.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *  Copyright (c) 2001 Vojtech Pavlik
- */
-
-/*
- * EMU10k1 - SB Live / Audigy - gameport driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <asm/io.h>
-
-#include <linux/module.h>
-#include <linux/ioport.h>
-#include <linux/gameport.h>
-#include <linux/slab.h>
-#include <linux/pci.h>
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION("EMU10k1 gameport driver");
-MODULE_LICENSE("GPL");
-
-struct emu {
-	struct pci_dev *dev;
-	struct gameport *gameport;
-	int io;
-	int size;
-};
-
-static const struct pci_device_id emu_tbl[] = {
-
-	{ 0x1102, 0x7002, PCI_ANY_ID, PCI_ANY_ID }, /* SB Live gameport */
-	{ 0x1102, 0x7003, PCI_ANY_ID, PCI_ANY_ID }, /* Audigy gameport */
-	{ 0x1102, 0x7004, PCI_ANY_ID, PCI_ANY_ID }, /* Dell SB Live */
-	{ 0x1102, 0x7005, PCI_ANY_ID, PCI_ANY_ID }, /* Audigy LS gameport */
-	{ 0, }
-};
-
-MODULE_DEVICE_TABLE(pci, emu_tbl);
-
-static int emu_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
-{
-	struct emu *emu;
-	struct gameport *port;
-	int error;
-
-	emu = kzalloc(sizeof(struct emu), GFP_KERNEL);
-	port = gameport_allocate_port();
-	if (!emu || !port) {
-		printk(KERN_ERR "emu10k1-gp: Memory allocation failed\n");
-		error = -ENOMEM;
-		goto err_out_free;
-	}
-
-	error = pci_enable_device(pdev);
-	if (error)
-		goto err_out_free;
-
-	emu->io = pci_resource_start(pdev, 0);
-	emu->size = pci_resource_len(pdev, 0);
-
-	emu->dev = pdev;
-	emu->gameport = port;
-
-	gameport_set_name(port, "EMU10K1");
-	gameport_set_phys(port, "pci%s/gameport0", pci_name(pdev));
-	port->dev.parent = &pdev->dev;
-	port->io = emu->io;
-
-	if (!request_region(emu->io, emu->size, "emu10k1-gp")) {
-		printk(KERN_ERR "emu10k1-gp: unable to grab region 0x%x-0x%x\n",
-			emu->io, emu->io + emu->size - 1);
-		error = -EBUSY;
-		goto err_out_disable_dev;
-	}
-
-	pci_set_drvdata(pdev, emu);
-
-	gameport_register_port(port);
-
-	return 0;
-
- err_out_disable_dev:
-	pci_disable_device(pdev);
- err_out_free:
-	gameport_free_port(port);
-	kfree(emu);
-	return error;
-}
-
-static void emu_remove(struct pci_dev *pdev)
-{
-	struct emu *emu = pci_get_drvdata(pdev);
-
-	gameport_unregister_port(emu->gameport);
-	release_region(emu->io, emu->size);
-	kfree(emu);
-
-	pci_disable_device(pdev);
-}
-
-static struct pci_driver emu_driver = {
-        .name =         "Emu10k1_gameport",
-        .id_table =     emu_tbl,
-        .probe =        emu_probe,
-	.remove =	emu_remove,
-};
-
-module_pci_driver(emu_driver);
diff --git a/drivers/input/gameport/fm801-gp.c b/drivers/input/gameport/fm801-gp.c
deleted file mode 100644
index 7c03114..0000000
--- a/drivers/input/gameport/fm801-gp.c
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- *  FM801 gameport driver for Linux
- *
- *  Copyright (c) by Takashi Iwai <tiwai@suse.de>
- *
- *
- *   This program is free software; you can redistribute it and/or modify
- *   it under the terms of the GNU General Public License as published by
- *   the Free Software Foundation; either version 2 of the License, or
- *   (at your option) any later version.
- *
- *   This program is distributed in the hope that it will be useful,
- *   but WITHOUT ANY WARRANTY; without even the implied warranty of
- *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *   GNU General Public License for more details.
- *
- *   You should have received a copy of the GNU General Public License
- *   along with this program; if not, write to the Free Software
- *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- */
-
-#include <asm/io.h>
-#include <linux/delay.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/pci.h>
-#include <linux/slab.h>
-#include <linux/gameport.h>
-
-#define PCI_VENDOR_ID_FORTEMEDIA	0x1319
-#define PCI_DEVICE_ID_FM801_GP	0x0802
-
-#define HAVE_COOKED
-
-struct fm801_gp {
-	struct gameport *gameport;
-	struct resource *res_port;
-};
-
-#ifdef HAVE_COOKED
-static int fm801_gp_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	unsigned short w;
-
-	w = inw(gameport->io + 2);
-	*buttons = (~w >> 14) & 0x03;
-	axes[0] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
-	w = inw(gameport->io + 4);
-	axes[1] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
-	w = inw(gameport->io + 6);
-	*buttons |= ((~w >> 14) & 0x03) << 2;
-	axes[2] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
-	w = inw(gameport->io + 8);
-	axes[3] = (w == 0xffff) ? -1 : ((w & 0x1fff) << 5);
-	outw(0xff, gameport->io); /* reset */
-
-        return 0;
-}
-#endif
-
-static int fm801_gp_open(struct gameport *gameport, int mode)
-{
-	switch (mode) {
-#ifdef HAVE_COOKED
-	case GAMEPORT_MODE_COOKED:
-		return 0;
-#endif
-	case GAMEPORT_MODE_RAW:
-		return 0;
-	default:
-		return -1;
-	}
-
-	return 0;
-}
-
-static int fm801_gp_probe(struct pci_dev *pci, const struct pci_device_id *id)
-{
-	struct fm801_gp *gp;
-	struct gameport *port;
-	int error;
-
-	gp = kzalloc(sizeof(struct fm801_gp), GFP_KERNEL);
-	port = gameport_allocate_port();
-	if (!gp || !port) {
-		printk(KERN_ERR "fm801-gp: Memory allocation failed\n");
-		error = -ENOMEM;
-		goto err_out_free;
-	}
-
-	error = pci_enable_device(pci);
-	if (error)
-		goto err_out_free;
-
-	port->open = fm801_gp_open;
-#ifdef HAVE_COOKED
-	port->cooked_read = fm801_gp_cooked_read;
-#endif
-	gameport_set_name(port, "FM801");
-	gameport_set_phys(port, "pci%s/gameport0", pci_name(pci));
-	port->dev.parent = &pci->dev;
-	port->io = pci_resource_start(pci, 0);
-
-	gp->gameport = port;
-	gp->res_port = request_region(port->io, 0x10, "FM801 GP");
-	if (!gp->res_port) {
-		printk(KERN_DEBUG "fm801-gp: unable to grab region 0x%x-0x%x\n",
-			port->io, port->io + 0x0f);
-		error = -EBUSY;
-		goto err_out_disable_dev;
-	}
-
-	pci_set_drvdata(pci, gp);
-
-	outb(0x60, port->io + 0x0d); /* enable joystick 1 and 2 */
-	gameport_register_port(port);
-
-	return 0;
-
- err_out_disable_dev:
-	pci_disable_device(pci);
- err_out_free:
-	gameport_free_port(port);
-	kfree(gp);
-	return error;
-}
-
-static void fm801_gp_remove(struct pci_dev *pci)
-{
-	struct fm801_gp *gp = pci_get_drvdata(pci);
-
-	gameport_unregister_port(gp->gameport);
-	release_resource(gp->res_port);
-	kfree(gp);
-
-	pci_disable_device(pci);
-}
-
-static const struct pci_device_id fm801_gp_id_table[] = {
-	{ PCI_VENDOR_ID_FORTEMEDIA, PCI_DEVICE_ID_FM801_GP, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0  },
-	{ 0 }
-};
-MODULE_DEVICE_TABLE(pci, fm801_gp_id_table);
-
-static struct pci_driver fm801_gp_driver = {
-	.name =		"FM801_gameport",
-	.id_table =	fm801_gp_id_table,
-	.probe =	fm801_gp_probe,
-	.remove =	fm801_gp_remove,
-};
-
-module_pci_driver(fm801_gp_driver);
-
-MODULE_DESCRIPTION("FM801 gameport driver");
-MODULE_AUTHOR("Takashi Iwai <tiwai@suse.de>");
-MODULE_LICENSE("GPL");
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
deleted file mode 100644
index 24c41ba..0000000
--- a/drivers/input/gameport/gameport.c
+++ /dev/null
@@ -1,823 +0,0 @@
-/*
- * Generic gameport layer
- *
- * Copyright (c) 1999-2002 Vojtech Pavlik
- * Copyright (c) 2005 Dmitry Torokhov
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-
-#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
-
-#include <linux/stddef.h>
-#include <linux/module.h>
-#include <linux/ioport.h>
-#include <linux/init.h>
-#include <linux/gameport.h>
-#include <linux/slab.h>
-#include <linux/delay.h>
-#include <linux/workqueue.h>
-#include <linux/sched.h>	/* HZ */
-#include <linux/mutex.h>
-
-/*#include <asm/io.h>*/
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION("Generic gameport layer");
-MODULE_LICENSE("GPL");
-
-/*
- * gameport_mutex protects entire gameport subsystem and is taken
- * every time gameport port or driver registrered or unregistered.
- */
-static DEFINE_MUTEX(gameport_mutex);
-
-static LIST_HEAD(gameport_list);
-
-static struct bus_type gameport_bus;
-
-static void gameport_add_port(struct gameport *gameport);
-static void gameport_attach_driver(struct gameport_driver *drv);
-static void gameport_reconnect_port(struct gameport *gameport);
-static void gameport_disconnect_port(struct gameport *gameport);
-
-#if defined(__i386__)
-
-#include <linux/i8253.h>
-
-#define DELTA(x,y)      ((y)-(x)+((y)<(x)?1193182/HZ:0))
-#define GET_TIME(x)     do { x = get_time_pit(); } while (0)
-
-static unsigned int get_time_pit(void)
-{
-	unsigned long flags;
-	unsigned int count;
-
-	raw_spin_lock_irqsave(&i8253_lock, flags);
-	outb_p(0x00, 0x43);
-	count = inb_p(0x40);
-	count |= inb_p(0x40) << 8;
-	raw_spin_unlock_irqrestore(&i8253_lock, flags);
-
-	return count;
-}
-
-#endif
-
-
-
-/*
- * gameport_measure_speed() measures the gameport i/o speed.
- */
-
-static int gameport_measure_speed(struct gameport *gameport)
-{
-#if defined(__i386__)
-
-	unsigned int i, t, t1, t2, t3, tx;
-	unsigned long flags;
-
-	if (gameport_open(gameport, NULL, GAMEPORT_MODE_RAW))
-		return 0;
-
-	tx = 1 << 30;
-
-	for(i = 0; i < 50; i++) {
-		local_irq_save(flags);
-		GET_TIME(t1);
-		for (t = 0; t < 50; t++) gameport_read(gameport);
-		GET_TIME(t2);
-		GET_TIME(t3);
-		local_irq_restore(flags);
-		udelay(i * 10);
-		if ((t = DELTA(t2,t1) - DELTA(t3,t2)) < tx) tx = t;
-	}
-
-	gameport_close(gameport);
-	return 59659 / (tx < 1 ? 1 : tx);
-
-#elif defined (__x86_64__)
-
-	unsigned int i, t;
-	unsigned long tx, t1, t2, flags;
-
-	if (gameport_open(gameport, NULL, GAMEPORT_MODE_RAW))
-		return 0;
-
-	tx = 1 << 30;
-
-	for(i = 0; i < 50; i++) {
-		local_irq_save(flags);
-		rdtscl(t1);
-		for (t = 0; t < 50; t++) gameport_read(gameport);
-		rdtscl(t2);
-		local_irq_restore(flags);
-		udelay(i * 10);
-		if (t2 - t1 < tx) tx = t2 - t1;
-	}
-
-	gameport_close(gameport);
-	return (this_cpu_read(cpu_info.loops_per_jiffy) *
-		(unsigned long)HZ / (1000 / 50)) / (tx < 1 ? 1 : tx);
-
-#else
-
-	unsigned int j, t = 0;
-
-	if (gameport_open(gameport, NULL, GAMEPORT_MODE_RAW))
-		return 0;
-
-	j = jiffies; while (j == jiffies);
-	j = jiffies; while (j == jiffies) { t++; gameport_read(gameport); }
-
-	gameport_close(gameport);
-	return t * HZ / 1000;
-
-#endif
-}
-
-void gameport_start_polling(struct gameport *gameport)
-{
-	spin_lock(&gameport->timer_lock);
-
-	if (!gameport->poll_cnt++) {
-		BUG_ON(!gameport->poll_handler);
-		BUG_ON(!gameport->poll_interval);
-		mod_timer(&gameport->poll_timer, jiffies + msecs_to_jiffies(gameport->poll_interval));
-	}
-
-	spin_unlock(&gameport->timer_lock);
-}
-EXPORT_SYMBOL(gameport_start_polling);
-
-void gameport_stop_polling(struct gameport *gameport)
-{
-	spin_lock(&gameport->timer_lock);
-
-	if (!--gameport->poll_cnt)
-		del_timer(&gameport->poll_timer);
-
-	spin_unlock(&gameport->timer_lock);
-}
-EXPORT_SYMBOL(gameport_stop_polling);
-
-static void gameport_run_poll_handler(unsigned long d)
-{
-	struct gameport *gameport = (struct gameport *)d;
-
-	gameport->poll_handler(gameport);
-	if (gameport->poll_cnt)
-		mod_timer(&gameport->poll_timer, jiffies + msecs_to_jiffies(gameport->poll_interval));
-}
-
-/*
- * Basic gameport -> driver core mappings
- */
-
-static int gameport_bind_driver(struct gameport *gameport, struct gameport_driver *drv)
-{
-	int error;
-
-	gameport->dev.driver = &drv->driver;
-	if (drv->connect(gameport, drv)) {
-		gameport->dev.driver = NULL;
-		return -ENODEV;
-	}
-
-	error = device_bind_driver(&gameport->dev);
-	if (error) {
-		dev_warn(&gameport->dev,
-			 "device_bind_driver() failed for %s (%s) and %s, error: %d\n",
-			gameport->phys, gameport->name,
-			drv->description, error);
-		drv->disconnect(gameport);
-		gameport->dev.driver = NULL;
-		return error;
-	}
-
-	return 0;
-}
-
-static void gameport_find_driver(struct gameport *gameport)
-{
-	int error;
-
-	error = device_attach(&gameport->dev);
-	if (error < 0)
-		dev_warn(&gameport->dev,
-			 "device_attach() failed for %s (%s), error: %d\n",
-			 gameport->phys, gameport->name, error);
-}
-
-
-/*
- * Gameport event processing.
- */
-
-enum gameport_event_type {
-	GAMEPORT_REGISTER_PORT,
-	GAMEPORT_ATTACH_DRIVER,
-};
-
-struct gameport_event {
-	enum gameport_event_type type;
-	void *object;
-	struct module *owner;
-	struct list_head node;
-};
-
-static DEFINE_SPINLOCK(gameport_event_lock);	/* protects gameport_event_list */
-static LIST_HEAD(gameport_event_list);
-
-static struct gameport_event *gameport_get_event(void)
-{
-	struct gameport_event *event = NULL;
-	unsigned long flags;
-
-	spin_lock_irqsave(&gameport_event_lock, flags);
-
-	if (!list_empty(&gameport_event_list)) {
-		event = list_first_entry(&gameport_event_list,
-					 struct gameport_event, node);
-		list_del_init(&event->node);
-	}
-
-	spin_unlock_irqrestore(&gameport_event_lock, flags);
-	return event;
-}
-
-static void gameport_free_event(struct gameport_event *event)
-{
-	module_put(event->owner);
-	kfree(event);
-}
-
-static void gameport_remove_duplicate_events(struct gameport_event *event)
-{
-	struct gameport_event *e, *next;
-	unsigned long flags;
-
-	spin_lock_irqsave(&gameport_event_lock, flags);
-
-	list_for_each_entry_safe(e, next, &gameport_event_list, node) {
-		if (event->object == e->object) {
-			/*
-			 * If this event is of different type we should not
-			 * look further - we only suppress duplicate events
-			 * that were sent back-to-back.
-			 */
-			if (event->type != e->type)
-				break;
-
-			list_del_init(&e->node);
-			gameport_free_event(e);
-		}
-	}
-
-	spin_unlock_irqrestore(&gameport_event_lock, flags);
-}
-
-
-static void gameport_handle_events(struct work_struct *work)
-{
-	struct gameport_event *event;
-
-	mutex_lock(&gameport_mutex);
-
-	/*
-	 * Note that we handle only one event here to give swsusp
-	 * a chance to freeze kgameportd thread. Gameport events
-	 * should be pretty rare so we are not concerned about
-	 * taking performance hit.
-	 */
-	if ((event = gameport_get_event())) {
-
-		switch (event->type) {
-
-		case GAMEPORT_REGISTER_PORT:
-			gameport_add_port(event->object);
-			break;
-
-		case GAMEPORT_ATTACH_DRIVER:
-			gameport_attach_driver(event->object);
-			break;
-		}
-
-		gameport_remove_duplicate_events(event);
-		gameport_free_event(event);
-	}
-
-	mutex_unlock(&gameport_mutex);
-}
-
-static DECLARE_WORK(gameport_event_work, gameport_handle_events);
-
-static int gameport_queue_event(void *object, struct module *owner,
-				enum gameport_event_type event_type)
-{
-	unsigned long flags;
-	struct gameport_event *event;
-	int retval = 0;
-
-	spin_lock_irqsave(&gameport_event_lock, flags);
-
-	/*
-	 * Scan event list for the other events for the same gameport port,
-	 * starting with the most recent one. If event is the same we
-	 * do not need add new one. If event is of different type we
-	 * need to add this event and should not look further because
-	 * we need to preserve sequence of distinct events.
-	 */
-	list_for_each_entry_reverse(event, &gameport_event_list, node) {
-		if (event->object == object) {
-			if (event->type == event_type)
-				goto out;
-			break;
-		}
-	}
-
-	event = kmalloc(sizeof(struct gameport_event), GFP_ATOMIC);
-	if (!event) {
-		pr_err("Not enough memory to queue event %d\n", event_type);
-		retval = -ENOMEM;
-		goto out;
-	}
-
-	if (!try_module_get(owner)) {
-		pr_warning("Can't get module reference, dropping event %d\n",
-			   event_type);
-		kfree(event);
-		retval = -EINVAL;
-		goto out;
-	}
-
-	event->type = event_type;
-	event->object = object;
-	event->owner = owner;
-
-	list_add_tail(&event->node, &gameport_event_list);
-	queue_work(system_long_wq, &gameport_event_work);
-
-out:
-	spin_unlock_irqrestore(&gameport_event_lock, flags);
-	return retval;
-}
-
-/*
- * Remove all events that have been submitted for a given object,
- * be it a gameport port or a driver.
- */
-static void gameport_remove_pending_events(void *object)
-{
-	struct gameport_event *event, *next;
-	unsigned long flags;
-
-	spin_lock_irqsave(&gameport_event_lock, flags);
-
-	list_for_each_entry_safe(event, next, &gameport_event_list, node) {
-		if (event->object == object) {
-			list_del_init(&event->node);
-			gameport_free_event(event);
-		}
-	}
-
-	spin_unlock_irqrestore(&gameport_event_lock, flags);
-}
-
-/*
- * Destroy child gameport port (if any) that has not been fully registered yet.
- *
- * Note that we rely on the fact that port can have only one child and therefore
- * only one child registration request can be pending. Additionally, children
- * are registered by driver's connect() handler so there can't be a grandchild
- * pending registration together with a child.
- */
-static struct gameport *gameport_get_pending_child(struct gameport *parent)
-{
-	struct gameport_event *event;
-	struct gameport *gameport, *child = NULL;
-	unsigned long flags;
-
-	spin_lock_irqsave(&gameport_event_lock, flags);
-
-	list_for_each_entry(event, &gameport_event_list, node) {
-		if (event->type == GAMEPORT_REGISTER_PORT) {
-			gameport = event->object;
-			if (gameport->parent == parent) {
-				child = gameport;
-				break;
-			}
-		}
-	}
-
-	spin_unlock_irqrestore(&gameport_event_lock, flags);
-	return child;
-}
-
-/*
- * Gameport port operations
- */
-
-static ssize_t gameport_description_show(struct device *dev, struct device_attribute *attr, char *buf)
-{
-	struct gameport *gameport = to_gameport_port(dev);
-
-	return sprintf(buf, "%s\n", gameport->name);
-}
-static DEVICE_ATTR(description, S_IRUGO, gameport_description_show, NULL);
-
-static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
-{
-	struct gameport *gameport = to_gameport_port(dev);
-	struct device_driver *drv;
-	int error;
-
-	error = mutex_lock_interruptible(&gameport_mutex);
-	if (error)
-		return error;
-
-	if (!strncmp(buf, "none", count)) {
-		gameport_disconnect_port(gameport);
-	} else if (!strncmp(buf, "reconnect", count)) {
-		gameport_reconnect_port(gameport);
-	} else if (!strncmp(buf, "rescan", count)) {
-		gameport_disconnect_port(gameport);
-		gameport_find_driver(gameport);
-	} else if ((drv = driver_find(buf, &gameport_bus)) != NULL) {
-		gameport_disconnect_port(gameport);
-		error = gameport_bind_driver(gameport, to_gameport_driver(drv));
-	} else {
-		error = -EINVAL;
-	}
-
-	mutex_unlock(&gameport_mutex);
-
-	return error ? error : count;
-}
-static DEVICE_ATTR_WO(drvctl);
-
-static struct attribute *gameport_device_attrs[] = {
-	&dev_attr_description.attr,
-	&dev_attr_drvctl.attr,
-	NULL,
-};
-ATTRIBUTE_GROUPS(gameport_device);
-
-static void gameport_release_port(struct device *dev)
-{
-	struct gameport *gameport = to_gameport_port(dev);
-
-	kfree(gameport);
-	module_put(THIS_MODULE);
-}
-
-void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
-{
-	va_list args;
-
-	va_start(args, fmt);
-	vsnprintf(gameport->phys, sizeof(gameport->phys), fmt, args);
-	va_end(args);
-}
-EXPORT_SYMBOL(gameport_set_phys);
-
-/*
- * Prepare gameport port for registration.
- */
-static void gameport_init_port(struct gameport *gameport)
-{
-	static atomic_t gameport_no = ATOMIC_INIT(0);
-
-	__module_get(THIS_MODULE);
-
-	mutex_init(&gameport->drv_mutex);
-	device_initialize(&gameport->dev);
-	dev_set_name(&gameport->dev, "gameport%lu",
-			(unsigned long)atomic_inc_return(&gameport_no) - 1);
-	gameport->dev.bus = &gameport_bus;
-	gameport->dev.release = gameport_release_port;
-	if (gameport->parent)
-		gameport->dev.parent = &gameport->parent->dev;
-
-	INIT_LIST_HEAD(&gameport->node);
-	spin_lock_init(&gameport->timer_lock);
-	init_timer(&gameport->poll_timer);
-	gameport->poll_timer.function = gameport_run_poll_handler;
-	gameport->poll_timer.data = (unsigned long)gameport;
-}
-
-/*
- * Complete gameport port registration.
- * Driver core will attempt to find appropriate driver for the port.
- */
-static void gameport_add_port(struct gameport *gameport)
-{
-	int error;
-
-	if (gameport->parent)
-		gameport->parent->child = gameport;
-
-	gameport->speed = gameport_measure_speed(gameport);
-
-	list_add_tail(&gameport->node, &gameport_list);
-
-	if (gameport->io)
-		dev_info(&gameport->dev, "%s is %s, io %#x, speed %dkHz\n",
-			 gameport->name, gameport->phys, gameport->io, gameport->speed);
-	else
-		dev_info(&gameport->dev, "%s is %s, speed %dkHz\n",
-			gameport->name, gameport->phys, gameport->speed);
-
-	error = device_add(&gameport->dev);
-	if (error)
-		dev_err(&gameport->dev,
-			"device_add() failed for %s (%s), error: %d\n",
-			gameport->phys, gameport->name, error);
-}
-
-/*
- * gameport_destroy_port() completes deregistration process and removes
- * port from the system
- */
-static void gameport_destroy_port(struct gameport *gameport)
-{
-	struct gameport *child;
-
-	child = gameport_get_pending_child(gameport);
-	if (child) {
-		gameport_remove_pending_events(child);
-		put_device(&child->dev);
-	}
-
-	if (gameport->parent) {
-		gameport->parent->child = NULL;
-		gameport->parent = NULL;
-	}
-
-	if (device_is_registered(&gameport->dev))
-		device_del(&gameport->dev);
-
-	list_del_init(&gameport->node);
-
-	gameport_remove_pending_events(gameport);
-	put_device(&gameport->dev);
-}
-
-/*
- * Reconnect gameport port and all its children (re-initialize attached devices)
- */
-static void gameport_reconnect_port(struct gameport *gameport)
-{
-	do {
-		if (!gameport->drv || !gameport->drv->reconnect || gameport->drv->reconnect(gameport)) {
-			gameport_disconnect_port(gameport);
-			gameport_find_driver(gameport);
-			/* Ok, old children are now gone, we are done */
-			break;
-		}
-		gameport = gameport->child;
-	} while (gameport);
-}
-
-/*
- * gameport_disconnect_port() unbinds a port from its driver. As a side effect
- * all child ports are unbound and destroyed.
- */
-static void gameport_disconnect_port(struct gameport *gameport)
-{
-	struct gameport *s, *parent;
-
-	if (gameport->child) {
-		/*
-		 * Children ports should be disconnected and destroyed
-		 * first, staring with the leaf one, since we don't want
-		 * to do recursion
-		 */
-		for (s = gameport; s->child; s = s->child)
-			/* empty */;
-
-		do {
-			parent = s->parent;
-
-			device_release_driver(&s->dev);
-			gameport_destroy_port(s);
-		} while ((s = parent) != gameport);
-	}
-
-	/*
-	 * Ok, no children left, now disconnect this port
-	 */
-	device_release_driver(&gameport->dev);
-}
-
-/*
- * Submits register request to kgameportd for subsequent execution.
- * Note that port registration is always asynchronous.
- */
-void __gameport_register_port(struct gameport *gameport, struct module *owner)
-{
-	gameport_init_port(gameport);
-	gameport_queue_event(gameport, owner, GAMEPORT_REGISTER_PORT);
-}
-EXPORT_SYMBOL(__gameport_register_port);
-
-/*
- * Synchronously unregisters gameport port.
- */
-void gameport_unregister_port(struct gameport *gameport)
-{
-	mutex_lock(&gameport_mutex);
-	gameport_disconnect_port(gameport);
-	gameport_destroy_port(gameport);
-	mutex_unlock(&gameport_mutex);
-}
-EXPORT_SYMBOL(gameport_unregister_port);
-
-
-/*
- * Gameport driver operations
- */
-
-static ssize_t description_show(struct device_driver *drv, char *buf)
-{
-	struct gameport_driver *driver = to_gameport_driver(drv);
-	return sprintf(buf, "%s\n", driver->description ? driver->description : "(none)");
-}
-static DRIVER_ATTR_RO(description);
-
-static struct attribute *gameport_driver_attrs[] = {
-	&driver_attr_description.attr,
-	NULL
-};
-ATTRIBUTE_GROUPS(gameport_driver);
-
-static int gameport_driver_probe(struct device *dev)
-{
-	struct gameport *gameport = to_gameport_port(dev);
-	struct gameport_driver *drv = to_gameport_driver(dev->driver);
-
-	drv->connect(gameport, drv);
-	return gameport->drv ? 0 : -ENODEV;
-}
-
-static int gameport_driver_remove(struct device *dev)
-{
-	struct gameport *gameport = to_gameport_port(dev);
-	struct gameport_driver *drv = to_gameport_driver(dev->driver);
-
-	drv->disconnect(gameport);
-	return 0;
-}
-
-static void gameport_attach_driver(struct gameport_driver *drv)
-{
-	int error;
-
-	error = driver_attach(&drv->driver);
-	if (error)
-		pr_err("driver_attach() failed for %s, error: %d\n",
-			drv->driver.name, error);
-}
-
-int __gameport_register_driver(struct gameport_driver *drv, struct module *owner,
-				const char *mod_name)
-{
-	int error;
-
-	drv->driver.bus = &gameport_bus;
-	drv->driver.owner = owner;
-	drv->driver.mod_name = mod_name;
-
-	/*
-	 * Temporarily disable automatic binding because probing
-	 * takes long time and we are better off doing it in kgameportd
-	 */
-	drv->ignore = true;
-
-	error = driver_register(&drv->driver);
-	if (error) {
-		pr_err("driver_register() failed for %s, error: %d\n",
-			drv->driver.name, error);
-		return error;
-	}
-
-	/*
-	 * Reset ignore flag and let kgameportd bind the driver to free ports
-	 */
-	drv->ignore = false;
-	error = gameport_queue_event(drv, NULL, GAMEPORT_ATTACH_DRIVER);
-	if (error) {
-		driver_unregister(&drv->driver);
-		return error;
-	}
-
-	return 0;
-}
-EXPORT_SYMBOL(__gameport_register_driver);
-
-void gameport_unregister_driver(struct gameport_driver *drv)
-{
-	struct gameport *gameport;
-
-	mutex_lock(&gameport_mutex);
-
-	drv->ignore = true;	/* so gameport_find_driver ignores it */
-	gameport_remove_pending_events(drv);
-
-start_over:
-	list_for_each_entry(gameport, &gameport_list, node) {
-		if (gameport->drv == drv) {
-			gameport_disconnect_port(gameport);
-			gameport_find_driver(gameport);
-			/* we could've deleted some ports, restart */
-			goto start_over;
-		}
-	}
-
-	driver_unregister(&drv->driver);
-
-	mutex_unlock(&gameport_mutex);
-}
-EXPORT_SYMBOL(gameport_unregister_driver);
-
-static int gameport_bus_match(struct device *dev, struct device_driver *drv)
-{
-	struct gameport_driver *gameport_drv = to_gameport_driver(drv);
-
-	return !gameport_drv->ignore;
-}
-
-static struct bus_type gameport_bus = {
-	.name		= "gameport",
-	.dev_groups	= gameport_device_groups,
-	.drv_groups	= gameport_driver_groups,
-	.match		= gameport_bus_match,
-	.probe		= gameport_driver_probe,
-	.remove		= gameport_driver_remove,
-};
-
-static void gameport_set_drv(struct gameport *gameport, struct gameport_driver *drv)
-{
-	mutex_lock(&gameport->drv_mutex);
-	gameport->drv = drv;
-	mutex_unlock(&gameport->drv_mutex);
-}
-
-int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode)
-{
-	if (gameport->open) {
-		if (gameport->open(gameport, mode)) {
-			return -1;
-		}
-	} else {
-		if (mode != GAMEPORT_MODE_RAW)
-			return -1;
-	}
-
-	gameport_set_drv(gameport, drv);
-	return 0;
-}
-EXPORT_SYMBOL(gameport_open);
-
-void gameport_close(struct gameport *gameport)
-{
-	del_timer_sync(&gameport->poll_timer);
-	gameport->poll_handler = NULL;
-	gameport->poll_interval = 0;
-	gameport_set_drv(gameport, NULL);
-	if (gameport->close)
-		gameport->close(gameport);
-}
-EXPORT_SYMBOL(gameport_close);
-
-static int __init gameport_init(void)
-{
-	int error;
-
-	error = bus_register(&gameport_bus);
-	if (error) {
-		pr_err("failed to register gameport bus, error: %d\n", error);
-		return error;
-	}
-
-
-	return 0;
-}
-
-static void __exit gameport_exit(void)
-{
-	bus_unregister(&gameport_bus);
-
-	/*
-	 * There should not be any outstanding events but work may
-	 * still be scheduled so simply cancel it.
-	 */
-	cancel_work_sync(&gameport_event_work);
-}
-
-subsys_initcall(gameport_init);
-module_exit(gameport_exit);
diff --git a/drivers/input/gameport/lightning.c b/drivers/input/gameport/lightning.c
deleted file mode 100644
index 85d6ee0..0000000
--- a/drivers/input/gameport/lightning.c
+++ /dev/null
@@ -1,341 +0,0 @@
-/*
- *  Copyright (c) 1998-2001 Vojtech Pavlik
- */
-
-/*
- * PDPI Lightning 4 gamecard driver for Linux.
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <asm/io.h>
-#include <linux/delay.h>
-#include <linux/errno.h>
-#include <linux/ioport.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/gameport.h>
-
-#define L4_PORT			0x201
-#define L4_SELECT_ANALOG	0xa4
-#define L4_SELECT_DIGITAL	0xa5
-#define L4_SELECT_SECONDARY	0xa6
-#define L4_CMD_ID		0x80
-#define L4_CMD_GETCAL		0x92
-#define L4_CMD_SETCAL		0x93
-#define L4_ID			0x04
-#define L4_BUSY			0x01
-#define L4_TIMEOUT		80	/* 80 us */
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION("PDPI Lightning 4 gamecard driver");
-MODULE_LICENSE("GPL");
-
-struct l4 {
-	struct gameport *gameport;
-	unsigned char port;
-};
-
-static struct l4 l4_ports[8];
-
-/*
- * l4_wait_ready() waits for the L4 to become ready.
- */
-
-static int l4_wait_ready(void)
-{
-	unsigned int t = L4_TIMEOUT;
-
-	while ((inb(L4_PORT) & L4_BUSY) && t > 0) t--;
-	return -(t <= 0);
-}
-
-/*
- * l4_cooked_read() reads data from the Lightning 4.
- */
-
-static int l4_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	struct l4 *l4 = gameport->port_data;
-	unsigned char status;
-	int i, result = -1;
-
-	outb(L4_SELECT_ANALOG, L4_PORT);
-	outb(L4_SELECT_DIGITAL + (l4->port >> 2), L4_PORT);
-
-	if (inb(L4_PORT) & L4_BUSY) goto fail;
-	outb(l4->port & 3, L4_PORT);
-
-	if (l4_wait_ready()) goto fail;
-	status = inb(L4_PORT);
-
-	for (i = 0; i < 4; i++)
-		if (status & (1 << i)) {
-			if (l4_wait_ready()) goto fail;
-			axes[i] = inb(L4_PORT);
-			if (axes[i] > 252) axes[i] = -1;
-		}
-
-	if (status & 0x10) {
-		if (l4_wait_ready()) goto fail;
-		*buttons = inb(L4_PORT) & 0x0f;
-	}
-
-	result = 0;
-
-fail:	outb(L4_SELECT_ANALOG, L4_PORT);
-	return result;
-}
-
-static int l4_open(struct gameport *gameport, int mode)
-{
-	struct l4 *l4 = gameport->port_data;
-
-        if (l4->port != 0 && mode != GAMEPORT_MODE_COOKED)
-		return -1;
-	outb(L4_SELECT_ANALOG, L4_PORT);
-	return 0;
-}
-
-/*
- * l4_getcal() reads the L4 with calibration values.
- */
-
-static int l4_getcal(int port, int *cal)
-{
-	int i, result = -1;
-
-	outb(L4_SELECT_ANALOG, L4_PORT);
-	outb(L4_SELECT_DIGITAL + (port >> 2), L4_PORT);
-	if (inb(L4_PORT) & L4_BUSY)
-		goto out;
-
-	outb(L4_CMD_GETCAL, L4_PORT);
-	if (l4_wait_ready())
-		goto out;
-
-	if (inb(L4_PORT) != L4_SELECT_DIGITAL + (port >> 2))
-		goto out;
-
-	if (l4_wait_ready())
-		goto out;
-        outb(port & 3, L4_PORT);
-
-	for (i = 0; i < 4; i++) {
-		if (l4_wait_ready())
-			goto out;
-		cal[i] = inb(L4_PORT);
-	}
-
-	result = 0;
-
-out:	outb(L4_SELECT_ANALOG, L4_PORT);
-	return result;
-}
-
-/*
- * l4_setcal() programs the L4 with calibration values.
- */
-
-static int l4_setcal(int port, int *cal)
-{
-	int i, result = -1;
-
-	outb(L4_SELECT_ANALOG, L4_PORT);
-	outb(L4_SELECT_DIGITAL + (port >> 2), L4_PORT);
-	if (inb(L4_PORT) & L4_BUSY)
-		goto out;
-
-	outb(L4_CMD_SETCAL, L4_PORT);
-	if (l4_wait_ready())
-		goto out;
-
-	if (inb(L4_PORT) != L4_SELECT_DIGITAL + (port >> 2))
-		goto out;
-
-	if (l4_wait_ready())
-		goto out;
-        outb(port & 3, L4_PORT);
-
-	for (i = 0; i < 4; i++) {
-		if (l4_wait_ready())
-			goto out;
-		outb(cal[i], L4_PORT);
-	}
-
-	result = 0;
-
-out:	outb(L4_SELECT_ANALOG, L4_PORT);
-	return result;
-}
-
-/*
- * l4_calibrate() calibrates the L4 for the attached device, so
- * that the device's resistance fits into the L4's 8-bit range.
- */
-
-static int l4_calibrate(struct gameport *gameport, int *axes, int *max)
-{
-	int i, t;
-	int cal[4];
-	struct l4 *l4 = gameport->port_data;
-
-	if (l4_getcal(l4->port, cal))
-		return -1;
-
-	for (i = 0; i < 4; i++) {
-		t = (max[i] * cal[i]) / 200;
-		t = (t < 1) ? 1 : ((t > 255) ? 255 : t);
-		axes[i] = (axes[i] < 0) ? -1 : (axes[i] * cal[i]) / t;
-		axes[i] = (axes[i] > 252) ? 252 : axes[i];
-		cal[i] = t;
-	}
-
-	if (l4_setcal(l4->port, cal))
-		return -1;
-
-	return 0;
-}
-
-static int __init l4_create_ports(int card_no)
-{
-	struct l4 *l4;
-	struct gameport *port;
-	int i, idx;
-
-	for (i = 0; i < 4; i++) {
-
-		idx = card_no * 4 + i;
-		l4 = &l4_ports[idx];
-
-		if (!(l4->gameport = port = gameport_allocate_port())) {
-			printk(KERN_ERR "lightning: Memory allocation failed\n");
-			while (--i >= 0) {
-				gameport_free_port(l4->gameport);
-				l4->gameport = NULL;
-			}
-			return -ENOMEM;
-		}
-		l4->port = idx;
-
-		port->port_data = l4;
-		port->open = l4_open;
-		port->cooked_read = l4_cooked_read;
-		port->calibrate = l4_calibrate;
-
-		gameport_set_name(port, "PDPI Lightning 4");
-		gameport_set_phys(port, "isa%04x/gameport%d", L4_PORT, idx);
-
-		if (idx == 0)
-			port->io = L4_PORT;
-	}
-
-	return 0;
-}
-
-static int __init l4_add_card(int card_no)
-{
-	int cal[4] = { 255, 255, 255, 255 };
-	int i, rev, result;
-	struct l4 *l4;
-
-	outb(L4_SELECT_ANALOG, L4_PORT);
-	outb(L4_SELECT_DIGITAL + card_no, L4_PORT);
-
-	if (inb(L4_PORT) & L4_BUSY)
-		return -1;
-	outb(L4_CMD_ID, L4_PORT);
-
-	if (l4_wait_ready())
-		return -1;
-
-	if (inb(L4_PORT) != L4_SELECT_DIGITAL + card_no)
-		return -1;
-
-	if (l4_wait_ready())
-		return -1;
-	if (inb(L4_PORT) != L4_ID)
-		return -1;
-
-	if (l4_wait_ready())
-		return -1;
-	rev = inb(L4_PORT);
-
-	if (!rev)
-		return -1;
-
-	result = l4_create_ports(card_no);
-	if (result)
-		return result;
-
-	printk(KERN_INFO "gameport: PDPI Lightning 4 %s card v%d.%d at %#x\n",
-		card_no ? "secondary" : "primary", rev >> 4, rev, L4_PORT);
-
-	for (i = 0; i < 4; i++) {
-		l4 = &l4_ports[card_no * 4 + i];
-
-		if (rev > 0x28)		/* on 2.9+ the setcal command works correctly */
-			l4_setcal(l4->port, cal);
-		gameport_register_port(l4->gameport);
-	}
-
-	return 0;
-}
-
-static int __init l4_init(void)
-{
-	int i, cards = 0;
-
-	if (!request_region(L4_PORT, 1, "lightning"))
-		return -EBUSY;
-
-	for (i = 0; i < 2; i++)
-		if (l4_add_card(i) == 0)
-			cards++;
-
-	outb(L4_SELECT_ANALOG, L4_PORT);
-
-	if (!cards) {
-		release_region(L4_PORT, 1);
-		return -ENODEV;
-	}
-
-	return 0;
-}
-
-static void __exit l4_exit(void)
-{
-	int i;
-	int cal[4] = { 59, 59, 59, 59 };
-
-	for (i = 0; i < 8; i++)
-		if (l4_ports[i].gameport) {
-			l4_setcal(l4_ports[i].port, cal);
-			gameport_unregister_port(l4_ports[i].gameport);
-		}
-
-	outb(L4_SELECT_ANALOG, L4_PORT);
-	release_region(L4_PORT, 1);
-}
-
-module_init(l4_init);
-module_exit(l4_exit);
diff --git a/drivers/input/gameport/ns558.c b/drivers/input/gameport/ns558.c
deleted file mode 100644
index 7c21784..0000000
--- a/drivers/input/gameport/ns558.c
+++ /dev/null
@@ -1,286 +0,0 @@
-/*
- *  Copyright (c) 1999-2001 Vojtech Pavlik
- *  Copyright (c) 1999 Brian Gerst
- */
-
-/*
- * NS558 based standard IBM game port driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <asm/io.h>
-
-#include <linux/module.h>
-#include <linux/ioport.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/gameport.h>
-#include <linux/slab.h>
-#include <linux/pnp.h>
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION("Classic gameport (ISA/PnP) driver");
-MODULE_LICENSE("GPL");
-
-static int ns558_isa_portlist[] = { 0x201, 0x200, 0x202, 0x203, 0x204, 0x205, 0x207, 0x209,
-				    0x20b, 0x20c, 0x20e, 0x20f, 0x211, 0x219, 0x101, 0 };
-
-struct ns558 {
-	int type;
-	int io;
-	int size;
-	struct pnp_dev *dev;
-	struct gameport *gameport;
-	struct list_head node;
-};
-
-static LIST_HEAD(ns558_list);
-
-/*
- * ns558_isa_probe() tries to find an isa gameport at the
- * specified address, and also checks for mirrors.
- * A joystick must be attached for this to work.
- */
-
-static int ns558_isa_probe(int io)
-{
-	int i, j, b;
-	unsigned char c, u, v;
-	struct ns558 *ns558;
-	struct gameport *port;
-
-/*
- * No one should be using this address.
- */
-
-	if (!request_region(io, 1, "ns558-isa"))
-		return -EBUSY;
-
-/*
- * We must not be able to write arbitrary values to the port.
- * The lower two axis bits must be 1 after a write.
- */
-
-	c = inb(io);
-	outb(~c & ~3, io);
-	if (~(u = v = inb(io)) & 3) {
-		outb(c, io);
-		release_region(io, 1);
-		return -ENODEV;
-	}
-/*
- * After a trigger, there must be at least some bits changing.
- */
-
-	for (i = 0; i < 1000; i++) v &= inb(io);
-
-	if (u == v) {
-		outb(c, io);
-		release_region(io, 1);
-		return -ENODEV;
-	}
-	msleep(3);
-/*
- * After some time (4ms) the axes shouldn't change anymore.
- */
-
-	u = inb(io);
-	for (i = 0; i < 1000; i++)
-		if ((u ^ inb(io)) & 0xf) {
-			outb(c, io);
-			release_region(io, 1);
-			return -ENODEV;
-		}
-/*
- * And now find the number of mirrors of the port.
- */
-
-	for (i = 1; i < 5; i++) {
-
-		release_region(io & (-1 << (i - 1)), (1 << (i - 1)));
-
-		if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))
-			break;				/* Don't disturb anyone */
-
-		outb(0xff, io & (-1 << i));
-		for (j = b = 0; j < 1000; j++)
-			if (inb(io & (-1 << i)) != inb((io & (-1 << i)) + (1 << i) - 1)) b++;
-		msleep(3);
-
-		if (b > 300) {				/* We allow 30% difference */
-			release_region(io & (-1 << i), (1 << i));
-			break;
-		}
-	}
-
-	i--;
-
-	if (i != 4) {
-		if (!request_region(io & (-1 << i), (1 << i), "ns558-isa"))
-			return -EBUSY;
-	}
-
-	ns558 = kzalloc(sizeof(struct ns558), GFP_KERNEL);
-	port = gameport_allocate_port();
-	if (!ns558 || !port) {
-		printk(KERN_ERR "ns558: Memory allocation failed.\n");
-		release_region(io & (-1 << i), (1 << i));
-		kfree(ns558);
-		gameport_free_port(port);
-		return -ENOMEM;
-	}
-
-	ns558->io = io;
-	ns558->size = 1 << i;
-	ns558->gameport = port;
-
-	port->io = io;
-	gameport_set_name(port, "NS558 ISA Gameport");
-	gameport_set_phys(port, "isa%04x/gameport0", io & (-1 << i));
-
-	gameport_register_port(port);
-
-	list_add(&ns558->node, &ns558_list);
-
-	return 0;
-}
-
-#ifdef CONFIG_PNP
-
-static const struct pnp_device_id pnp_devids[] = {
-	{ .id = "@P@0001", .driver_data = 0 }, /* ALS 100 */
-	{ .id = "@P@0020", .driver_data = 0 }, /* ALS 200 */
-	{ .id = "@P@1001", .driver_data = 0 }, /* ALS 100+ */
-	{ .id = "@P@2001", .driver_data = 0 }, /* ALS 120 */
-	{ .id = "ASB16fd", .driver_data = 0 }, /* AdLib NSC16 */
-	{ .id = "AZT3001", .driver_data = 0 }, /* AZT1008 */
-	{ .id = "CDC0001", .driver_data = 0 }, /* Opl3-SAx */
-	{ .id = "CSC0001", .driver_data = 0 }, /* CS4232 */
-	{ .id = "CSC000f", .driver_data = 0 }, /* CS4236 */
-	{ .id = "CSC0101", .driver_data = 0 }, /* CS4327 */
-	{ .id = "CTL7001", .driver_data = 0 }, /* SB16 */
-	{ .id = "CTL7002", .driver_data = 0 }, /* AWE64 */
-	{ .id = "CTL7005", .driver_data = 0 }, /* Vibra16 */
-	{ .id = "ENS2020", .driver_data = 0 }, /* SoundscapeVIVO */
-	{ .id = "ESS0001", .driver_data = 0 }, /* ES1869 */
-	{ .id = "ESS0005", .driver_data = 0 }, /* ES1878 */
-	{ .id = "ESS6880", .driver_data = 0 }, /* ES688 */
-	{ .id = "IBM0012", .driver_data = 0 }, /* CS4232 */
-	{ .id = "OPT0001", .driver_data = 0 }, /* OPTi Audio16 */
-	{ .id = "YMH0006", .driver_data = 0 }, /* Opl3-SA */
-	{ .id = "YMH0022", .driver_data = 0 }, /* Opl3-SAx */
-	{ .id = "PNPb02f", .driver_data = 0 }, /* Generic */
-	{ .id = "", },
-};
-
-MODULE_DEVICE_TABLE(pnp, pnp_devids);
-
-static int ns558_pnp_probe(struct pnp_dev *dev, const struct pnp_device_id *did)
-{
-	int ioport, iolen;
-	struct ns558 *ns558;
-	struct gameport *port;
-
-	if (!pnp_port_valid(dev, 0)) {
-		printk(KERN_WARNING "ns558: No i/o ports on a gameport? Weird\n");
-		return -ENODEV;
-	}
-
-	ioport = pnp_port_start(dev, 0);
-	iolen = pnp_port_len(dev, 0);
-
-	if (!request_region(ioport, iolen, "ns558-pnp"))
-		return -EBUSY;
-
-	ns558 = kzalloc(sizeof(struct ns558), GFP_KERNEL);
-	port = gameport_allocate_port();
-	if (!ns558 || !port) {
-		printk(KERN_ERR "ns558: Memory allocation failed\n");
-		kfree(ns558);
-		gameport_free_port(port);
-		return -ENOMEM;
-	}
-
-	ns558->io = ioport;
-	ns558->size = iolen;
-	ns558->dev = dev;
-	ns558->gameport = port;
-
-	gameport_set_name(port, "NS558 PnP Gameport");
-	gameport_set_phys(port, "pnp%s/gameport0", dev_name(&dev->dev));
-	port->dev.parent = &dev->dev;
-	port->io = ioport;
-
-	gameport_register_port(port);
-
-	list_add_tail(&ns558->node, &ns558_list);
-	return 0;
-}
-
-static struct pnp_driver ns558_pnp_driver = {
-	.name		= "ns558",
-	.id_table	= pnp_devids,
-	.probe		= ns558_pnp_probe,
-};
-
-#else
-
-static struct pnp_driver ns558_pnp_driver;
-
-#endif
-
-static int __init ns558_init(void)
-{
-	int i = 0;
-	int error;
-
-	error = pnp_register_driver(&ns558_pnp_driver);
-	if (error && error != -ENODEV)	/* should be ENOSYS really */
-		return error;
-
-/*
- * Probe ISA ports after PnP, so that PnP ports that are already
- * enabled get detected as PnP. This may be suboptimal in multi-device
- * configurations, but saves hassle with simple setups.
- */
-
-	while (ns558_isa_portlist[i])
-		ns558_isa_probe(ns558_isa_portlist[i++]);
-
-	return list_empty(&ns558_list) && error ? -ENODEV : 0;
-}
-
-static void __exit ns558_exit(void)
-{
-	struct ns558 *ns558, *safe;
-
-	list_for_each_entry_safe(ns558, safe, &ns558_list, node) {
-		gameport_unregister_port(ns558->gameport);
-		release_region(ns558->io & ~(ns558->size - 1), ns558->size);
-		kfree(ns558);
-	}
-
-	pnp_unregister_driver(&ns558_pnp_driver);
-}
-
-module_init(ns558_init);
-module_exit(ns558_exit);
diff --git a/drivers/input/joystick/Kconfig b/drivers/input/joystick/Kconfig
index 56eb471..aca6e87 100644
--- a/drivers/input/joystick/Kconfig
+++ b/drivers/input/joystick/Kconfig
@@ -14,122 +14,6 @@ menuconfig INPUT_JOYSTICK
 
 if INPUT_JOYSTICK
 
-config JOYSTICK_ANALOG
-	tristate "Classic PC analog joysticks and gamepads"
-	select GAMEPORT
-	---help---
-	  Say Y here if you have a joystick that connects to the PC
-	  gameport. In addition to the usual PC analog joystick, this driver
-	  supports many extensions, including joysticks with throttle control,
-	  with rudders, additional hats and buttons compatible with CH
-	  Flightstick Pro, ThrustMaster FCS, 6 and 8 button gamepads, or
-	  Saitek Cyborg joysticks.
-
-	  Please read the file <file:Documentation/input/joystick.txt> which
-	  contains more information.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called analog.
-
-config JOYSTICK_A3D
-	tristate "Assassin 3D and MadCatz Panther devices"
-	select GAMEPORT
-	help
-	  Say Y here if you have an FPGaming or MadCatz controller using the
-	  A3D protocol over the PC gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called a3d.
-
-config JOYSTICK_ADI
-	tristate "Logitech ADI digital joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have a Logitech controller using the ADI
-	  protocol over the PC gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called adi.
-
-config JOYSTICK_COBRA
-	tristate "Creative Labs Blaster Cobra gamepad"
-	select GAMEPORT
-	help
-	  Say Y here if you have a Creative Labs Blaster Cobra gamepad.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called cobra.
-
-config JOYSTICK_GF2K
-	tristate "Genius Flight2000 Digital joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have a Genius Flight2000 or MaxFighter digitally
-	  communicating joystick or gamepad.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called gf2k.
-
-config JOYSTICK_GRIP
-	tristate "Gravis GrIP joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have a Gravis controller using the GrIP protocol
-	  over the PC gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called grip.
-
-config JOYSTICK_GRIP_MP
-	tristate "Gravis GrIP MultiPort"
-	select GAMEPORT
-	help
-	  Say Y here if you have the original Gravis GrIP MultiPort, a hub
-	  that connects to the gameport and you connect gamepads to it.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called grip_mp.
-
-config JOYSTICK_GUILLEMOT
-	tristate "Guillemot joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have a Guillemot joystick using a digital
-	  protocol over the PC gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called guillemot.
-
-config JOYSTICK_INTERACT
-	tristate "InterAct digital joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have an InterAct gameport or joystick
-	  communicating digitally over the gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called interact.
-
-config JOYSTICK_SIDEWINDER
-	tristate "Microsoft SideWinder digital joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have a Microsoft controller using the Digital
-	  Overdrive protocol over PC gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called sidewinder.
-
-config JOYSTICK_TMDC
-	tristate "ThrustMaster DirectConnect joysticks and gamepads"
-	select GAMEPORT
-	help
-	  Say Y here if you have a ThrustMaster controller using the
-	  DirectConnect (BSP) protocol over the PC gameport.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called tmdc.
-
 source "drivers/input/joystick/iforce/Kconfig"
 
 config JOYSTICK_WARRIOR
@@ -265,17 +149,6 @@ config JOYSTICK_AS5011
 	  To compile this driver as a module, choose M here: the
 	  module will be called as5011.
 
-config JOYSTICK_JOYDUMP
-	tristate "Gameport data dumper"
-	select GAMEPORT
-	help
-	  Say Y here if you want to dump data from your joystick into the system
-	  log for debugging purposes. Say N if you are making a production
-	  configuration or aren't sure.
-
-	  To compile this driver as a module, choose M here: the
-	  module will be called joydump.
-
 config JOYSTICK_XPAD
 	tristate "X-Box gamepad support"
 	depends on USB_ARCH_HAS_HCD
diff --git a/drivers/input/joystick/Makefile b/drivers/input/joystick/Makefile
index 92dc0de..eb8e75a 100644
--- a/drivers/input/joystick/Makefile
+++ b/drivers/input/joystick/Makefile
@@ -4,28 +4,16 @@
 
 # Each configuration option enables a list of files.
 
-obj-$(CONFIG_JOYSTICK_A3D)		+= a3d.o
-obj-$(CONFIG_JOYSTICK_ADI)		+= adi.o
 obj-$(CONFIG_JOYSTICK_AMIGA)		+= amijoy.o
 obj-$(CONFIG_JOYSTICK_AS5011)		+= as5011.o
-obj-$(CONFIG_JOYSTICK_ANALOG)		+= analog.o
-obj-$(CONFIG_JOYSTICK_COBRA)		+= cobra.o
 obj-$(CONFIG_JOYSTICK_DB9)		+= db9.o
 obj-$(CONFIG_JOYSTICK_GAMECON)		+= gamecon.o
-obj-$(CONFIG_JOYSTICK_GF2K)		+= gf2k.o
-obj-$(CONFIG_JOYSTICK_GRIP)		+= grip.o
-obj-$(CONFIG_JOYSTICK_GRIP_MP)		+= grip_mp.o
-obj-$(CONFIG_JOYSTICK_GUILLEMOT)	+= guillemot.o
 obj-$(CONFIG_JOYSTICK_IFORCE)		+= iforce/
-obj-$(CONFIG_JOYSTICK_INTERACT)		+= interact.o
-obj-$(CONFIG_JOYSTICK_JOYDUMP)		+= joydump.o
 obj-$(CONFIG_JOYSTICK_MAGELLAN)		+= magellan.o
 obj-$(CONFIG_JOYSTICK_MAPLE)		+= maplecontrol.o
-obj-$(CONFIG_JOYSTICK_SIDEWINDER)	+= sidewinder.o
 obj-$(CONFIG_JOYSTICK_SPACEBALL)	+= spaceball.o
 obj-$(CONFIG_JOYSTICK_SPACEORB)		+= spaceorb.o
 obj-$(CONFIG_JOYSTICK_STINGER)		+= stinger.o
-obj-$(CONFIG_JOYSTICK_TMDC)		+= tmdc.o
 obj-$(CONFIG_JOYSTICK_TURBOGRAFX)	+= turbografx.o
 obj-$(CONFIG_JOYSTICK_TWIDJOY)		+= twidjoy.o
 obj-$(CONFIG_JOYSTICK_WARRIOR)		+= warrior.o
diff --git a/drivers/input/joystick/a3d.c b/drivers/input/joystick/a3d.c
deleted file mode 100644
index 55efdfc..0000000
--- a/drivers/input/joystick/a3d.c
+++ /dev/null
@@ -1,415 +0,0 @@
-/*
- *  Copyright (c) 1998-2001 Vojtech Pavlik
- */
-
-/*
- * FP-Gaming Assassin 3D joystick driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"FP-Gaming Assassin 3D joystick driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define A3D_MAX_START		600	/* 600 us */
-#define A3D_MAX_STROBE		80	/* 80 us */
-#define A3D_MAX_LENGTH		40	/* 40*3 bits */
-
-#define A3D_MODE_A3D		1	/* Assassin 3D */
-#define A3D_MODE_PAN		2	/* Panther */
-#define A3D_MODE_OEM		3	/* Panther OEM version */
-#define A3D_MODE_PXL		4	/* Panther XL */
-
-static char *a3d_names[] = { NULL, "FP-Gaming Assassin 3D", "MadCatz Panther", "OEM Panther",
-			"MadCatz Panther XL", "MadCatz Panther XL w/ rudder" };
-
-struct a3d {
-	struct gameport *gameport;
-	struct gameport *adc;
-	struct input_dev *dev;
-	int axes[4];
-	int buttons;
-	int mode;
-	int length;
-	int reads;
-	int bads;
-	char phys[32];
-};
-
-/*
- * a3d_read_packet() reads an Assassin 3D packet.
- */
-
-static int a3d_read_packet(struct gameport *gameport, int length, char *data)
-{
-	unsigned long flags;
-	unsigned char u, v;
-	unsigned int t, s;
-	int i;
-
-	i = 0;
-	t = gameport_time(gameport, A3D_MAX_START);
-	s = gameport_time(gameport, A3D_MAX_STROBE);
-
-	local_irq_save(flags);
-	gameport_trigger(gameport);
-	v = gameport_read(gameport);
-
-	while (t > 0 && i < length) {
-		t--;
-		u = v; v = gameport_read(gameport);
-		if (~v & u & 0x10) {
-			data[i++] = v >> 5;
-			t = s;
-		}
-	}
-
-	local_irq_restore(flags);
-
-	return i;
-}
-
-/*
- * a3d_csum() computes checksum of triplet packet
- */
-
-static int a3d_csum(char *data, int count)
-{
-	int i, csum = 0;
-
-	for (i = 0; i < count - 2; i++)
-		csum += data[i];
-	return (csum & 0x3f) != ((data[count - 2] << 3) | data[count - 1]);
-}
-
-static void a3d_read(struct a3d *a3d, unsigned char *data)
-{
-	struct input_dev *dev = a3d->dev;
-
-	switch (a3d->mode) {
-
-		case A3D_MODE_A3D:
-		case A3D_MODE_OEM:
-		case A3D_MODE_PAN:
-
-			input_report_rel(dev, REL_X, ((data[5] << 6) | (data[6] << 3) | data[ 7]) - ((data[5] & 4) << 7));
-			input_report_rel(dev, REL_Y, ((data[8] << 6) | (data[9] << 3) | data[10]) - ((data[8] & 4) << 7));
-
-			input_report_key(dev, BTN_RIGHT,  data[2] & 1);
-			input_report_key(dev, BTN_LEFT,   data[3] & 2);
-			input_report_key(dev, BTN_MIDDLE, data[3] & 4);
-
-			input_sync(dev);
-
-			a3d->axes[0] = ((signed char)((data[11] << 6) | (data[12] << 3) | (data[13]))) + 128;
-			a3d->axes[1] = ((signed char)((data[14] << 6) | (data[15] << 3) | (data[16]))) + 128;
-			a3d->axes[2] = ((signed char)((data[17] << 6) | (data[18] << 3) | (data[19]))) + 128;
-			a3d->axes[3] = ((signed char)((data[20] << 6) | (data[21] << 3) | (data[22]))) + 128;
-
-			a3d->buttons = ((data[3] << 3) | data[4]) & 0xf;
-
-			break;
-
-		case A3D_MODE_PXL:
-
-			input_report_rel(dev, REL_X, ((data[ 9] << 6) | (data[10] << 3) | data[11]) - ((data[ 9] & 4) << 7));
-			input_report_rel(dev, REL_Y, ((data[12] << 6) | (data[13] << 3) | data[14]) - ((data[12] & 4) << 7));
-
-			input_report_key(dev, BTN_RIGHT,  data[2] & 1);
-			input_report_key(dev, BTN_LEFT,   data[3] & 2);
-			input_report_key(dev, BTN_MIDDLE, data[3] & 4);
-			input_report_key(dev, BTN_SIDE,   data[7] & 2);
-			input_report_key(dev, BTN_EXTRA,  data[7] & 4);
-
-			input_report_abs(dev, ABS_X,        ((signed char)((data[15] << 6) | (data[16] << 3) | (data[17]))) + 128);
-			input_report_abs(dev, ABS_Y,        ((signed char)((data[18] << 6) | (data[19] << 3) | (data[20]))) + 128);
-			input_report_abs(dev, ABS_RUDDER,   ((signed char)((data[21] << 6) | (data[22] << 3) | (data[23]))) + 128);
-			input_report_abs(dev, ABS_THROTTLE, ((signed char)((data[24] << 6) | (data[25] << 3) | (data[26]))) + 128);
-
-			input_report_abs(dev, ABS_HAT0X, ( data[5]       & 1) - ((data[5] >> 2) & 1));
-			input_report_abs(dev, ABS_HAT0Y, ((data[5] >> 1) & 1) - ((data[6] >> 2) & 1));
-			input_report_abs(dev, ABS_HAT1X, ((data[4] >> 1) & 1) - ( data[3]       & 1));
-			input_report_abs(dev, ABS_HAT1Y, ((data[4] >> 2) & 1) - ( data[4]       & 1));
-
-			input_report_key(dev, BTN_TRIGGER, data[8] & 1);
-			input_report_key(dev, BTN_THUMB,   data[8] & 2);
-			input_report_key(dev, BTN_TOP,     data[8] & 4);
-			input_report_key(dev, BTN_PINKIE,  data[7] & 1);
-
-			input_sync(dev);
-
-			break;
-	}
-}
-
-
-/*
- * a3d_poll() reads and analyzes A3D joystick data.
- */
-
-static void a3d_poll(struct gameport *gameport)
-{
-	struct a3d *a3d = gameport_get_drvdata(gameport);
-	unsigned char data[A3D_MAX_LENGTH];
-
-	a3d->reads++;
-	if (a3d_read_packet(a3d->gameport, a3d->length, data) != a3d->length ||
-	    data[0] != a3d->mode || a3d_csum(data, a3d->length))
-		a3d->bads++;
-	else
-		a3d_read(a3d, data);
-}
-
-/*
- * a3d_adc_cooked_read() copies the acis and button data to the
- * callers arrays. It could do the read itself, but the caller could
- * call this more than 50 times a second, which would use too much CPU.
- */
-
-static int a3d_adc_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	struct a3d *a3d = gameport->port_data;
-	int i;
-
-	for (i = 0; i < 4; i++)
-		axes[i] = (a3d->axes[i] < 254) ? a3d->axes[i] : -1;
-	*buttons = a3d->buttons;
-	return 0;
-}
-
-/*
- * a3d_adc_open() is the gameport open routine. It refuses to serve
- * any but cooked data.
- */
-
-static int a3d_adc_open(struct gameport *gameport, int mode)
-{
-	struct a3d *a3d = gameport->port_data;
-
-	if (mode != GAMEPORT_MODE_COOKED)
-		return -1;
-
-	gameport_start_polling(a3d->gameport);
-	return 0;
-}
-
-/*
- * a3d_adc_close() is a callback from the input close routine.
- */
-
-static void a3d_adc_close(struct gameport *gameport)
-{
-	struct a3d *a3d = gameport->port_data;
-
-	gameport_stop_polling(a3d->gameport);
-}
-
-/*
- * a3d_open() is a callback from the input open routine.
- */
-
-static int a3d_open(struct input_dev *dev)
-{
-	struct a3d *a3d = input_get_drvdata(dev);
-
-	gameport_start_polling(a3d->gameport);
-	return 0;
-}
-
-/*
- * a3d_close() is a callback from the input close routine.
- */
-
-static void a3d_close(struct input_dev *dev)
-{
-	struct a3d *a3d = input_get_drvdata(dev);
-
-	gameport_stop_polling(a3d->gameport);
-}
-
-/*
- * a3d_connect() probes for A3D joysticks.
- */
-
-static int a3d_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct a3d *a3d;
-	struct input_dev *input_dev;
-	struct gameport *adc;
-	unsigned char data[A3D_MAX_LENGTH];
-	int i;
-	int err;
-
-	a3d = kzalloc(sizeof(struct a3d), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!a3d || !input_dev) {
-		err = -ENOMEM;
-		goto fail1;
-	}
-
-	a3d->dev = input_dev;
-	a3d->gameport = gameport;
-
-	gameport_set_drvdata(gameport, a3d);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	i = a3d_read_packet(gameport, A3D_MAX_LENGTH, data);
-
-	if (!i || a3d_csum(data, i)) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	a3d->mode = data[0];
-
-	if (!a3d->mode || a3d->mode > 5) {
-		printk(KERN_WARNING "a3d.c: Unknown A3D device detected "
-			"(%s, id=%d), contact <vojtech@ucw.cz>\n", gameport->phys, a3d->mode);
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, a3d_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	snprintf(a3d->phys, sizeof(a3d->phys), "%s/input0", gameport->phys);
-
-	input_dev->name = a3d_names[a3d->mode];
-	input_dev->phys = a3d->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_MADCATZ;
-	input_dev->id.product = a3d->mode;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &gameport->dev;
-	input_dev->open = a3d_open;
-	input_dev->close = a3d_close;
-
-	input_set_drvdata(input_dev, a3d);
-
-	if (a3d->mode == A3D_MODE_PXL) {
-
-		int axes[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER };
-
-		a3d->length = 33;
-
-		input_dev->evbit[0] |= BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY) |
-			BIT_MASK(EV_REL);
-		input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
-		input_dev->absbit[0] |= BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) |
-			BIT_MASK(ABS_THROTTLE) | BIT_MASK(ABS_RUDDER) |
-			BIT_MASK(ABS_HAT0X) | BIT_MASK(ABS_HAT0Y) |
-			BIT_MASK(ABS_HAT1X) | BIT_MASK(ABS_HAT1Y);
-		input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) |
-			BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE) |
-			BIT_MASK(BTN_SIDE) | BIT_MASK(BTN_EXTRA);
-		input_dev->keybit[BIT_WORD(BTN_JOYSTICK)] |=
-			BIT_MASK(BTN_TRIGGER) | BIT_MASK(BTN_THUMB) |
-			BIT_MASK(BTN_TOP) | BIT_MASK(BTN_PINKIE);
-
-		a3d_read(a3d, data);
-
-		for (i = 0; i < 4; i++) {
-			if (i < 2)
-				input_set_abs_params(input_dev, axes[i],
-					48, input_abs_get_val(input_dev, axes[i]) * 2 - 48, 0, 8);
-			else
-				input_set_abs_params(input_dev, axes[i], 2, 253, 0, 0);
-			input_set_abs_params(input_dev, ABS_HAT0X + i, -1, 1, 0, 0);
-		}
-
-	} else {
-		a3d->length = 29;
-
-		input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_REL);
-		input_dev->relbit[0] |= BIT_MASK(REL_X) | BIT_MASK(REL_Y);
-		input_dev->keybit[BIT_WORD(BTN_MOUSE)] |= BIT_MASK(BTN_RIGHT) |
-			BIT_MASK(BTN_LEFT) | BIT_MASK(BTN_MIDDLE);
-
-		a3d_read(a3d, data);
-
-		if (!(a3d->adc = adc = gameport_allocate_port()))
-			printk(KERN_ERR "a3d: Not enough memory for ADC port\n");
-		else {
-			adc->port_data = a3d;
-			adc->open = a3d_adc_open;
-			adc->close = a3d_adc_close;
-			adc->cooked_read = a3d_adc_cooked_read;
-			adc->fuzz = 1;
-
-			gameport_set_name(adc, a3d_names[a3d->mode]);
-			gameport_set_phys(adc, "%s/gameport0", gameport->phys);
-			adc->dev.parent = &gameport->dev;
-
-			gameport_register_port(adc);
-		}
-	}
-
-	err = input_register_device(a3d->dev);
-	if (err)
-		goto fail3;
-
-	return 0;
-
- fail3:	if (a3d->adc)
-		gameport_unregister_port(a3d->adc);
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	input_free_device(input_dev);
-	kfree(a3d);
-	return err;
-}
-
-static void a3d_disconnect(struct gameport *gameport)
-{
-	struct a3d *a3d = gameport_get_drvdata(gameport);
-
-	input_unregister_device(a3d->dev);
-	if (a3d->adc)
-		gameport_unregister_port(a3d->adc);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(a3d);
-}
-
-static struct gameport_driver a3d_drv = {
-	.driver		= {
-		.name	= "adc",
-		.owner	= THIS_MODULE,
-	},
-	.description	= DRIVER_DESC,
-	.connect	= a3d_connect,
-	.disconnect	= a3d_disconnect,
-};
-
-module_gameport_driver(a3d_drv);
diff --git a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
deleted file mode 100644
index b784257..0000000
--- a/drivers/input/joystick/adi.c
+++ /dev/null
@@ -1,568 +0,0 @@
-/*
- *  Copyright (c) 1998-2005 Vojtech Pavlik
- */
-
-/*
- * Logitech ADI joystick family driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/string.h>
-#include <linux/slab.h>
-#include <linux/input.h>
-#include <linux/gameport.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Logitech ADI joystick family driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-/*
- * Times, array sizes, flags, ids.
- */
-
-#define ADI_MAX_START		200	/* Trigger to packet timeout [200us] */
-#define ADI_MAX_STROBE		40	/* Single bit timeout [40us] */
-#define ADI_INIT_DELAY		10	/* Delay after init packet [10ms] */
-#define ADI_DATA_DELAY		4	/* Delay after data packet [4ms] */
-
-#define ADI_MAX_LENGTH		256
-#define ADI_MIN_LENGTH		8
-#define ADI_MIN_LEN_LENGTH	10
-#define ADI_MIN_ID_LENGTH	66
-#define ADI_MAX_NAME_LENGTH	64
-#define ADI_MAX_CNAME_LENGTH	16
-#define ADI_MAX_PHYS_LENGTH	64
-
-#define ADI_FLAG_HAT		0x04
-#define ADI_FLAG_10BIT		0x08
-
-#define ADI_ID_TPD		0x01
-#define ADI_ID_WGP		0x06
-#define ADI_ID_WGPE		0x08
-#define ADI_ID_MAX		0x0a
-
-/*
- * Names, buttons, axes ...
- */
-
-static char *adi_names[] = {	"WingMan Extreme Digital", "ThunderPad Digital", "SideCar", "CyberMan 2",
-				"WingMan Interceptor", "WingMan Formula", "WingMan GamePad",
-				"WingMan Extreme Digital 3D", "WingMan GamePad Extreme",
-				"WingMan GamePad USB", "Unknown Device %#x" };
-
-static char adi_wmgpe_abs[] =	{ ABS_X, ABS_Y, ABS_HAT0X, ABS_HAT0Y };
-static char adi_wmi_abs[] =	{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y, ABS_HAT2X, ABS_HAT2Y };
-static char adi_wmed3d_abs[] =	{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RZ, ABS_HAT0X, ABS_HAT0Y };
-static char adi_cm2_abs[] =	{ ABS_X, ABS_Y, ABS_Z, ABS_RX, ABS_RY, ABS_RZ };
-static char adi_wmf_abs[] =	{ ABS_WHEEL, ABS_GAS, ABS_BRAKE, ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y, ABS_HAT2X, ABS_HAT2Y };
-
-static short adi_wmgpe_key[] =	{ BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z,  BTN_TL, BTN_TR, BTN_START, BTN_MODE, BTN_SELECT };
-static short adi_wmi_key[] =	{ BTN_TRIGGER,  BTN_TOP, BTN_THUMB, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_EXTRA };
-static short adi_wmed3d_key[] =	{ BTN_TRIGGER, BTN_THUMB, BTN_THUMB2, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2 };
-static short adi_cm2_key[] =	{ BTN_1, BTN_2, BTN_3, BTN_4, BTN_5, BTN_6, BTN_7, BTN_8 };
-
-static char* adi_abs[] = { adi_wmi_abs, adi_wmgpe_abs, adi_wmf_abs, adi_cm2_abs, adi_wmi_abs, adi_wmf_abs,
-			   adi_wmgpe_abs, adi_wmed3d_abs, adi_wmgpe_abs, adi_wmgpe_abs, adi_wmi_abs };
-
-static short* adi_key[] = { adi_wmi_key, adi_wmgpe_key, adi_cm2_key, adi_cm2_key, adi_wmi_key, adi_cm2_key,
-			    adi_wmgpe_key, adi_wmed3d_key, adi_wmgpe_key, adi_wmgpe_key, adi_wmi_key };
-
-/*
- * Hat to axis conversion arrays.
- */
-
-static struct {
-	int x;
-	int y;
-} adi_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
-
-/*
- * Per-port information.
- */
-
-struct adi {
-	struct input_dev *dev;
-	int length;
-	int ret;
-	int idx;
-	unsigned char id;
-	char buttons;
-	char axes10;
-	char axes8;
-	signed char pad;
-	char hats;
-	char *abs;
-	short *key;
-	char name[ADI_MAX_NAME_LENGTH];
-	char cname[ADI_MAX_CNAME_LENGTH];
-	char phys[ADI_MAX_PHYS_LENGTH];
-	unsigned char data[ADI_MAX_LENGTH];
-};
-
-struct adi_port {
-	struct gameport *gameport;
-	struct adi adi[2];
-	int bad;
-	int reads;
-};
-
-/*
- * adi_read_packet() reads a Logitech ADI packet.
- */
-
-static void adi_read_packet(struct adi_port *port)
-{
-	struct adi *adi = port->adi;
-	struct gameport *gameport = port->gameport;
-	unsigned char u, v, w, x, z;
-	int t[2], s[2], i;
-	unsigned long flags;
-
-	for (i = 0; i < 2; i++) {
-		adi[i].ret = -1;
-		t[i] = gameport_time(gameport, ADI_MAX_START);
-		s[i] = 0;
-	}
-
-	local_irq_save(flags);
-
-	gameport_trigger(gameport);
-	v = z = gameport_read(gameport);
-
-	do {
-		u = v;
-		w = u ^ (v = x = gameport_read(gameport));
-		for (i = 0; i < 2; i++, w >>= 2, x >>= 2) {
-			t[i]--;
-			if ((w & 0x30) && s[i]) {
-				if ((w & 0x30) < 0x30 && adi[i].ret < ADI_MAX_LENGTH && t[i] > 0) {
-					adi[i].data[++adi[i].ret] = w;
-					t[i] = gameport_time(gameport, ADI_MAX_STROBE);
-				} else t[i] = 0;
-			} else if (!(x & 0x30)) s[i] = 1;
-		}
-	} while (t[0] > 0 || t[1] > 0);
-
-	local_irq_restore(flags);
-
-	return;
-}
-
-/*
- * adi_move_bits() detects a possible 2-stream mode, and moves
- * the bits accordingly.
- */
-
-static void adi_move_bits(struct adi_port *port, int length)
-{
-	int i;
-	struct adi *adi = port->adi;
-
-	adi[0].idx = adi[1].idx = 0;
-
-	if (adi[0].ret <= 0 || adi[1].ret <= 0) return;
-	if (adi[0].data[0] & 0x20 || ~adi[1].data[0] & 0x20) return;
-
-	for (i = 1; i <= adi[1].ret; i++)
-		adi[0].data[((length - 1) >> 1) + i + 1] = adi[1].data[i];
-
-	adi[0].ret += adi[1].ret;
-	adi[1].ret = -1;
-}
-
-/*
- * adi_get_bits() gathers bits from the data packet.
- */
-
-static inline int adi_get_bits(struct adi *adi, int count)
-{
-	int bits = 0;
-	int i;
-	if ((adi->idx += count) > adi->ret) return 0;
-	for (i = 0; i < count; i++)
-		bits |= ((adi->data[adi->idx - i] >> 5) & 1) << i;
-	return bits;
-}
-
-/*
- * adi_decode() decodes Logitech joystick data into input events.
- */
-
-static int adi_decode(struct adi *adi)
-{
-	struct input_dev *dev = adi->dev;
-	char *abs = adi->abs;
-	short *key = adi->key;
-	int i, t;
-
-	if (adi->ret < adi->length || adi->id != (adi_get_bits(adi, 4) | (adi_get_bits(adi, 4) << 4)))
-		return -1;
-
-	for (i = 0; i < adi->axes10; i++)
-		input_report_abs(dev, *abs++, adi_get_bits(adi, 10));
-
-	for (i = 0; i < adi->axes8; i++)
-		input_report_abs(dev, *abs++, adi_get_bits(adi, 8));
-
-	for (i = 0; i < adi->buttons && i < 63; i++) {
-		if (i == adi->pad) {
-			t = adi_get_bits(adi, 4);
-			input_report_abs(dev, *abs++, ((t >> 2) & 1) - ( t       & 1));
-			input_report_abs(dev, *abs++, ((t >> 1) & 1) - ((t >> 3) & 1));
-		}
-		input_report_key(dev, *key++, adi_get_bits(adi, 1));
-	}
-
-	for (i = 0; i < adi->hats; i++) {
-		if ((t = adi_get_bits(adi, 4)) > 8) t = 0;
-		input_report_abs(dev, *abs++, adi_hat_to_axis[t].x);
-		input_report_abs(dev, *abs++, adi_hat_to_axis[t].y);
-	}
-
-	for (i = 63; i < adi->buttons; i++)
-		input_report_key(dev, *key++, adi_get_bits(adi, 1));
-
-	input_sync(dev);
-
-	return 0;
-}
-
-/*
- * adi_read() reads the data packet and decodes it.
- */
-
-static int adi_read(struct adi_port *port)
-{
-	int i;
-	int result = 0;
-
-	adi_read_packet(port);
-	adi_move_bits(port, port->adi[0].length);
-
-	for (i = 0; i < 2; i++)
-		if (port->adi[i].length)
-			 result |= adi_decode(port->adi + i);
-
-	return result;
-}
-
-/*
- * adi_poll() repeatedly polls the Logitech joysticks.
- */
-
-static void adi_poll(struct gameport *gameport)
-{
-	struct adi_port *port = gameport_get_drvdata(gameport);
-
-	port->bad -= adi_read(port);
-	port->reads++;
-}
-
-/*
- * adi_open() is a callback from the input open routine.
- */
-
-static int adi_open(struct input_dev *dev)
-{
-	struct adi_port *port = input_get_drvdata(dev);
-
-	gameport_start_polling(port->gameport);
-	return 0;
-}
-
-/*
- * adi_close() is a callback from the input close routine.
- */
-
-static void adi_close(struct input_dev *dev)
-{
-	struct adi_port *port = input_get_drvdata(dev);
-
-	gameport_stop_polling(port->gameport);
-}
-
-/*
- * adi_init_digital() sends a trigger & delay sequence
- * to reset and initialize a Logitech joystick into digital mode.
- */
-
-static void adi_init_digital(struct gameport *gameport)
-{
-	int seq[] = { 4, -2, -3, 10, -6, -11, -7, -9, 11, 0 };
-	int i;
-
-	for (i = 0; seq[i]; i++) {
-		gameport_trigger(gameport);
-		if (seq[i] > 0)
-			msleep(seq[i]);
-		if (seq[i] < 0) {
-			mdelay(-seq[i]);
-			udelay(-seq[i]*14);	/* It looks like mdelay() is off by approx 1.4% */
-		}
-	}
-}
-
-static void adi_id_decode(struct adi *adi, struct adi_port *port)
-{
-	int i, t;
-
-	if (adi->ret < ADI_MIN_ID_LENGTH) /* Minimum ID packet length */
-		return;
-
-	if (adi->ret < (t = adi_get_bits(adi, 10))) {
-		printk(KERN_WARNING "adi: Short ID packet: reported: %d != read: %d\n", t, adi->ret);
-		return;
-	}
-
-	adi->id = adi_get_bits(adi, 4) | (adi_get_bits(adi, 4) << 4);
-
-	if ((t = adi_get_bits(adi, 4)) & ADI_FLAG_HAT) adi->hats++;
-
-	adi->length = adi_get_bits(adi, 10);
-
-	if (adi->length >= ADI_MAX_LENGTH || adi->length < ADI_MIN_LENGTH) {
-		printk(KERN_WARNING "adi: Bad data packet length (%d).\n", adi->length);
-		adi->length = 0;
-		return;
-	}
-
-	adi->axes8 = adi_get_bits(adi, 4);
-	adi->buttons = adi_get_bits(adi, 6);
-
-	if (adi_get_bits(adi, 6) != 8 && adi->hats) {
-		printk(KERN_WARNING "adi: Other than 8-dir POVs not supported yet.\n");
-		adi->length = 0;
-		return;
-	}
-
-	adi->buttons += adi_get_bits(adi, 6);
-	adi->hats += adi_get_bits(adi, 4);
-
-	i = adi_get_bits(adi, 4);
-
-	if (t & ADI_FLAG_10BIT) {
-		adi->axes10 = adi->axes8 - i;
-		adi->axes8 = i;
-	}
-
-	t = adi_get_bits(adi, 4);
-
-	for (i = 0; i < t; i++)
-		adi->cname[i] = adi_get_bits(adi, 8);
-	adi->cname[i] = 0;
-
-	t = 8 + adi->buttons + adi->axes10 * 10 + adi->axes8 * 8 + adi->hats * 4;
-	if (adi->length != t && adi->length != t + (t & 1)) {
-		printk(KERN_WARNING "adi: Expected length %d != data length %d\n", t, adi->length);
-		adi->length = 0;
-		return;
-	}
-
-	switch (adi->id) {
-		case ADI_ID_TPD:
-			adi->pad = 4;
-			adi->buttons -= 4;
-			break;
-		case ADI_ID_WGP:
-			adi->pad = 0;
-			adi->buttons -= 4;
-			break;
-		default:
-			adi->pad = -1;
-			break;
-	}
-}
-
-static int adi_init_input(struct adi *adi, struct adi_port *port, int half)
-{
-	struct input_dev *input_dev;
-	char buf[ADI_MAX_NAME_LENGTH];
-	int i, t;
-
-	adi->dev = input_dev = input_allocate_device();
-	if (!input_dev)
-		return -ENOMEM;
-
-	t = adi->id < ADI_ID_MAX ? adi->id : ADI_ID_MAX;
-
-	snprintf(buf, ADI_MAX_PHYS_LENGTH, adi_names[t], adi->id);
-	snprintf(adi->name, ADI_MAX_NAME_LENGTH, "Logitech %s [%s]", buf, adi->cname);
-	snprintf(adi->phys, ADI_MAX_PHYS_LENGTH, "%s/input%d", port->gameport->phys, half);
-
-	adi->abs = adi_abs[t];
-	adi->key = adi_key[t];
-
-	input_dev->name = adi->name;
-	input_dev->phys = adi->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_LOGITECH;
-	input_dev->id.product = adi->id;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &port->gameport->dev;
-
-	input_set_drvdata(input_dev, port);
-
-	input_dev->open = adi_open;
-	input_dev->close = adi_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++)
-		set_bit(adi->abs[i], input_dev->absbit);
-
-	for (i = 0; i < adi->buttons; i++)
-		set_bit(adi->key[i], input_dev->keybit);
-
-	return 0;
-}
-
-static void adi_init_center(struct adi *adi)
-{
-	int i, t, x;
-
-	if (!adi->length)
-		return;
-
-	for (i = 0; i < adi->axes10 + adi->axes8 + (adi->hats + (adi->pad != -1)) * 2; i++) {
-
-		t = adi->abs[i];
-		x = input_abs_get_val(adi->dev, t);
-
-		if (t == ABS_THROTTLE || t == ABS_RUDDER || adi->id == ADI_ID_WGPE)
-			x = i < adi->axes10 ? 512 : 128;
-
-		if (i < adi->axes10)
-			input_set_abs_params(adi->dev, t, 64, x * 2 - 64, 2, 16);
-		else if (i < adi->axes10 + adi->axes8)
-			input_set_abs_params(adi->dev, t, 48, x * 2 - 48, 1, 16);
-		else
-			input_set_abs_params(adi->dev, t, -1, 1, 0, 0);
-	}
-}
-
-/*
- * adi_connect() probes for Logitech ADI joysticks.
- */
-
-static int adi_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct adi_port *port;
-	int i;
-	int err;
-
-	port = kzalloc(sizeof(struct adi_port), GFP_KERNEL);
-	if (!port)
-		return -ENOMEM;
-
-	port->gameport = gameport;
-
-	gameport_set_drvdata(gameport, port);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	adi_init_digital(gameport);
-	adi_read_packet(port);
-
-	if (port->adi[0].ret >= ADI_MIN_LEN_LENGTH)
-		adi_move_bits(port, adi_get_bits(port->adi, 10));
-
-	for (i = 0; i < 2; i++) {
-		adi_id_decode(port->adi + i, port);
-
-		if (!port->adi[i].length)
-			continue;
-
-		err = adi_init_input(port->adi + i, port, i);
-		if (err)
-			goto fail2;
-	}
-
-	if (!port->adi[0].length && !port->adi[1].length) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, adi_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	msleep(ADI_INIT_DELAY);
-	if (adi_read(port)) {
-		msleep(ADI_DATA_DELAY);
-		adi_read(port);
-	}
-
-	for (i = 0; i < 2; i++)
-		if (port->adi[i].length > 0) {
-			adi_init_center(port->adi + i);
-			err = input_register_device(port->adi[i].dev);
-			if (err)
-				goto fail3;
-		}
-
-	return 0;
-
- fail3: while (--i >= 0) {
-		if (port->adi[i].length > 0) {
-			input_unregister_device(port->adi[i].dev);
-			port->adi[i].dev = NULL;
-		}
-	}
- fail2:	for (i = 0; i < 2; i++)
-		if (port->adi[i].dev)
-			input_free_device(port->adi[i].dev);
-	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(port);
-	return err;
-}
-
-static void adi_disconnect(struct gameport *gameport)
-{
-	int i;
-	struct adi_port *port = gameport_get_drvdata(gameport);
-
-	for (i = 0; i < 2; i++)
-		if (port->adi[i].length > 0)
-			input_unregister_device(port->adi[i].dev);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(port);
-}
-
-static struct gameport_driver adi_drv = {
-	.driver		= {
-		.name	= "adi",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= adi_connect,
-	.disconnect	= adi_disconnect,
-};
-
-module_gameport_driver(adi_drv);
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
deleted file mode 100644
index ab0fdcd..0000000
--- a/drivers/input/joystick/analog.c
+++ /dev/null
@@ -1,769 +0,0 @@
-/*
- *  Copyright (c) 1996-2001 Vojtech Pavlik
- */
-
-/*
- * Analog joystick and gamepad driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/bitops.h>
-#include <linux/init.h>
-#include <linux/input.h>
-#include <linux/gameport.h>
-#include <linux/jiffies.h>
-#include <linux/timex.h>
-
-#define DRIVER_DESC	"Analog joystick and gamepad driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-/*
- * Option parsing.
- */
-
-#define ANALOG_PORTS		16
-
-static char *js[ANALOG_PORTS];
-static unsigned int js_nargs;
-static int analog_options[ANALOG_PORTS];
-module_param_array_named(map, js, charp, &js_nargs, 0);
-MODULE_PARM_DESC(map, "Describes analog joysticks type/capabilities");
-
-/*
- * Times, feature definitions.
- */
-
-#define ANALOG_RUDDER		0x00004
-#define ANALOG_THROTTLE		0x00008
-#define ANALOG_AXES_STD		0x0000f
-#define ANALOG_BTNS_STD		0x000f0
-
-#define ANALOG_BTNS_CHF		0x00100
-#define ANALOG_HAT1_CHF		0x00200
-#define ANALOG_HAT2_CHF		0x00400
-#define ANALOG_HAT_FCS		0x00800
-#define ANALOG_HATS_ALL		0x00e00
-#define ANALOG_BTN_TL		0x01000
-#define ANALOG_BTN_TR		0x02000
-#define ANALOG_BTN_TL2		0x04000
-#define ANALOG_BTN_TR2		0x08000
-#define ANALOG_BTNS_TLR		0x03000
-#define ANALOG_BTNS_TLR2	0x0c000
-#define ANALOG_BTNS_GAMEPAD	0x0f000
-
-#define ANALOG_HBTN_CHF		0x10000
-#define ANALOG_ANY_CHF		0x10700
-#define ANALOG_SAITEK		0x20000
-#define ANALOG_EXTENSIONS	0x7ff00
-#define ANALOG_GAMEPAD		0x80000
-
-#define ANALOG_MAX_TIME		3	/* 3 ms */
-#define ANALOG_LOOP_TIME	2000	/* 2 * loop */
-#define ANALOG_SAITEK_DELAY	200	/* 200 us */
-#define ANALOG_SAITEK_TIME	2000	/* 2000 us */
-#define ANALOG_AXIS_TIME	2	/* 2 * refresh */
-#define ANALOG_INIT_RETRIES	8	/* 8 times */
-#define ANALOG_FUZZ_BITS	2	/* 2 bit more */
-#define ANALOG_FUZZ_MAGIC	36	/* 36 u*ms/loop */
-
-#define ANALOG_MAX_NAME_LENGTH  128
-#define ANALOG_MAX_PHYS_LENGTH	32
-
-static short analog_axes[] = { ABS_X, ABS_Y, ABS_RUDDER, ABS_THROTTLE };
-static short analog_hats[] = { ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y, ABS_HAT2X, ABS_HAT2Y };
-static short analog_pads[] = { BTN_Y, BTN_Z, BTN_TL, BTN_TR };
-static short analog_exts[] = { ANALOG_HAT1_CHF, ANALOG_HAT2_CHF, ANALOG_HAT_FCS };
-static short analog_pad_btn[] = { BTN_A, BTN_B, BTN_C, BTN_X, BTN_TL2, BTN_TR2, BTN_SELECT, BTN_START, BTN_MODE, BTN_BASE };
-static short analog_joy_btn[] = { BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2,
-				  BTN_BASE3, BTN_BASE4, BTN_BASE5, BTN_BASE6 };
-
-static unsigned char analog_chf[] = { 0xf, 0x0, 0x1, 0x9, 0x2, 0x4, 0xc, 0x8, 0x3, 0x5, 0xb, 0x7, 0xd, 0xe, 0xa, 0x6 };
-
-struct analog {
-	struct input_dev *dev;
-	int mask;
-	short *buttons;
-	char name[ANALOG_MAX_NAME_LENGTH];
-	char phys[ANALOG_MAX_PHYS_LENGTH];
-};
-
-struct analog_port {
-	struct gameport *gameport;
-	struct analog analog[2];
-	unsigned char mask;
-	char saitek;
-	char cooked;
-	int bads;
-	int reads;
-	int speed;
-	int loop;
-	int fuzz;
-	int axes[4];
-	int buttons;
-	int initial[4];
-	int axtime;
-};
-
-/*
- * Time macros.
- */
-
-#ifdef __i386__
-
-#include <linux/i8253.h>
-
-#define GET_TIME(x)	do { if (cpu_has_tsc) rdtscl(x); else x = get_time_pit(); } while (0)
-#define DELTA(x,y)	(cpu_has_tsc ? ((y) - (x)) : ((x) - (y) + ((x) < (y) ? PIT_TICK_RATE / HZ : 0)))
-#define TIME_NAME	(cpu_has_tsc?"TSC":"PIT")
-static unsigned int get_time_pit(void)
-{
-        unsigned long flags;
-        unsigned int count;
-
-        raw_spin_lock_irqsave(&i8253_lock, flags);
-        outb_p(0x00, 0x43);
-        count = inb_p(0x40);
-        count |= inb_p(0x40) << 8;
-        raw_spin_unlock_irqrestore(&i8253_lock, flags);
-
-        return count;
-}
-#elif defined(__x86_64__)
-#define GET_TIME(x)	rdtscl(x)
-#define DELTA(x,y)	((y)-(x))
-#define TIME_NAME	"TSC"
-#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_TILE)
-#define GET_TIME(x)	do { x = get_cycles(); } while (0)
-#define DELTA(x,y)	((y)-(x))
-#define TIME_NAME	"get_cycles"
-#else
-#define FAKE_TIME
-static unsigned long analog_faketime = 0;
-#define GET_TIME(x)     do { x = analog_faketime++; } while(0)
-#define DELTA(x,y)	((y)-(x))
-#define TIME_NAME	"Unreliable"
-#warning Precise timer not defined for this architecture.
-#endif
-
-/*
- * analog_decode() decodes analog joystick data and reports input events.
- */
-
-static void analog_decode(struct analog *analog, int *axes, int *initial, int buttons)
-{
-	struct input_dev *dev = analog->dev;
-	int i, j;
-
-	if (analog->mask & ANALOG_HAT_FCS)
-		for (i = 0; i < 4; i++)
-			if (axes[3] < ((initial[3] * ((i << 1) + 1)) >> 3)) {
-				buttons |= 1 << (i + 14);
-				break;
-			}
-
-	for (i = j = 0; i < 6; i++)
-		if (analog->mask & (0x10 << i))
-			input_report_key(dev, analog->buttons[j++], (buttons >> i) & 1);
-
-	if (analog->mask & ANALOG_HBTN_CHF)
-		for (i = 0; i < 4; i++)
-			input_report_key(dev, analog->buttons[j++], (buttons >> (i + 10)) & 1);
-
-	if (analog->mask & ANALOG_BTN_TL)
-		input_report_key(dev, analog_pads[0], axes[2] < (initial[2] >> 1));
-	if (analog->mask & ANALOG_BTN_TR)
-		input_report_key(dev, analog_pads[1], axes[3] < (initial[3] >> 1));
-	if (analog->mask & ANALOG_BTN_TL2)
-		input_report_key(dev, analog_pads[2], axes[2] > (initial[2] + (initial[2] >> 1)));
-	if (analog->mask & ANALOG_BTN_TR2)
-		input_report_key(dev, analog_pads[3], axes[3] > (initial[3] + (initial[3] >> 1)));
-
-	for (i = j = 0; i < 4; i++)
-		if (analog->mask & (1 << i))
-			input_report_abs(dev, analog_axes[j++], axes[i]);
-
-	for (i = j = 0; i < 3; i++)
-		if (analog->mask & analog_exts[i]) {
-			input_report_abs(dev, analog_hats[j++],
-				((buttons >> ((i << 2) + 7)) & 1) - ((buttons >> ((i << 2) + 9)) & 1));
-			input_report_abs(dev, analog_hats[j++],
-				((buttons >> ((i << 2) + 8)) & 1) - ((buttons >> ((i << 2) + 6)) & 1));
-		}
-
-	input_sync(dev);
-}
-
-/*
- * analog_cooked_read() reads analog joystick data.
- */
-
-static int analog_cooked_read(struct analog_port *port)
-{
-	struct gameport *gameport = port->gameport;
-	unsigned int time[4], start, loop, now, loopout, timeout;
-	unsigned char data[4], this, last;
-	unsigned long flags;
-	int i, j;
-
-	loopout = (ANALOG_LOOP_TIME * port->loop) / 1000;
-	timeout = ANALOG_MAX_TIME * port->speed;
-
-	local_irq_save(flags);
-	gameport_trigger(gameport);
-	GET_TIME(now);
-	local_irq_restore(flags);
-
-	start = now;
-	this = port->mask;
-	i = 0;
-
-	do {
-		loop = now;
-		last = this;
-
-		local_irq_disable();
-		this = gameport_read(gameport) & port->mask;
-		GET_TIME(now);
-		local_irq_restore(flags);
-
-		if ((last ^ this) && (DELTA(loop, now) < loopout)) {
-			data[i] = last ^ this;
-			time[i] = now;
-			i++;
-		}
-
-	} while (this && (i < 4) && (DELTA(start, now) < timeout));
-
-	this <<= 4;
-
-	for (--i; i >= 0; i--) {
-		this |= data[i];
-		for (j = 0; j < 4; j++)
-			if (data[i] & (1 << j))
-				port->axes[j] = (DELTA(start, time[i]) << ANALOG_FUZZ_BITS) / port->loop;
-	}
-
-	return -(this != port->mask);
-}
-
-static int analog_button_read(struct analog_port *port, char saitek, char chf)
-{
-	unsigned char u;
-	int t = 1, i = 0;
-	int strobe = gameport_time(port->gameport, ANALOG_SAITEK_TIME);
-
-	u = gameport_read(port->gameport);
-
-	if (!chf) {
-		port->buttons = (~u >> 4) & 0xf;
-		return 0;
-	}
-
-	port->buttons = 0;
-
-	while ((~u & 0xf0) && (i < 16) && t) {
-		port->buttons |= 1 << analog_chf[(~u >> 4) & 0xf];
-		if (!saitek) return 0;
-		udelay(ANALOG_SAITEK_DELAY);
-		t = strobe;
-		gameport_trigger(port->gameport);
-		while (((u = gameport_read(port->gameport)) & port->mask) && t) t--;
-		i++;
-	}
-
-	return -(!t || (i == 16));
-}
-
-/*
- * analog_poll() repeatedly polls the Analog joysticks.
- */
-
-static void analog_poll(struct gameport *gameport)
-{
-	struct analog_port *port = gameport_get_drvdata(gameport);
-	int i;
-
-	char saitek = !!(port->analog[0].mask & ANALOG_SAITEK);
-	char chf = !!(port->analog[0].mask & ANALOG_ANY_CHF);
-
-	if (port->cooked) {
-		port->bads -= gameport_cooked_read(port->gameport, port->axes, &port->buttons);
-		if (chf)
-			port->buttons = port->buttons ? (1 << analog_chf[port->buttons]) : 0;
-		port->reads++;
-	} else {
-		if (!port->axtime--) {
-			port->bads -= analog_cooked_read(port);
-			port->bads -= analog_button_read(port, saitek, chf);
-			port->reads++;
-			port->axtime = ANALOG_AXIS_TIME - 1;
-		} else {
-			if (!saitek)
-				analog_button_read(port, saitek, chf);
-		}
-	}
-
-	for (i = 0; i < 2; i++)
-		if (port->analog[i].mask)
-			analog_decode(port->analog + i, port->axes, port->initial, port->buttons);
-}
-
-/*
- * analog_open() is a callback from the input open routine.
- */
-
-static int analog_open(struct input_dev *dev)
-{
-	struct analog_port *port = input_get_drvdata(dev);
-
-	gameport_start_polling(port->gameport);
-	return 0;
-}
-
-/*
- * analog_close() is a callback from the input close routine.
- */
-
-static void analog_close(struct input_dev *dev)
-{
-	struct analog_port *port = input_get_drvdata(dev);
-
-	gameport_stop_polling(port->gameport);
-}
-
-/*
- * analog_calibrate_timer() calibrates the timer and computes loop
- * and timeout values for a joystick port.
- */
-
-static void analog_calibrate_timer(struct analog_port *port)
-{
-	struct gameport *gameport = port->gameport;
-	unsigned int i, t, tx, t1, t2, t3;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	GET_TIME(t1);
-#ifdef FAKE_TIME
-	analog_faketime += 830;
-#endif
-	mdelay(1);
-	GET_TIME(t2);
-	GET_TIME(t3);
-	local_irq_restore(flags);
-
-	port->speed = DELTA(t1, t2) - DELTA(t2, t3);
-
-	tx = ~0;
-
-	for (i = 0; i < 50; i++) {
-		local_irq_save(flags);
-		GET_TIME(t1);
-		for (t = 0; t < 50; t++) { gameport_read(gameport); GET_TIME(t2); }
-		GET_TIME(t3);
-		local_irq_restore(flags);
-		udelay(i);
-		t = DELTA(t1, t2) - DELTA(t2, t3);
-		if (t < tx) tx = t;
-	}
-
-        port->loop = tx / 50;
-}
-
-/*
- * analog_name() constructs a name for an analog joystick.
- */
-
-static void analog_name(struct analog *analog)
-{
-	snprintf(analog->name, sizeof(analog->name), "Analog %d-axis %d-button",
-		 hweight8(analog->mask & ANALOG_AXES_STD),
-		 hweight8(analog->mask & ANALOG_BTNS_STD) + !!(analog->mask & ANALOG_BTNS_CHF) * 2 +
-		 hweight16(analog->mask & ANALOG_BTNS_GAMEPAD) + !!(analog->mask & ANALOG_HBTN_CHF) * 4);
-
-	if (analog->mask & ANALOG_HATS_ALL)
-		snprintf(analog->name, sizeof(analog->name), "%s %d-hat",
-			 analog->name, hweight16(analog->mask & ANALOG_HATS_ALL));
-
-	if (analog->mask & ANALOG_HAT_FCS)
-		strlcat(analog->name, " FCS", sizeof(analog->name));
-	if (analog->mask & ANALOG_ANY_CHF)
-		strlcat(analog->name, (analog->mask & ANALOG_SAITEK) ? " Saitek" : " CHF",
-			sizeof(analog->name));
-
-	strlcat(analog->name, (analog->mask & ANALOG_GAMEPAD) ? " gamepad": " joystick",
-		sizeof(analog->name));
-}
-
-/*
- * analog_init_device()
- */
-
-static int analog_init_device(struct analog_port *port, struct analog *analog, int index)
-{
-	struct input_dev *input_dev;
-	int i, j, t, v, w, x, y, z;
-	int error;
-
-	analog_name(analog);
-	snprintf(analog->phys, sizeof(analog->phys),
-		 "%s/input%d", port->gameport->phys, index);
-	analog->buttons = (analog->mask & ANALOG_GAMEPAD) ? analog_pad_btn : analog_joy_btn;
-
-	analog->dev = input_dev = input_allocate_device();
-	if (!input_dev)
-		return -ENOMEM;
-
-	input_dev->name = analog->name;
-	input_dev->phys = analog->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_ANALOG;
-	input_dev->id.product = analog->mask >> 4;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &port->gameport->dev;
-
-	input_set_drvdata(input_dev, port);
-
-	input_dev->open = analog_open;
-	input_dev->close = analog_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (i = j = 0; i < 4; i++)
-		if (analog->mask & (1 << i)) {
-
-			t = analog_axes[j];
-			x = port->axes[i];
-			y = (port->axes[0] + port->axes[1]) >> 1;
-			z = y - port->axes[i];
-			z = z > 0 ? z : -z;
-			v = (x >> 3);
-			w = (x >> 3);
-
-			if ((i == 2 || i == 3) && (j == 2 || j == 3) && (z > (y >> 3)))
-				x = y;
-
-			if (analog->mask & ANALOG_SAITEK) {
-				if (i == 2) x = port->axes[i];
-				v = x - (x >> 2);
-				w = (x >> 4);
-			}
-
-			input_set_abs_params(input_dev, t, v, (x << 1) - v, port->fuzz, w);
-			j++;
-		}
-
-	for (i = j = 0; i < 3; i++)
-		if (analog->mask & analog_exts[i])
-			for (x = 0; x < 2; x++) {
-				t = analog_hats[j++];
-				input_set_abs_params(input_dev, t, -1, 1, 0, 0);
-			}
-
-	for (i = j = 0; i < 4; i++)
-		if (analog->mask & (0x10 << i))
-			set_bit(analog->buttons[j++], input_dev->keybit);
-
-	if (analog->mask & ANALOG_BTNS_CHF)
-		for (i = 0; i < 2; i++)
-			set_bit(analog->buttons[j++], input_dev->keybit);
-
-	if (analog->mask & ANALOG_HBTN_CHF)
-		for (i = 0; i < 4; i++)
-			set_bit(analog->buttons[j++], input_dev->keybit);
-
-	for (i = 0; i < 4; i++)
-		if (analog->mask & (ANALOG_BTN_TL << i))
-			set_bit(analog_pads[i], input_dev->keybit);
-
-	analog_decode(analog, port->axes, port->initial, port->buttons);
-
-	error = input_register_device(analog->dev);
-	if (error) {
-		input_free_device(analog->dev);
-		return error;
-	}
-
-	return 0;
-}
-
-/*
- * analog_init_devices() sets up device-specific values and registers the input devices.
- */
-
-static int analog_init_masks(struct analog_port *port)
-{
-	int i;
-	struct analog *analog = port->analog;
-	int max[4];
-
-	if (!port->mask)
-		return -1;
-
-	if ((port->mask & 3) != 3 && port->mask != 0xc) {
-		printk(KERN_WARNING "analog.c: Unknown joystick device found  "
-			"(data=%#x, %s), probably not analog joystick.\n",
-			port->mask, port->gameport->phys);
-		return -1;
-	}
-
-
-	i = analog_options[0]; /* FIXME !!! - need to specify options for different ports */
-
-	analog[0].mask = i & 0xfffff;
-
-	analog[0].mask &= ~(ANALOG_AXES_STD | ANALOG_HAT_FCS | ANALOG_BTNS_GAMEPAD)
-			| port->mask | ((port->mask << 8) & ANALOG_HAT_FCS)
-			| ((port->mask << 10) & ANALOG_BTNS_TLR) | ((port->mask << 12) & ANALOG_BTNS_TLR2);
-
-	analog[0].mask &= ~(ANALOG_HAT2_CHF)
-			| ((analog[0].mask & ANALOG_HBTN_CHF) ? 0 : ANALOG_HAT2_CHF);
-
-	analog[0].mask &= ~(ANALOG_THROTTLE | ANALOG_BTN_TR | ANALOG_BTN_TR2)
-			| ((~analog[0].mask & ANALOG_HAT_FCS) >> 8)
-			| ((~analog[0].mask & ANALOG_HAT_FCS) << 2)
-			| ((~analog[0].mask & ANALOG_HAT_FCS) << 4);
-
-	analog[0].mask &= ~(ANALOG_THROTTLE | ANALOG_RUDDER)
-			| (((~analog[0].mask & ANALOG_BTNS_TLR ) >> 10)
-			&  ((~analog[0].mask & ANALOG_BTNS_TLR2) >> 12));
-
-	analog[1].mask = ((i >> 20) & 0xff) | ((i >> 12) & 0xf0000);
-
-	analog[1].mask &= (analog[0].mask & ANALOG_EXTENSIONS) ? ANALOG_GAMEPAD
-			: (((ANALOG_BTNS_STD | port->mask) & ~analog[0].mask) | ANALOG_GAMEPAD);
-
-	if (port->cooked) {
-
-		for (i = 0; i < 4; i++) max[i] = port->axes[i] << 1;
-
-		if ((analog[0].mask & 0x7) == 0x7) max[2] = (max[0] + max[1]) >> 1;
-		if ((analog[0].mask & 0xb) == 0xb) max[3] = (max[0] + max[1]) >> 1;
-		if ((analog[0].mask & ANALOG_BTN_TL) && !(analog[0].mask & ANALOG_BTN_TL2)) max[2] >>= 1;
-		if ((analog[0].mask & ANALOG_BTN_TR) && !(analog[0].mask & ANALOG_BTN_TR2)) max[3] >>= 1;
-		if ((analog[0].mask & ANALOG_HAT_FCS)) max[3] >>= 1;
-
-		gameport_calibrate(port->gameport, port->axes, max);
-	}
-
-	for (i = 0; i < 4; i++)
-		port->initial[i] = port->axes[i];
-
-	return -!(analog[0].mask || analog[1].mask);
-}
-
-static int analog_init_port(struct gameport *gameport, struct gameport_driver *drv, struct analog_port *port)
-{
-	int i, t, u, v;
-
-	port->gameport = gameport;
-
-	gameport_set_drvdata(gameport, port);
-
-	if (!gameport_open(gameport, drv, GAMEPORT_MODE_RAW)) {
-
-		analog_calibrate_timer(port);
-
-		gameport_trigger(gameport);
-		t = gameport_read(gameport);
-		msleep(ANALOG_MAX_TIME);
-		port->mask = (gameport_read(gameport) ^ t) & t & 0xf;
-		port->fuzz = (port->speed * ANALOG_FUZZ_MAGIC) / port->loop / 1000 + ANALOG_FUZZ_BITS;
-
-		for (i = 0; i < ANALOG_INIT_RETRIES; i++) {
-			if (!analog_cooked_read(port))
-				break;
-			msleep(ANALOG_MAX_TIME);
-		}
-
-		u = v = 0;
-
-		msleep(ANALOG_MAX_TIME);
-		t = gameport_time(gameport, ANALOG_MAX_TIME * 1000);
-		gameport_trigger(gameport);
-		while ((gameport_read(port->gameport) & port->mask) && (u < t))
-			u++;
-		udelay(ANALOG_SAITEK_DELAY);
-		t = gameport_time(gameport, ANALOG_SAITEK_TIME);
-		gameport_trigger(gameport);
-		while ((gameport_read(port->gameport) & port->mask) && (v < t))
-			v++;
-
-		if (v < (u >> 1)) { /* FIXME - more than one port */
-			analog_options[0] |= /* FIXME - more than one port */
-				ANALOG_SAITEK | ANALOG_BTNS_CHF | ANALOG_HBTN_CHF | ANALOG_HAT1_CHF;
-			return 0;
-		}
-
-		gameport_close(gameport);
-	}
-
-	if (!gameport_open(gameport, drv, GAMEPORT_MODE_COOKED)) {
-
-		for (i = 0; i < ANALOG_INIT_RETRIES; i++)
-			if (!gameport_cooked_read(gameport, port->axes, &port->buttons))
-				break;
-		for (i = 0; i < 4; i++)
-			if (port->axes[i] != -1)
-				port->mask |= 1 << i;
-
-		port->fuzz = gameport->fuzz;
-		port->cooked = 1;
-		return 0;
-	}
-
-	return gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-}
-
-static int analog_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct analog_port *port;
-	int i;
-	int err;
-
-	if (!(port = kzalloc(sizeof(struct analog_port), GFP_KERNEL)))
-		return - ENOMEM;
-
-	err = analog_init_port(gameport, drv, port);
-	if (err)
-		goto fail1;
-
-	err = analog_init_masks(port);
-	if (err)
-		goto fail2;
-
-	gameport_set_poll_handler(gameport, analog_poll);
-	gameport_set_poll_interval(gameport, 10);
-
-	for (i = 0; i < 2; i++)
-		if (port->analog[i].mask) {
-			err = analog_init_device(port, port->analog + i, i);
-			if (err)
-				goto fail3;
-		}
-
-	return 0;
-
- fail3: while (--i >= 0)
-		if (port->analog[i].mask)
-			input_unregister_device(port->analog[i].dev);
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(port);
-	return err;
-}
-
-static void analog_disconnect(struct gameport *gameport)
-{
-	struct analog_port *port = gameport_get_drvdata(gameport);
-	int i;
-
-	for (i = 0; i < 2; i++)
-		if (port->analog[i].mask)
-			input_unregister_device(port->analog[i].dev);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	printk(KERN_INFO "analog.c: %d out of %d reads (%d%%) on %s failed\n",
-		port->bads, port->reads, port->reads ? (port->bads * 100 / port->reads) : 0,
-		port->gameport->phys);
-	kfree(port);
-}
-
-struct analog_types {
-	char *name;
-	int value;
-};
-
-static struct analog_types analog_types[] = {
-	{ "none",	0x00000000 },
-	{ "auto",	0x000000ff },
-	{ "2btn",	0x0000003f },
-	{ "y-joy",	0x0cc00033 },
-	{ "y-pad",	0x8cc80033 },
-	{ "fcs",	0x000008f7 },
-	{ "chf",	0x000002ff },
-	{ "fullchf",	0x000007ff },
-	{ "gamepad",	0x000830f3 },
-	{ "gamepad8",	0x0008f0f3 },
-	{ NULL, 0 }
-};
-
-static void analog_parse_options(void)
-{
-	int i, j;
-	char *end;
-
-	for (i = 0; i < js_nargs; i++) {
-
-		for (j = 0; analog_types[j].name; j++)
-			if (!strcmp(analog_types[j].name, js[i])) {
-				analog_options[i] = analog_types[j].value;
-				break;
-			}
-		if (analog_types[j].name) continue;
-
-		analog_options[i] = simple_strtoul(js[i], &end, 0);
-		if (end != js[i]) continue;
-
-		analog_options[i] = 0xff;
-		if (!strlen(js[i])) continue;
-
-		printk(KERN_WARNING "analog.c: Bad config for port %d - \"%s\"\n", i, js[i]);
-	}
-
-	for (; i < ANALOG_PORTS; i++)
-		analog_options[i] = 0xff;
-}
-
-/*
- * The gameport device structure.
- */
-
-static struct gameport_driver analog_drv = {
-	.driver		= {
-		.name	= "analog",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= analog_connect,
-	.disconnect	= analog_disconnect,
-};
-
-static int __init analog_init(void)
-{
-	analog_parse_options();
-	return gameport_register_driver(&analog_drv);
-}
-
-static void __exit analog_exit(void)
-{
-	gameport_unregister_driver(&analog_drv);
-}
-
-module_init(analog_init);
-module_exit(analog_exit);
diff --git a/drivers/input/joystick/cobra.c b/drivers/input/joystick/cobra.c
deleted file mode 100644
index ae3ee24..0000000
--- a/drivers/input/joystick/cobra.c
+++ /dev/null
@@ -1,263 +0,0 @@
-/*
- *  Copyright (c) 1999-2001 Vojtech Pavlik
- */
-
-/*
- * Creative Labs Blaster GamePad Cobra driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Creative Labs Blaster GamePad Cobra driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define COBRA_MAX_STROBE	45	/* 45 us max wait for first strobe */
-#define COBRA_LENGTH		36
-
-static int cobra_btn[] = { BTN_START, BTN_SELECT, BTN_TL, BTN_TR, BTN_X, BTN_Y, BTN_Z, BTN_A, BTN_B, BTN_C, BTN_TL2, BTN_TR2, 0 };
-
-struct cobra {
-	struct gameport *gameport;
-	struct input_dev *dev[2];
-	int reads;
-	int bads;
-	unsigned char exists;
-	char phys[2][32];
-};
-
-static unsigned char cobra_read_packet(struct gameport *gameport, unsigned int *data)
-{
-	unsigned long flags;
-	unsigned char u, v, w;
-	__u64 buf[2];
-	int r[2], t[2];
-	int i, j, ret;
-
-	int strobe = gameport_time(gameport, COBRA_MAX_STROBE);
-
-	for (i = 0; i < 2; i++) {
-		r[i] = buf[i] = 0;
-		t[i] = COBRA_MAX_STROBE;
-	}
-
-	local_irq_save(flags);
-
-	u = gameport_read(gameport);
-
-	do {
-		t[0]--; t[1]--;
-		v = gameport_read(gameport);
-		for (i = 0, w = u ^ v; i < 2 && w; i++, w >>= 2)
-			if (w & 0x30) {
-				if ((w & 0x30) < 0x30 && r[i] < COBRA_LENGTH && t[i] > 0) {
-					buf[i] |= (__u64)((w >> 5) & 1) << r[i]++;
-					t[i] = strobe;
-					u = v;
-				} else t[i] = 0;
-			}
-	} while (t[0] > 0 || t[1] > 0);
-
-	local_irq_restore(flags);
-
-	ret = 0;
-
-	for (i = 0; i < 2; i++) {
-
-		if (r[i] != COBRA_LENGTH) continue;
-
-		for (j = 0; j < COBRA_LENGTH && (buf[i] & 0x04104107f) ^ 0x041041040; j++)
-			buf[i] = (buf[i] >> 1) | ((__u64)(buf[i] & 1) << (COBRA_LENGTH - 1));
-
-		if (j < COBRA_LENGTH) ret |= (1 << i);
-
-		data[i] = ((buf[i] >>  7) & 0x000001f) | ((buf[i] >>  8) & 0x00003e0)
-			| ((buf[i] >>  9) & 0x0007c00) | ((buf[i] >> 10) & 0x00f8000)
-			| ((buf[i] >> 11) & 0x1f00000);
-
-	}
-
-	return ret;
-}
-
-static void cobra_poll(struct gameport *gameport)
-{
-	struct cobra *cobra = gameport_get_drvdata(gameport);
-	struct input_dev *dev;
-	unsigned int data[2];
-	int i, j, r;
-
-	cobra->reads++;
-
-	if ((r = cobra_read_packet(gameport, data)) != cobra->exists) {
-		cobra->bads++;
-		return;
-	}
-
-	for (i = 0; i < 2; i++)
-		if (cobra->exists & r & (1 << i)) {
-
-			dev = cobra->dev[i];
-
-			input_report_abs(dev, ABS_X, ((data[i] >> 4) & 1) - ((data[i] >> 3) & 1));
-			input_report_abs(dev, ABS_Y, ((data[i] >> 2) & 1) - ((data[i] >> 1) & 1));
-
-			for (j = 0; cobra_btn[j]; j++)
-				input_report_key(dev, cobra_btn[j], data[i] & (0x20 << j));
-
-			input_sync(dev);
-
-		}
-}
-
-static int cobra_open(struct input_dev *dev)
-{
-	struct cobra *cobra = input_get_drvdata(dev);
-
-	gameport_start_polling(cobra->gameport);
-	return 0;
-}
-
-static void cobra_close(struct input_dev *dev)
-{
-	struct cobra *cobra = input_get_drvdata(dev);
-
-	gameport_stop_polling(cobra->gameport);
-}
-
-static int cobra_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct cobra *cobra;
-	struct input_dev *input_dev;
-	unsigned int data[2];
-	int i, j;
-	int err;
-
-	cobra = kzalloc(sizeof(struct cobra), GFP_KERNEL);
-	if (!cobra)
-		return -ENOMEM;
-
-	cobra->gameport = gameport;
-
-	gameport_set_drvdata(gameport, cobra);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	cobra->exists = cobra_read_packet(gameport, data);
-
-	for (i = 0; i < 2; i++)
-		if ((cobra->exists >> i) & data[i] & 1) {
-			printk(KERN_WARNING "cobra.c: Device %d on %s has the Ext bit set. ID is: %d"
-				" Contact vojtech@ucw.cz\n", i, gameport->phys, (data[i] >> 2) & 7);
-			cobra->exists &= ~(1 << i);
-		}
-
-	if (!cobra->exists) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, cobra_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	for (i = 0; i < 2; i++) {
-		if (~(cobra->exists >> i) & 1)
-			continue;
-
-		cobra->dev[i] = input_dev = input_allocate_device();
-		if (!input_dev) {
-			err = -ENOMEM;
-			goto fail3;
-		}
-
-		snprintf(cobra->phys[i], sizeof(cobra->phys[i]),
-			 "%s/input%d", gameport->phys, i);
-
-		input_dev->name = "Creative Labs Blaster GamePad Cobra";
-		input_dev->phys = cobra->phys[i];
-		input_dev->id.bustype = BUS_GAMEPORT;
-		input_dev->id.vendor = GAMEPORT_ID_VENDOR_CREATIVE;
-		input_dev->id.product = 0x0008;
-		input_dev->id.version = 0x0100;
-		input_dev->dev.parent = &gameport->dev;
-
-		input_set_drvdata(input_dev, cobra);
-
-		input_dev->open = cobra_open;
-		input_dev->close = cobra_close;
-
-		input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-		input_set_abs_params(input_dev, ABS_X, -1, 1, 0, 0);
-		input_set_abs_params(input_dev, ABS_Y, -1, 1, 0, 0);
-		for (j = 0; cobra_btn[j]; j++)
-			set_bit(cobra_btn[j], input_dev->keybit);
-
-		err = input_register_device(cobra->dev[i]);
-		if (err)
-			goto fail4;
-	}
-
-	return 0;
-
- fail4:	input_free_device(cobra->dev[i]);
- fail3:	while (--i >= 0)
-		if (cobra->dev[i])
-			input_unregister_device(cobra->dev[i]);
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(cobra);
-	return err;
-}
-
-static void cobra_disconnect(struct gameport *gameport)
-{
-	struct cobra *cobra = gameport_get_drvdata(gameport);
-	int i;
-
-	for (i = 0; i < 2; i++)
-		if ((cobra->exists >> i) & 1)
-			input_unregister_device(cobra->dev[i]);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(cobra);
-}
-
-static struct gameport_driver cobra_drv = {
-	.driver		= {
-		.name	= "cobra",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= cobra_connect,
-	.disconnect	= cobra_disconnect,
-};
-
-module_gameport_driver(cobra_drv);
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c
deleted file mode 100644
index 0f519db..0000000
--- a/drivers/input/joystick/gf2k.c
+++ /dev/null
@@ -1,375 +0,0 @@
-/*
- *  Copyright (c) 1998-2001 Vojtech Pavlik
- */
-
-/*
- * Genius Flight 2000 joystick driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/input.h>
-#include <linux/gameport.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Genius Flight 2000 joystick driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define GF2K_START		400	/* The time we wait for the first bit [400 us] */
-#define GF2K_STROBE		40	/* The time we wait for the first bit [40 us] */
-#define GF2K_TIMEOUT		4	/* Wait for everything to settle [4 ms] */
-#define GF2K_LENGTH		80	/* Max number of triplets in a packet */
-
-/*
- * Genius joystick ids ...
- */
-
-#define GF2K_ID_G09		1
-#define GF2K_ID_F30D		2
-#define GF2K_ID_F30		3
-#define GF2K_ID_F31D		4
-#define GF2K_ID_F305		5
-#define GF2K_ID_F23P		6
-#define GF2K_ID_F31		7
-#define GF2K_ID_MAX		7
-
-static char gf2k_length[] = { 40, 40, 40, 40, 40, 40, 40, 40 };
-static char gf2k_hat_to_axis[][2] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
-
-static char *gf2k_names[] = {"", "Genius G-09D", "Genius F-30D", "Genius F-30", "Genius MaxFighter F-31D",
-				"Genius F-30-5", "Genius Flight2000 F-23", "Genius F-31"};
-static unsigned char gf2k_hats[] = { 0, 2, 0, 0, 2, 0, 2, 0 };
-static unsigned char gf2k_axes[] = { 0, 2, 0, 0, 4, 0, 4, 0 };
-static unsigned char gf2k_joys[] = { 0, 0, 0, 0,10, 0, 8, 0 };
-static unsigned char gf2k_pads[] = { 0, 6, 0, 0, 0, 0, 0, 0 };
-static unsigned char gf2k_lens[] = { 0,18, 0, 0,18, 0,18, 0 };
-
-static unsigned char gf2k_abs[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, ABS_GAS, ABS_BRAKE };
-static short gf2k_btn_joy[] = { BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4 };
-static short gf2k_btn_pad[] = { BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_START, BTN_SELECT };
-
-
-static short gf2k_seq_reset[] = { 240, 340, 0 };
-static short gf2k_seq_digital[] = { 590, 320, 860, 0 };
-
-struct gf2k {
-	struct gameport *gameport;
-	struct input_dev *dev;
-	int reads;
-	int bads;
-	unsigned char id;
-	unsigned char length;
-	char phys[32];
-};
-
-/*
- * gf2k_read_packet() reads a Genius Flight2000 packet.
- */
-
-static int gf2k_read_packet(struct gameport *gameport, int length, char *data)
-{
-	unsigned char u, v;
-	int i;
-	unsigned int t, p;
-	unsigned long flags;
-
-	t = gameport_time(gameport, GF2K_START);
-	p = gameport_time(gameport, GF2K_STROBE);
-
-	i = 0;
-
-	local_irq_save(flags);
-
-	gameport_trigger(gameport);
-	v = gameport_read(gameport);
-
-	while (t > 0 && i < length) {
-		t--; u = v;
-		v = gameport_read(gameport);
-		if (v & ~u & 0x10) {
-			data[i++] = v >> 5;
-			t = p;
-		}
-	}
-
-	local_irq_restore(flags);
-
-	return i;
-}
-
-/*
- * gf2k_trigger_seq() initializes a Genius Flight2000 joystick
- * into digital mode.
- */
-
-static void gf2k_trigger_seq(struct gameport *gameport, short *seq)
-{
-
-	unsigned long flags;
-	int i, t;
-
-        local_irq_save(flags);
-
-	i = 0;
-        do {
-		gameport_trigger(gameport);
-		t = gameport_time(gameport, GF2K_TIMEOUT * 1000);
-		while ((gameport_read(gameport) & 1) && t) t--;
-                udelay(seq[i]);
-        } while (seq[++i]);
-
-	gameport_trigger(gameport);
-
-	local_irq_restore(flags);
-}
-
-/*
- * js_sw_get_bits() composes bits from the triplet buffer into a __u64.
- * Parameter 'pos' is bit number inside packet where to start at, 'num' is number
- * of bits to be read, 'shift' is offset in the resulting __u64 to start at, bits
- * is number of bits per triplet.
- */
-
-#define GB(p,n,s)	gf2k_get_bits(data, p, n, s)
-
-static int gf2k_get_bits(unsigned char *buf, int pos, int num, int shift)
-{
-	__u64 data = 0;
-	int i;
-
-	for (i = 0; i < num / 3 + 2; i++)
-		data |= buf[pos / 3 + i] << (i * 3);
-	data >>= pos % 3;
-	data &= (1 << num) - 1;
-	data <<= shift;
-
-	return data;
-}
-
-static void gf2k_read(struct gf2k *gf2k, unsigned char *data)
-{
-	struct input_dev *dev = gf2k->dev;
-	int i, t;
-
-	for (i = 0; i < 4 && i < gf2k_axes[gf2k->id]; i++)
-		input_report_abs(dev, gf2k_abs[i], GB(i<<3,8,0) | GB(i+46,1,8) | GB(i+50,1,9));
-
-	for (i = 0; i < 2 && i < gf2k_axes[gf2k->id] - 4; i++)
-		input_report_abs(dev, gf2k_abs[i], GB(i*9+60,8,0) | GB(i+54,1,9));
-
-	t = GB(40,4,0);
-
-	for (i = 0; i < gf2k_hats[gf2k->id]; i++)
-		input_report_abs(dev, ABS_HAT0X + i, gf2k_hat_to_axis[t][i]);
-
-	t = GB(44,2,0) | GB(32,8,2) | GB(78,2,10);
-
-	for (i = 0; i < gf2k_joys[gf2k->id]; i++)
-		input_report_key(dev, gf2k_btn_joy[i], (t >> i) & 1);
-
-	for (i = 0; i < gf2k_pads[gf2k->id]; i++)
-		input_report_key(dev, gf2k_btn_pad[i], (t >> i) & 1);
-
-	input_sync(dev);
-}
-
-/*
- * gf2k_poll() reads and analyzes Genius joystick data.
- */
-
-static void gf2k_poll(struct gameport *gameport)
-{
-	struct gf2k *gf2k = gameport_get_drvdata(gameport);
-	unsigned char data[GF2K_LENGTH];
-
-	gf2k->reads++;
-
-	if (gf2k_read_packet(gf2k->gameport, gf2k_length[gf2k->id], data) < gf2k_length[gf2k->id])
-		gf2k->bads++;
-	else
-		gf2k_read(gf2k, data);
-}
-
-static int gf2k_open(struct input_dev *dev)
-{
-	struct gf2k *gf2k = input_get_drvdata(dev);
-
-	gameport_start_polling(gf2k->gameport);
-	return 0;
-}
-
-static void gf2k_close(struct input_dev *dev)
-{
-	struct gf2k *gf2k = input_get_drvdata(dev);
-
-	gameport_stop_polling(gf2k->gameport);
-}
-
-/*
- * gf2k_connect() probes for Genius id joysticks.
- */
-
-static int gf2k_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct gf2k *gf2k;
-	struct input_dev *input_dev;
-	unsigned char data[GF2K_LENGTH];
-	int i, err;
-
-	gf2k = kzalloc(sizeof(struct gf2k), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!gf2k || !input_dev) {
-		err = -ENOMEM;
-		goto fail1;
-	}
-
-	gf2k->gameport = gameport;
-	gf2k->dev = input_dev;
-
-	gameport_set_drvdata(gameport, gf2k);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	gf2k_trigger_seq(gameport, gf2k_seq_reset);
-
-	msleep(GF2K_TIMEOUT);
-
-	gf2k_trigger_seq(gameport, gf2k_seq_digital);
-
-	msleep(GF2K_TIMEOUT);
-
-	if (gf2k_read_packet(gameport, GF2K_LENGTH, data) < 12) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	if (!(gf2k->id = GB(7,2,0) | GB(3,3,2) | GB(0,3,5))) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-#ifdef RESET_WORKS
-	if ((gf2k->id != (GB(19,2,0) | GB(15,3,2) | GB(12,3,5))) &&
-	    (gf2k->id != (GB(31,2,0) | GB(27,3,2) | GB(24,3,5)))) {
-		err = -ENODEV;
-		goto fail2;
-	}
-#else
-	gf2k->id = 6;
-#endif
-
-	if (gf2k->id > GF2K_ID_MAX || !gf2k_axes[gf2k->id]) {
-		printk(KERN_WARNING "gf2k.c: Not yet supported joystick on %s. [id: %d type:%s]\n",
-			gameport->phys, gf2k->id, gf2k->id > GF2K_ID_MAX ? "Unknown" : gf2k_names[gf2k->id]);
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, gf2k_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	snprintf(gf2k->phys, sizeof(gf2k->phys), "%s/input0", gameport->phys);
-
-	gf2k->length = gf2k_lens[gf2k->id];
-
-	input_dev->name = gf2k_names[gf2k->id];
-	input_dev->phys = gf2k->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_GENIUS;
-	input_dev->id.product = gf2k->id;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &gameport->dev;
-
-	input_set_drvdata(input_dev, gf2k);
-
-	input_dev->open = gf2k_open;
-	input_dev->close = gf2k_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (i = 0; i < gf2k_axes[gf2k->id]; i++)
-		set_bit(gf2k_abs[i], input_dev->absbit);
-
-	for (i = 0; i < gf2k_hats[gf2k->id]; i++)
-		input_set_abs_params(input_dev, ABS_HAT0X + i, -1, 1, 0, 0);
-
-	for (i = 0; i < gf2k_joys[gf2k->id]; i++)
-		set_bit(gf2k_btn_joy[i], input_dev->keybit);
-
-	for (i = 0; i < gf2k_pads[gf2k->id]; i++)
-		set_bit(gf2k_btn_pad[i], input_dev->keybit);
-
-	gf2k_read_packet(gameport, gf2k->length, data);
-	gf2k_read(gf2k, data);
-
-	for (i = 0; i < gf2k_axes[gf2k->id]; i++) {
-		int max = i < 2 ?
-			input_abs_get_val(input_dev, gf2k_abs[i]) * 2 :
-			input_abs_get_val(input_dev, gf2k_abs[0]) +
-				input_abs_get_val(input_dev, gf2k_abs[1]);
-		int flat = i < 2 ? 24 : 0;
-
-		input_set_abs_params(input_dev, gf2k_abs[i],
-				     32, max - 32, 8, flat);
-	}
-
-	err = input_register_device(gf2k->dev);
-	if (err)
-		goto fail2;
-
-	return 0;
-
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	input_free_device(input_dev);
-	kfree(gf2k);
-	return err;
-}
-
-static void gf2k_disconnect(struct gameport *gameport)
-{
-	struct gf2k *gf2k = gameport_get_drvdata(gameport);
-
-	input_unregister_device(gf2k->dev);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(gf2k);
-}
-
-static struct gameport_driver gf2k_drv = {
-	.driver		= {
-		.name	= "gf2k",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= gf2k_connect,
-	.disconnect	= gf2k_disconnect,
-};
-
-module_gameport_driver(gf2k_drv);
diff --git a/drivers/input/joystick/grip.c b/drivers/input/joystick/grip.c
deleted file mode 100644
index eac9c5b..0000000
--- a/drivers/input/joystick/grip.c
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- *  Copyright (c) 1998-2001 Vojtech Pavlik
- */
-
-/*
- * Gravis/Kensington GrIP protocol joystick and gamepad driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Gravis GrIP protocol joystick driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define GRIP_MODE_GPP		1
-#define GRIP_MODE_BD		2
-#define GRIP_MODE_XT		3
-#define GRIP_MODE_DC		4
-
-#define GRIP_LENGTH_GPP		24
-#define GRIP_STROBE_GPP		200	/* 200 us */
-#define GRIP_LENGTH_XT		4
-#define GRIP_STROBE_XT		64	/* 64 us */
-#define GRIP_MAX_CHUNKS_XT	10
-#define GRIP_MAX_BITS_XT	30
-
-struct grip {
-	struct gameport *gameport;
-	struct input_dev *dev[2];
-	unsigned char mode[2];
-	int reads;
-	int bads;
-	char phys[2][32];
-};
-
-static int grip_btn_gpp[] = { BTN_START, BTN_SELECT, BTN_TR2, BTN_Y, 0, BTN_TL2, BTN_A, BTN_B, BTN_X, 0, BTN_TL, BTN_TR, -1 };
-static int grip_btn_bd[] = { BTN_THUMB, BTN_THUMB2, BTN_TRIGGER, BTN_TOP, BTN_BASE, -1 };
-static int grip_btn_xt[] = { BTN_TRIGGER, BTN_THUMB, BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_SELECT, BTN_START, BTN_MODE, -1 };
-static int grip_btn_dc[] = { BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_BASE5, -1 };
-
-static int grip_abs_gpp[] = { ABS_X, ABS_Y, -1 };
-static int grip_abs_bd[] = { ABS_X, ABS_Y, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 };
-static int grip_abs_xt[] = { ABS_X, ABS_Y, ABS_BRAKE, ABS_GAS, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y, -1 };
-static int grip_abs_dc[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y, -1 };
-
-static char *grip_name[] = { NULL, "Gravis GamePad Pro", "Gravis Blackhawk Digital",
-				"Gravis Xterminator Digital", "Gravis Xterminator DualControl" };
-static int *grip_abs[] = { NULL, grip_abs_gpp, grip_abs_bd, grip_abs_xt, grip_abs_dc };
-static int *grip_btn[] = { NULL, grip_btn_gpp, grip_btn_bd, grip_btn_xt, grip_btn_dc };
-static char grip_anx[] = { 0, 0, 3, 5, 5 };
-static char grip_cen[] = { 0, 0, 2, 2, 4 };
-
-/*
- * grip_gpp_read_packet() reads a Gravis GamePad Pro packet.
- */
-
-static int grip_gpp_read_packet(struct gameport *gameport, int shift, unsigned int *data)
-{
-	unsigned long flags;
-	unsigned char u, v;
-	unsigned int t;
-	int i;
-
-	int strobe = gameport_time(gameport, GRIP_STROBE_GPP);
-
-	data[0] = 0;
-	t = strobe;
-	i = 0;
-
-	local_irq_save(flags);
-
-	v = gameport_read(gameport) >> shift;
-
-	do {
-		t--;
-		u = v; v = (gameport_read(gameport) >> shift) & 3;
-		if (~v & u & 1) {
-			data[0] |= (v >> 1) << i++;
-			t = strobe;
-		}
-	} while (i < GRIP_LENGTH_GPP && t > 0);
-
-	local_irq_restore(flags);
-
-	if (i < GRIP_LENGTH_GPP) return -1;
-
-	for (i = 0; i < GRIP_LENGTH_GPP && (data[0] & 0xfe4210) ^ 0x7c0000; i++)
-		data[0] = data[0] >> 1 | (data[0] & 1) << (GRIP_LENGTH_GPP - 1);
-
-	return -(i == GRIP_LENGTH_GPP);
-}
-
-/*
- * grip_xt_read_packet() reads a Gravis Xterminator packet.
- */
-
-static int grip_xt_read_packet(struct gameport *gameport, int shift, unsigned int *data)
-{
-	unsigned int i, j, buf, crc;
-	unsigned char u, v, w;
-	unsigned long flags;
-	unsigned int t;
-	char status;
-
-	int strobe = gameport_time(gameport, GRIP_STROBE_XT);
-
-	data[0] = data[1] = data[2] = data[3] = 0;
-	status = buf = i = j = 0;
-	t = strobe;
-
-	local_irq_save(flags);
-
-	v = w = (gameport_read(gameport) >> shift) & 3;
-
-	do {
-		t--;
-		u = (gameport_read(gameport) >> shift) & 3;
-
-		if (u ^ v) {
-
-			if ((u ^ v) & 1) {
-				buf = (buf << 1) | (u >> 1);
-				t = strobe;
-				i++;
-			} else
-
-			if ((((u ^ v) & (v ^ w)) >> 1) & ~(u | v | w) & 1) {
-				if (i == 20) {
-					crc = buf ^ (buf >> 7) ^ (buf >> 14);
-					if (!((crc ^ (0x25cb9e70 >> ((crc >> 2) & 0x1c))) & 0xf)) {
-						data[buf >> 18] = buf >> 4;
-						status |= 1 << (buf >> 18);
-					}
-					j++;
-				}
-				t = strobe;
-				buf = 0;
-				i = 0;
-			}
-			w = v;
-			v = u;
-		}
-
-	} while (status != 0xf && i < GRIP_MAX_BITS_XT && j < GRIP_MAX_CHUNKS_XT && t > 0);
-
-	local_irq_restore(flags);
-
-	return -(status != 0xf);
-}
-
-/*
- * grip_timer() repeatedly polls the joysticks and generates events.
- */
-
-static void grip_poll(struct gameport *gameport)
-{
-	struct grip *grip = gameport_get_drvdata(gameport);
-	unsigned int data[GRIP_LENGTH_XT];
-	struct input_dev *dev;
-	int i, j;
-
-	for (i = 0; i < 2; i++) {
-
-		dev = grip->dev[i];
-		if (!dev)
-			continue;
-
-		grip->reads++;
-
-		switch (grip->mode[i]) {
-
-			case GRIP_MODE_GPP:
-
-				if (grip_gpp_read_packet(grip->gameport, (i << 1) + 4, data)) {
-					grip->bads++;
-					break;
-				}
-
-				input_report_abs(dev, ABS_X, ((*data >> 15) & 1) - ((*data >> 16) & 1));
-				input_report_abs(dev, ABS_Y, ((*data >> 13) & 1) - ((*data >> 12) & 1));
-
-				for (j = 0; j < 12; j++)
-					if (grip_btn_gpp[j])
-						input_report_key(dev, grip_btn_gpp[j], (*data >> j) & 1);
-
-				break;
-
-			case GRIP_MODE_BD:
-
-				if (grip_xt_read_packet(grip->gameport, (i << 1) + 4, data)) {
-					grip->bads++;
-					break;
-				}
-
-				input_report_abs(dev, ABS_X,        (data[0] >> 2) & 0x3f);
-				input_report_abs(dev, ABS_Y,  63 - ((data[0] >> 8) & 0x3f));
-				input_report_abs(dev, ABS_THROTTLE, (data[2] >> 8) & 0x3f);
-
-				input_report_abs(dev, ABS_HAT0X, ((data[2] >> 1) & 1) - ( data[2]       & 1));
-				input_report_abs(dev, ABS_HAT0Y, ((data[2] >> 2) & 1) - ((data[2] >> 3) & 1));
-
-				for (j = 0; j < 5; j++)
-					input_report_key(dev, grip_btn_bd[j], (data[3] >> (j + 4)) & 1);
-
-				break;
-
-			case GRIP_MODE_XT:
-
-				if (grip_xt_read_packet(grip->gameport, (i << 1) + 4, data)) {
-					grip->bads++;
-					break;
-				}
-
-				input_report_abs(dev, ABS_X,        (data[0] >> 2) & 0x3f);
-				input_report_abs(dev, ABS_Y,  63 - ((data[0] >> 8) & 0x3f));
-				input_report_abs(dev, ABS_BRAKE,    (data[1] >> 2) & 0x3f);
-				input_report_abs(dev, ABS_GAS,	    (data[1] >> 8) & 0x3f);
-				input_report_abs(dev, ABS_THROTTLE, (data[2] >> 8) & 0x3f);
-
-				input_report_abs(dev, ABS_HAT0X, ((data[2] >> 1) & 1) - ( data[2]       & 1));
-				input_report_abs(dev, ABS_HAT0Y, ((data[2] >> 2) & 1) - ((data[2] >> 3) & 1));
-				input_report_abs(dev, ABS_HAT1X, ((data[2] >> 5) & 1) - ((data[2] >> 4) & 1));
-				input_report_abs(dev, ABS_HAT1Y, ((data[2] >> 6) & 1) - ((data[2] >> 7) & 1));
-
-				for (j = 0; j < 11; j++)
-					input_report_key(dev, grip_btn_xt[j], (data[3] >> (j + 3)) & 1);
-				break;
-
-			case GRIP_MODE_DC:
-
-				if (grip_xt_read_packet(grip->gameport, (i << 1) + 4, data)) {
-					grip->bads++;
-					break;
-				}
-
-				input_report_abs(dev, ABS_X,        (data[0] >> 2) & 0x3f);
-				input_report_abs(dev, ABS_Y,        (data[0] >> 8) & 0x3f);
-				input_report_abs(dev, ABS_RX,       (data[1] >> 2) & 0x3f);
-				input_report_abs(dev, ABS_RY,	    (data[1] >> 8) & 0x3f);
-				input_report_abs(dev, ABS_THROTTLE, (data[2] >> 8) & 0x3f);
-
-				input_report_abs(dev, ABS_HAT0X, ((data[2] >> 1) & 1) - ( data[2]       & 1));
-				input_report_abs(dev, ABS_HAT0Y, ((data[2] >> 2) & 1) - ((data[2] >> 3) & 1));
-
-				for (j = 0; j < 9; j++)
-					input_report_key(dev, grip_btn_dc[j], (data[3] >> (j + 3)) & 1);
-				break;
-
-
-		}
-
-		input_sync(dev);
-	}
-}
-
-static int grip_open(struct input_dev *dev)
-{
-	struct grip *grip = input_get_drvdata(dev);
-
-	gameport_start_polling(grip->gameport);
-	return 0;
-}
-
-static void grip_close(struct input_dev *dev)
-{
-	struct grip *grip = input_get_drvdata(dev);
-
-	gameport_stop_polling(grip->gameport);
-}
-
-static int grip_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct grip *grip;
-	struct input_dev *input_dev;
-	unsigned int data[GRIP_LENGTH_XT];
-	int i, j, t;
-	int err;
-
-	if (!(grip = kzalloc(sizeof(struct grip), GFP_KERNEL)))
-		return -ENOMEM;
-
-	grip->gameport = gameport;
-
-	gameport_set_drvdata(gameport, grip);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	for (i = 0; i < 2; i++) {
-		if (!grip_gpp_read_packet(gameport, (i << 1) + 4, data)) {
-			grip->mode[i] = GRIP_MODE_GPP;
-			continue;
-		}
-		if (!grip_xt_read_packet(gameport, (i << 1) + 4, data)) {
-			if (!(data[3] & 7)) {
-				grip->mode[i] = GRIP_MODE_BD;
-				continue;
-			}
-			if (!(data[2] & 0xf0)) {
-				grip->mode[i] = GRIP_MODE_XT;
-				continue;
-			}
-			grip->mode[i] = GRIP_MODE_DC;
-			continue;
-		}
-	}
-
-	if (!grip->mode[0] && !grip->mode[1]) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, grip_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	for (i = 0; i < 2; i++) {
-		if (!grip->mode[i])
-			continue;
-
-		grip->dev[i] = input_dev = input_allocate_device();
-		if (!input_dev) {
-			err = -ENOMEM;
-			goto fail3;
-		}
-
-		snprintf(grip->phys[i], sizeof(grip->phys[i]),
-			 "%s/input%d", gameport->phys, i);
-
-		input_dev->name = grip_name[grip->mode[i]];
-		input_dev->phys = grip->phys[i];
-		input_dev->id.bustype = BUS_GAMEPORT;
-		input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS;
-		input_dev->id.product = grip->mode[i];
-		input_dev->id.version = 0x0100;
-		input_dev->dev.parent = &gameport->dev;
-
-		input_set_drvdata(input_dev, grip);
-
-		input_dev->open = grip_open;
-		input_dev->close = grip_close;
-
-		input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-		for (j = 0; (t = grip_abs[grip->mode[i]][j]) >= 0; j++) {
-
-			if (j < grip_cen[grip->mode[i]])
-				input_set_abs_params(input_dev, t, 14, 52, 1, 2);
-			else if (j < grip_anx[grip->mode[i]])
-				input_set_abs_params(input_dev, t, 3, 57, 1, 0);
-			else
-				input_set_abs_params(input_dev, t, -1, 1, 0, 0);
-		}
-
-		for (j = 0; (t = grip_btn[grip->mode[i]][j]) >= 0; j++)
-			if (t > 0)
-				set_bit(t, input_dev->keybit);
-
-		err = input_register_device(grip->dev[i]);
-		if (err)
-			goto fail4;
-	}
-
-	return 0;
-
- fail4:	input_free_device(grip->dev[i]);
- fail3:	while (--i >= 0)
-		if (grip->dev[i])
-			input_unregister_device(grip->dev[i]);
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(grip);
-	return err;
-}
-
-static void grip_disconnect(struct gameport *gameport)
-{
-	struct grip *grip = gameport_get_drvdata(gameport);
-	int i;
-
-	for (i = 0; i < 2; i++)
-		if (grip->dev[i])
-			input_unregister_device(grip->dev[i]);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(grip);
-}
-
-static struct gameport_driver grip_drv = {
-	.driver		= {
-		.name	= "grip",
-		.owner	= THIS_MODULE,
-	},
-	.description	= DRIVER_DESC,
-	.connect	= grip_connect,
-	.disconnect	= grip_disconnect,
-};
-
-module_gameport_driver(grip_drv);
diff --git a/drivers/input/joystick/grip_mp.c b/drivers/input/joystick/grip_mp.c
deleted file mode 100644
index 573191d..0000000
--- a/drivers/input/joystick/grip_mp.c
+++ /dev/null
@@ -1,689 +0,0 @@
-/*
- *  Driver for the Gravis Grip Multiport, a gamepad "hub" that
- *  connects up to four 9-pin digital gamepads/joysticks.
- *  Driver tested on SMP and UP kernel versions 2.4.18-4 and 2.4.18-5.
- *
- *  Thanks to Chris Gassib for helpful advice.
- *
- *  Copyright (c)      2002 Brian Bonnlander, Bill Soudan
- *  Copyright (c) 1998-2000 Vojtech Pavlik
- */
-
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/delay.h>
-#include <linux/proc_fs.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Gravis Grip Multiport driver"
-
-MODULE_AUTHOR("Brian Bonnlander");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#ifdef GRIP_DEBUG
-#define dbg(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" , ## arg)
-#else
-#define dbg(format, arg...) do {} while (0)
-#endif
-
-#define GRIP_MAX_PORTS	4
-/*
- * Grip multiport state
- */
-
-struct grip_port {
-	struct input_dev *dev;
-	int mode;
-	int registered;
-
-	/* individual gamepad states */
-	int buttons;
-	int xaxes;
-	int yaxes;
-	int dirty;     /* has the state been updated? */
-};
-
-struct grip_mp {
-	struct gameport *gameport;
-	struct grip_port *port[GRIP_MAX_PORTS];
-	int reads;
-	int bads;
-};
-
-/*
- * Multiport packet interpretation
- */
-
-#define PACKET_FULL          0x80000000       /* packet is full                        */
-#define PACKET_IO_FAST       0x40000000       /* 3 bits per gameport read              */
-#define PACKET_IO_SLOW       0x20000000       /* 1 bit per gameport read               */
-#define PACKET_MP_MORE       0x04000000       /* multiport wants to send more          */
-#define PACKET_MP_DONE       0x02000000       /* multiport done sending                */
-
-/*
- * Packet status code interpretation
- */
-
-#define IO_GOT_PACKET        0x0100           /* Got a packet                           */
-#define IO_MODE_FAST         0x0200           /* Used 3 data bits per gameport read     */
-#define IO_SLOT_CHANGE       0x0800           /* Multiport physical slot status changed */
-#define IO_DONE              0x1000           /* Multiport is done sending packets      */
-#define IO_RETRY             0x4000           /* Try again later to get packet          */
-#define IO_RESET             0x8000           /* Force multiport to resend all packets  */
-
-/*
- * Gamepad configuration data.  Other 9-pin digital joystick devices
- * may work with the multiport, so this may not be an exhaustive list!
- * Commodore 64 joystick remains untested.
- */
-
-#define GRIP_INIT_DELAY         2000          /*  2 ms */
-
-#define GRIP_MODE_NONE		0
-#define GRIP_MODE_RESET         1
-#define GRIP_MODE_GP		2
-#define GRIP_MODE_C64		3
-
-static const int grip_btn_gp[]  = { BTN_TR, BTN_TL, BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, -1 };
-static const int grip_btn_c64[] = { BTN_JOYSTICK, -1 };
-
-static const int grip_abs_gp[]  = { ABS_X, ABS_Y, -1 };
-static const int grip_abs_c64[] = { ABS_X, ABS_Y, -1 };
-
-static const int *grip_abs[] = { NULL, NULL, grip_abs_gp, grip_abs_c64 };
-static const int *grip_btn[] = { NULL, NULL, grip_btn_gp, grip_btn_c64 };
-
-static const char *grip_name[] = { NULL, NULL, "Gravis Grip Pad", "Commodore 64 Joystick" };
-
-static const int init_seq[] = {
-	1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1,
-	1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1,
-	1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1,
-	0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1 };
-
-/* Maps multiport directional values to X,Y axis values (each axis encoded in 3 bits) */
-
-static const int axis_map[] = { 5, 9, 1, 5, 6, 10, 2, 6, 4, 8, 0, 4, 5, 9, 1, 5 };
-
-static int register_slot(int i, struct grip_mp *grip);
-
-/*
- * Returns whether an odd or even number of bits are on in pkt.
- */
-
-static int bit_parity(u32 pkt)
-{
-	int x = pkt ^ (pkt >> 16);
-	x ^= x >> 8;
-	x ^= x >> 4;
-	x ^= x >> 2;
-	x ^= x >> 1;
-	return x & 1;
-}
-
-/*
- * Poll gameport; return true if all bits set in 'onbits' are on and
- * all bits set in 'offbits' are off.
- */
-
-static inline int poll_until(u8 onbits, u8 offbits, int u_sec, struct gameport* gp, u8 *data)
-{
-	int i, nloops;
-
-	nloops = gameport_time(gp, u_sec);
-	for (i = 0; i < nloops; i++) {
-		*data = gameport_read(gp);
-		if ((*data & onbits) == onbits &&
-		    (~(*data) & offbits) == offbits)
-			return 1;
-	}
-	dbg("gameport timed out after %d microseconds.\n", u_sec);
-	return 0;
-}
-
-/*
- * Gets a 28-bit packet from the multiport.
- *
- * After getting a packet successfully, commands encoded by sendcode may
- * be sent to the multiport.
- *
- * The multiport clock value is reflected in gameport bit B4.
- *
- * Returns a packet status code indicating whether packet is valid, the transfer
- * mode, and any error conditions.
- *
- * sendflags:      current I/O status
- * sendcode:   data to send to the multiport if sendflags is nonzero
- */
-
-static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *packet)
-{
-	u8  raw_data;            /* raw data from gameport */
-	u8  data_mask;           /* packet data bits from raw_data */
-	u32 pkt;                 /* packet temporary storage */
-	int bits_per_read;       /* num packet bits per gameport read */
-	int portvals = 0;        /* used for port value sanity check */
-	int i;
-
-	/* Gameport bits B0, B4, B5 should first be off, then B4 should come on. */
-
-	*packet = 0;
-	raw_data = gameport_read(gameport);
-	if (raw_data & 1)
-		return IO_RETRY;
-
-	for (i = 0; i < 64; i++) {
-		raw_data = gameport_read(gameport);
-		portvals |= 1 << ((raw_data >> 4) & 3); /* Demux B4, B5 */
-	}
-
-	if (portvals == 1) {                            /* B4, B5 off */
-		raw_data = gameport_read(gameport);
-		portvals = raw_data & 0xf0;
-
-		if (raw_data & 0x31)
-			return IO_RESET;
-		gameport_trigger(gameport);
-
-		if (!poll_until(0x10, 0, 308, gameport, &raw_data))
-			return IO_RESET;
-	} else
-		return IO_RETRY;
-
-	/* Determine packet transfer mode and prepare for packet construction. */
-
-	if (raw_data & 0x20) {                 /* 3 data bits/read */
-		portvals |= raw_data >> 4;     /* Compare B4-B7 before & after trigger */
-
-		if (portvals != 0xb)
-			return 0;
-		data_mask = 7;
-		bits_per_read = 3;
-		pkt = (PACKET_FULL | PACKET_IO_FAST) >> 28;
-	} else {                                 /* 1 data bit/read */
-		data_mask = 1;
-		bits_per_read = 1;
-		pkt = (PACKET_FULL | PACKET_IO_SLOW) >> 28;
-	}
-
-	/* Construct a packet.  Final data bits must be zero. */
-
-	while (1) {
-		if (!poll_until(0, 0x10, 77, gameport, &raw_data))
-			return IO_RESET;
-		raw_data = (raw_data >> 5) & data_mask;
-
-		if (pkt & PACKET_FULL)
-			break;
-		pkt = (pkt << bits_per_read) | raw_data;
-
-		if (!poll_until(0x10, 0, 77, gameport, &raw_data))
-			return IO_RESET;
-	}
-
-	if (raw_data)
-		return IO_RESET;
-
-	/* If 3 bits/read used, drop from 30 bits to 28. */
-
-	if (bits_per_read == 3) {
-		pkt = (pkt & 0xffff0000) | ((pkt << 1) & 0xffff);
-		pkt = (pkt >> 2) | 0xf0000000;
-	}
-
-	if (bit_parity(pkt) == 1)
-		return IO_RESET;
-
-	/* Acknowledge packet receipt */
-
-	if (!poll_until(0x30, 0, 77, gameport, &raw_data))
-		return IO_RESET;
-
-	raw_data = gameport_read(gameport);
-
-	if (raw_data & 1)
-		return IO_RESET;
-
-	gameport_trigger(gameport);
-
-	if (!poll_until(0, 0x20, 77, gameport, &raw_data))
-		return IO_RESET;
-
-        /* Return if we just wanted the packet or multiport wants to send more */
-
-	*packet = pkt;
-	if ((sendflags == 0) || ((sendflags & IO_RETRY) && !(pkt & PACKET_MP_DONE)))
-		return IO_GOT_PACKET;
-
-	if (pkt & PACKET_MP_MORE)
-		return IO_GOT_PACKET | IO_RETRY;
-
-	/* Multiport is done sending packets and is ready to receive data */
-
-	if (!poll_until(0x20, 0, 77, gameport, &raw_data))
-		return IO_GOT_PACKET | IO_RESET;
-
-	raw_data = gameport_read(gameport);
-	if (raw_data & 1)
-		return IO_GOT_PACKET | IO_RESET;
-
-	/* Trigger gameport based on bits in sendcode */
-
-	gameport_trigger(gameport);
-	do {
-		if (!poll_until(0x20, 0x10, 116, gameport, &raw_data))
-			return IO_GOT_PACKET | IO_RESET;
-
-		if (!poll_until(0x30, 0, 193, gameport, &raw_data))
-			return IO_GOT_PACKET | IO_RESET;
-
-		if (raw_data & 1)
-			return IO_GOT_PACKET | IO_RESET;
-
-		if (sendcode & 1)
-			gameport_trigger(gameport);
-
-		sendcode >>= 1;
-	} while (sendcode);
-
-	return IO_GOT_PACKET | IO_MODE_FAST;
-}
-
-/*
- * Disables and restores interrupts for mp_io(), which does the actual I/O.
- */
-
-static int multiport_io(struct gameport* gameport, int sendflags, int sendcode, u32 *packet)
-{
-	int status;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	status = mp_io(gameport, sendflags, sendcode, packet);
-	local_irq_restore(flags);
-
-	return status;
-}
-
-/*
- * Puts multiport into digital mode.  Multiport LED turns green.
- *
- * Returns true if a valid digital packet was received, false otherwise.
- */
-
-static int dig_mode_start(struct gameport *gameport, u32 *packet)
-{
-	int i;
-	int flags, tries = 0, bads = 0;
-
-	for (i = 0; i < ARRAY_SIZE(init_seq); i++) {     /* Send magic sequence */
-		if (init_seq[i])
-			gameport_trigger(gameport);
-		udelay(GRIP_INIT_DELAY);
-	}
-
-	for (i = 0; i < 16; i++)            /* Wait for multiport to settle */
-		udelay(GRIP_INIT_DELAY);
-
-	while (tries < 64 && bads < 8) {    /* Reset multiport and try getting a packet */
-
-		flags = multiport_io(gameport, IO_RESET, 0x27, packet);
-
-		if (flags & IO_MODE_FAST)
-			return 1;
-
-		if (flags & IO_RETRY)
-			tries++;
-		else
-			bads++;
-	}
-	return 0;
-}
-
-/*
- * Packet structure: B0-B15   => gamepad state
- *                   B16-B20  => gamepad device type
- *                   B21-B24  => multiport slot index (1-4)
- *
- * Known device types: 0x1f (grip pad), 0x0 (no device).  Others may exist.
- *
- * Returns the packet status.
- */
-
-static int get_and_decode_packet(struct grip_mp *grip, int flags)
-{
-	struct grip_port *port;
-	u32 packet;
-	int joytype = 0;
-	int slot;
-
-	/* Get a packet and check for validity */
-
-	flags &= IO_RESET | IO_RETRY;
-	flags = multiport_io(grip->gameport, flags, 0, &packet);
-	grip->reads++;
-
-	if (packet & PACKET_MP_DONE)
-		flags |= IO_DONE;
-
-	if (flags && !(flags & IO_GOT_PACKET)) {
-		grip->bads++;
-		return flags;
-	}
-
-	/* Ignore non-gamepad packets, e.g. multiport hardware version */
-
-	slot = ((packet >> 21) & 0xf) - 1;
-	if ((slot < 0) || (slot > 3))
-		return flags;
-
-	port = grip->port[slot];
-
-	/*
-	 * Handle "reset" packets, which occur at startup, and when gamepads
-	 * are removed or plugged in.  May contain configuration of a new gamepad.
-	 */
-
-	joytype = (packet >> 16) & 0x1f;
-	if (!joytype) {
-
-		if (port->registered) {
-			printk(KERN_INFO "grip_mp: removing %s, slot %d\n",
-			       grip_name[port->mode], slot);
-			input_unregister_device(port->dev);
-			port->registered = 0;
-		}
-		dbg("Reset: grip multiport slot %d\n", slot);
-		port->mode = GRIP_MODE_RESET;
-		flags |= IO_SLOT_CHANGE;
-		return flags;
-	}
-
-	/* Interpret a grip pad packet */
-
-	if (joytype == 0x1f) {
-
-		int dir = (packet >> 8) & 0xf;          /* eight way directional value */
-		port->buttons = (~packet) & 0xff;
-		port->yaxes = ((axis_map[dir] >> 2) & 3) - 1;
-		port->xaxes = (axis_map[dir] & 3) - 1;
-		port->dirty = 1;
-
-		if (port->mode == GRIP_MODE_RESET)
-			flags |= IO_SLOT_CHANGE;
-
-		port->mode = GRIP_MODE_GP;
-
-		if (!port->registered) {
-			dbg("New Grip pad in multiport slot %d.\n", slot);
-			if (register_slot(slot, grip)) {
-				port->mode = GRIP_MODE_RESET;
-				port->dirty = 0;
-			}
-		}
-		return flags;
-	}
-
-	/* Handle non-grip device codes.  For now, just print diagnostics. */
-
-	{
-		static int strange_code = 0;
-		if (strange_code != joytype) {
-			printk(KERN_INFO "Possible non-grip pad/joystick detected.\n");
-			printk(KERN_INFO "Got joy type 0x%x and packet 0x%x.\n", joytype, packet);
-			strange_code = joytype;
-		}
-	}
-	return flags;
-}
-
-/*
- * Returns true if all multiport slot states appear valid.
- */
-
-static int slots_valid(struct grip_mp *grip)
-{
-	int flags, slot, invalid = 0, active = 0;
-
-	flags = get_and_decode_packet(grip, 0);
-	if (!(flags & IO_GOT_PACKET))
-		return 0;
-
-	for (slot = 0; slot < 4; slot++) {
-		if (grip->port[slot]->mode == GRIP_MODE_RESET)
-			invalid = 1;
-		if (grip->port[slot]->mode != GRIP_MODE_NONE)
-			active = 1;
-	}
-
-	/* Return true if no active slot but multiport sent all its data */
-	if (!active)
-		return (flags & IO_DONE) ? 1 : 0;
-
-	/* Return false if invalid device code received */
-	return invalid ? 0 : 1;
-}
-
-/*
- * Returns whether the multiport was placed into digital mode and
- * able to communicate its state successfully.
- */
-
-static int multiport_init(struct grip_mp *grip)
-{
-	int dig_mode, initialized = 0, tries = 0;
-	u32 packet;
-
-	dig_mode = dig_mode_start(grip->gameport, &packet);
-	while (!dig_mode && tries < 4) {
-		dig_mode = dig_mode_start(grip->gameport, &packet);
-		tries++;
-	}
-
-	if (dig_mode)
-		dbg("multiport_init(): digital mode activated.\n");
-	else {
-		dbg("multiport_init(): unable to activate digital mode.\n");
-		return 0;
-	}
-
-	/* Get packets, store multiport state, and check state's validity */
-	for (tries = 0; tries < 4096; tries++) {
-		if (slots_valid(grip)) {
-			initialized = 1;
-			break;
-		}
-	}
-	dbg("multiport_init(): initialized == %d\n", initialized);
-	return initialized;
-}
-
-/*
- * Reports joystick state to the linux input layer.
- */
-
-static void report_slot(struct grip_mp *grip, int slot)
-{
-	struct grip_port *port = grip->port[slot];
-	int i;
-
-	/* Store button states with linux input driver */
-
-	for (i = 0; i < 8; i++)
-		input_report_key(port->dev, grip_btn_gp[i], (port->buttons >> i) & 1);
-
-	/* Store axis states with linux driver */
-
-	input_report_abs(port->dev, ABS_X, port->xaxes);
-	input_report_abs(port->dev, ABS_Y, port->yaxes);
-
-	/* Tell the receiver of the events to process them */
-
-	input_sync(port->dev);
-
-	port->dirty = 0;
-}
-
-/*
- * Get the multiport state.
- */
-
-static void grip_poll(struct gameport *gameport)
-{
-	struct grip_mp *grip = gameport_get_drvdata(gameport);
-	int i, npkts, flags;
-
-	for (npkts = 0; npkts < 4; npkts++) {
-		flags = IO_RETRY;
-		for (i = 0; i < 32; i++) {
-			flags = get_and_decode_packet(grip, flags);
-			if ((flags & IO_GOT_PACKET) || !(flags & IO_RETRY))
-				break;
-		}
-		if (flags & IO_DONE)
-			break;
-	}
-
-	for (i = 0; i < 4; i++)
-		if (grip->port[i]->dirty)
-			report_slot(grip, i);
-}
-
-/*
- * Called when a joystick device file is opened
- */
-
-static int grip_open(struct input_dev *dev)
-{
-	struct grip_mp *grip = input_get_drvdata(dev);
-
-	gameport_start_polling(grip->gameport);
-	return 0;
-}
-
-/*
- * Called when a joystick device file is closed
- */
-
-static void grip_close(struct input_dev *dev)
-{
-	struct grip_mp *grip = input_get_drvdata(dev);
-
-	gameport_stop_polling(grip->gameport);
-}
-
-/*
- * Tell the linux input layer about a newly plugged-in gamepad.
- */
-
-static int register_slot(int slot, struct grip_mp *grip)
-{
-	struct grip_port *port = grip->port[slot];
-	struct input_dev *input_dev;
-	int j, t;
-	int err;
-
-	port->dev = input_dev = input_allocate_device();
-	if (!input_dev)
-		return -ENOMEM;
-
-	input_dev->name = grip_name[port->mode];
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS;
-	input_dev->id.product = 0x0100 + port->mode;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &grip->gameport->dev;
-
-	input_set_drvdata(input_dev, grip);
-
-	input_dev->open = grip_open;
-	input_dev->close = grip_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (j = 0; (t = grip_abs[port->mode][j]) >= 0; j++)
-		input_set_abs_params(input_dev, t, -1, 1, 0, 0);
-
-	for (j = 0; (t = grip_btn[port->mode][j]) >= 0; j++)
-		if (t > 0)
-			set_bit(t, input_dev->keybit);
-
-	err = input_register_device(port->dev);
-	if (err) {
-		input_free_device(port->dev);
-		return err;
-	}
-
-	port->registered = 1;
-
-	if (port->dirty)	            /* report initial state, if any */
-		report_slot(grip, slot);
-
-	return 0;
-}
-
-static int grip_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct grip_mp *grip;
-	int err;
-
-	if (!(grip = kzalloc(sizeof(struct grip_mp), GFP_KERNEL)))
-		return -ENOMEM;
-
-	grip->gameport = gameport;
-
-	gameport_set_drvdata(gameport, grip);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	gameport_set_poll_handler(gameport, grip_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	if (!multiport_init(grip)) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	if (!grip->port[0]->mode && !grip->port[1]->mode && !grip->port[2]->mode && !grip->port[3]->mode) {
-		/* nothing plugged in */
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	return 0;
-
-fail2:	gameport_close(gameport);
-fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(grip);
-	return err;
-}
-
-static void grip_disconnect(struct gameport *gameport)
-{
-	struct grip_mp *grip = gameport_get_drvdata(gameport);
-	int i;
-
-	for (i = 0; i < 4; i++)
-		if (grip->port[i]->registered)
-			input_unregister_device(grip->port[i]->dev);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(grip);
-}
-
-static struct gameport_driver grip_drv = {
-	.driver		= {
-		.name	= "grip_mp",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= grip_connect,
-	.disconnect	= grip_disconnect,
-};
-
-module_gameport_driver(grip_drv);
diff --git a/drivers/input/joystick/guillemot.c b/drivers/input/joystick/guillemot.c
deleted file mode 100644
index a9ac2f9..0000000
--- a/drivers/input/joystick/guillemot.c
+++ /dev/null
@@ -1,283 +0,0 @@
-/*
- *  Copyright (c) 2001 Vojtech Pavlik
- */
-
-/*
- * Guillemot Digital Interface Protocol driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/delay.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Guillemot Digital joystick driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define GUILLEMOT_MAX_START	600	/* 600 us */
-#define GUILLEMOT_MAX_STROBE	60	/* 60 us */
-#define GUILLEMOT_MAX_LENGTH	17	/* 17 bytes */
-
-static short guillemot_abs_pad[] =
-	{ ABS_X, ABS_Y, ABS_THROTTLE, ABS_RUDDER, -1 };
-
-static short guillemot_btn_pad[] =
-	{ BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_MODE, BTN_SELECT, -1 };
-
-static struct {
-        int x;
-        int y;
-} guillemot_hat_to_axis[16] = {{ 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
-
-struct guillemot_type {
-	unsigned char id;
-	short *abs;
-	short *btn;
-	int hat;
-	char *name;
-};
-
-struct guillemot {
-	struct gameport *gameport;
-	struct input_dev *dev;
-	int bads;
-	int reads;
-	struct guillemot_type *type;
-	unsigned char length;
-	char phys[32];
-};
-
-static struct guillemot_type guillemot_type[] = {
-	{ 0x00, guillemot_abs_pad, guillemot_btn_pad, 1, "Guillemot Pad" },
-	{ 0 }};
-
-/*
- * guillemot_read_packet() reads Guillemot joystick data.
- */
-
-static int guillemot_read_packet(struct gameport *gameport, u8 *data)
-{
-	unsigned long flags;
-	unsigned char u, v;
-	unsigned int t, s;
-	int i;
-
-	for (i = 0; i < GUILLEMOT_MAX_LENGTH; i++)
-		data[i] = 0;
-
-	i = 0;
-	t = gameport_time(gameport, GUILLEMOT_MAX_START);
-	s = gameport_time(gameport, GUILLEMOT_MAX_STROBE);
-
-	local_irq_save(flags);
-	gameport_trigger(gameport);
-	v = gameport_read(gameport);
-
-	while (t > 0 && i < GUILLEMOT_MAX_LENGTH * 8) {
-		t--;
-		u = v; v = gameport_read(gameport);
-		if (v & ~u & 0x10) {
-			data[i >> 3] |= ((v >> 5) & 1) << (i & 7);
-			i++;
-			t = s;
-		}
-	}
-
-	local_irq_restore(flags);
-
-	return i;
-}
-
-/*
- * guillemot_poll() reads and analyzes Guillemot joystick data.
- */
-
-static void guillemot_poll(struct gameport *gameport)
-{
-	struct guillemot *guillemot = gameport_get_drvdata(gameport);
-	struct input_dev *dev = guillemot->dev;
-	u8 data[GUILLEMOT_MAX_LENGTH];
-	int i;
-
-	guillemot->reads++;
-
-	if (guillemot_read_packet(guillemot->gameport, data) != GUILLEMOT_MAX_LENGTH * 8 ||
-		data[0] != 0x55 || data[16] != 0xaa) {
-		guillemot->bads++;
-	} else {
-
-		for (i = 0; i < 6 && guillemot->type->abs[i] >= 0; i++)
-			input_report_abs(dev, guillemot->type->abs[i], data[i + 5]);
-
-		if (guillemot->type->hat) {
-			input_report_abs(dev, ABS_HAT0X, guillemot_hat_to_axis[data[4] >> 4].x);
-			input_report_abs(dev, ABS_HAT0Y, guillemot_hat_to_axis[data[4] >> 4].y);
-		}
-
-		for (i = 0; i < 16 && guillemot->type->btn[i] >= 0; i++)
-			input_report_key(dev, guillemot->type->btn[i], (data[2 + (i >> 3)] >> (i & 7)) & 1);
-	}
-
-	input_sync(dev);
-}
-
-/*
- * guillemot_open() is a callback from the input open routine.
- */
-
-static int guillemot_open(struct input_dev *dev)
-{
-	struct guillemot *guillemot = input_get_drvdata(dev);
-
-	gameport_start_polling(guillemot->gameport);
-	return 0;
-}
-
-/*
- * guillemot_close() is a callback from the input close routine.
- */
-
-static void guillemot_close(struct input_dev *dev)
-{
-	struct guillemot *guillemot = input_get_drvdata(dev);
-
-	gameport_stop_polling(guillemot->gameport);
-}
-
-/*
- * guillemot_connect() probes for Guillemot joysticks.
- */
-
-static int guillemot_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct guillemot *guillemot;
-	struct input_dev *input_dev;
-	u8 data[GUILLEMOT_MAX_LENGTH];
-	int i, t;
-	int err;
-
-	guillemot = kzalloc(sizeof(struct guillemot), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!guillemot || !input_dev) {
-		err = -ENOMEM;
-		goto fail1;
-	}
-
-	guillemot->gameport = gameport;
-	guillemot->dev = input_dev;
-
-	gameport_set_drvdata(gameport, guillemot);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	i = guillemot_read_packet(gameport, data);
-
-	if (i != GUILLEMOT_MAX_LENGTH * 8 || data[0] != 0x55 || data[16] != 0xaa) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	for (i = 0; guillemot_type[i].name; i++)
-		if (guillemot_type[i].id == data[11])
-			break;
-
-	if (!guillemot_type[i].name) {
-		printk(KERN_WARNING "guillemot.c: Unknown joystick on %s. [ %02x%02x:%04x, ver %d.%02d ]\n",
-			gameport->phys, data[12], data[13], data[11], data[14], data[15]);
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, guillemot_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	snprintf(guillemot->phys, sizeof(guillemot->phys), "%s/input0", gameport->phys);
-	guillemot->type = guillemot_type + i;
-
-	input_dev->name = guillemot_type[i].name;
-	input_dev->phys = guillemot->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_GUILLEMOT;
-	input_dev->id.product = guillemot_type[i].id;
-	input_dev->id.version = (int)data[14] << 8 | data[15];
-	input_dev->dev.parent = &gameport->dev;
-
-	input_set_drvdata(input_dev, guillemot);
-
-	input_dev->open = guillemot_open;
-	input_dev->close = guillemot_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (i = 0; (t = guillemot->type->abs[i]) >= 0; i++)
-		input_set_abs_params(input_dev, t, 0, 255, 0, 0);
-
-	if (guillemot->type->hat) {
-		input_set_abs_params(input_dev, ABS_HAT0X, -1, 1, 0, 0);
-		input_set_abs_params(input_dev, ABS_HAT0Y, -1, 1, 0, 0);
-	}
-
-	for (i = 0; (t = guillemot->type->btn[i]) >= 0; i++)
-		set_bit(t, input_dev->keybit);
-
-	err = input_register_device(guillemot->dev);
-	if (err)
-		goto fail2;
-
-	return 0;
-
-fail2:	gameport_close(gameport);
-fail1:  gameport_set_drvdata(gameport, NULL);
-	input_free_device(input_dev);
-	kfree(guillemot);
-	return err;
-}
-
-static void guillemot_disconnect(struct gameport *gameport)
-{
-	struct guillemot *guillemot = gameport_get_drvdata(gameport);
-
-	printk(KERN_INFO "guillemot.c: Failed %d reads out of %d on %s\n", guillemot->reads, guillemot->bads, guillemot->phys);
-	input_unregister_device(guillemot->dev);
-	gameport_close(gameport);
-	kfree(guillemot);
-}
-
-static struct gameport_driver guillemot_drv = {
-	.driver		= {
-		.name	= "guillemot",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= guillemot_connect,
-	.disconnect	= guillemot_disconnect,
-};
-
-module_gameport_driver(guillemot_drv);
diff --git a/drivers/input/joystick/interact.c b/drivers/input/joystick/interact.c
deleted file mode 100644
index 17c2c80..0000000
--- a/drivers/input/joystick/interact.c
+++ /dev/null
@@ -1,313 +0,0 @@
-/*
- *  Copyright (c) 2001 Vojtech Pavlik
- *
- *  Based on the work of:
- *	Toby Deshane
- */
-
-/*
- * InterAct digital gamepad/joystick driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/delay.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"InterAct digital joystick driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define INTERACT_MAX_START	600	/* 400 us */
-#define INTERACT_MAX_STROBE	60	/* 40 us */
-#define INTERACT_MAX_LENGTH	32	/* 32 bits */
-
-#define INTERACT_TYPE_HHFX	0	/* HammerHead/FX */
-#define INTERACT_TYPE_PP8D	1	/* ProPad 8 */
-
-struct interact {
-	struct gameport *gameport;
-	struct input_dev *dev;
-	int bads;
-	int reads;
-	unsigned char type;
-	unsigned char length;
-	char phys[32];
-};
-
-static short interact_abs_hhfx[] =
-	{ ABS_RX, ABS_RY, ABS_X, ABS_Y, ABS_HAT0X, ABS_HAT0Y, -1 };
-static short interact_abs_pp8d[] =
-	{ ABS_X, ABS_Y, -1 };
-
-static short interact_btn_hhfx[] =
-	{ BTN_TR, BTN_X, BTN_Y, BTN_Z, BTN_A, BTN_B, BTN_C, BTN_TL, BTN_TL2, BTN_TR2, BTN_MODE, BTN_SELECT, -1 };
-static short interact_btn_pp8d[] =
-	{ BTN_C, BTN_TL, BTN_TR, BTN_A, BTN_B, BTN_Y, BTN_Z, BTN_X, -1 };
-
-struct interact_type {
-	int id;
-	short *abs;
-	short *btn;
-	char *name;
-	unsigned char length;
-	unsigned char b8;
-};
-
-static struct interact_type interact_type[] = {
-	{ 0x6202, interact_abs_hhfx, interact_btn_hhfx, "InterAct HammerHead/FX",    32, 4 },
-	{ 0x53f8, interact_abs_pp8d, interact_btn_pp8d, "InterAct ProPad 8 Digital", 16, 0 },
-	{ 0 }};
-
-/*
- * interact_read_packet() reads and InterAct joystick data.
- */
-
-static int interact_read_packet(struct gameport *gameport, int length, u32 *data)
-{
-	unsigned long flags;
-	unsigned char u, v;
-	unsigned int t, s;
-	int i;
-
-	i = 0;
-	data[0] = data[1] = data[2] = 0;
-	t = gameport_time(gameport, INTERACT_MAX_START);
-	s = gameport_time(gameport, INTERACT_MAX_STROBE);
-
-	local_irq_save(flags);
-	gameport_trigger(gameport);
-	v = gameport_read(gameport);
-
-	while (t > 0 && i < length) {
-		t--;
-		u = v; v = gameport_read(gameport);
-		if (v & ~u & 0x40) {
-			data[0] = (data[0] << 1) | ((v >> 4) & 1);
-			data[1] = (data[1] << 1) | ((v >> 5) & 1);
-			data[2] = (data[2] << 1) | ((v >> 7) & 1);
-			i++;
-			t = s;
-		}
-	}
-
-	local_irq_restore(flags);
-
-	return i;
-}
-
-/*
- * interact_poll() reads and analyzes InterAct joystick data.
- */
-
-static void interact_poll(struct gameport *gameport)
-{
-	struct interact *interact = gameport_get_drvdata(gameport);
-	struct input_dev *dev = interact->dev;
-	u32 data[3];
-	int i;
-
-	interact->reads++;
-
-	if (interact_read_packet(interact->gameport, interact->length, data) < interact->length) {
-		interact->bads++;
-	} else {
-
-		for (i = 0; i < 3; i++)
-			data[i] <<= INTERACT_MAX_LENGTH - interact->length;
-
-		switch (interact->type) {
-
-			case INTERACT_TYPE_HHFX:
-
-				for (i = 0; i < 4; i++)
-					input_report_abs(dev, interact_abs_hhfx[i], (data[i & 1] >> ((i >> 1) << 3)) & 0xff);
-
-				for (i = 0; i < 2; i++)
-					input_report_abs(dev, ABS_HAT0Y - i,
-						((data[1] >> ((i << 1) + 17)) & 1)  - ((data[1] >> ((i << 1) + 16)) & 1));
-
-				for (i = 0; i < 8; i++)
-					input_report_key(dev, interact_btn_hhfx[i], (data[0] >> (i + 16)) & 1);
-
-				for (i = 0; i < 4; i++)
-					input_report_key(dev, interact_btn_hhfx[i + 8], (data[1] >> (i + 20)) & 1);
-
-				break;
-
-			case INTERACT_TYPE_PP8D:
-
-				for (i = 0; i < 2; i++)
-					input_report_abs(dev, interact_abs_pp8d[i],
-						((data[0] >> ((i << 1) + 20)) & 1)  - ((data[0] >> ((i << 1) + 21)) & 1));
-
-				for (i = 0; i < 8; i++)
-					input_report_key(dev, interact_btn_pp8d[i], (data[1] >> (i + 16)) & 1);
-
-				break;
-		}
-	}
-
-	input_sync(dev);
-}
-
-/*
- * interact_open() is a callback from the input open routine.
- */
-
-static int interact_open(struct input_dev *dev)
-{
-	struct interact *interact = input_get_drvdata(dev);
-
-	gameport_start_polling(interact->gameport);
-	return 0;
-}
-
-/*
- * interact_close() is a callback from the input close routine.
- */
-
-static void interact_close(struct input_dev *dev)
-{
-	struct interact *interact = input_get_drvdata(dev);
-
-	gameport_stop_polling(interact->gameport);
-}
-
-/*
- * interact_connect() probes for InterAct joysticks.
- */
-
-static int interact_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct interact *interact;
-	struct input_dev *input_dev;
-	__u32 data[3];
-	int i, t;
-	int err;
-
-	interact = kzalloc(sizeof(struct interact), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!interact || !input_dev) {
-		err = -ENOMEM;
-		goto fail1;
-	}
-
-	interact->gameport = gameport;
-	interact->dev = input_dev;
-
-	gameport_set_drvdata(gameport, interact);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	i = interact_read_packet(gameport, INTERACT_MAX_LENGTH * 2, data);
-
-	if (i != 32 || (data[0] >> 24) != 0x0c || (data[1] >> 24) != 0x02) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	for (i = 0; interact_type[i].length; i++)
-		if (interact_type[i].id == (data[2] >> 16))
-			break;
-
-	if (!interact_type[i].length) {
-		printk(KERN_WARNING "interact.c: Unknown joystick on %s. [len %d d0 %08x d1 %08x i2 %08x]\n",
-			gameport->phys, i, data[0], data[1], data[2]);
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, interact_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	snprintf(interact->phys, sizeof(interact->phys), "%s/input0", gameport->phys);
-
-	interact->type = i;
-	interact->length = interact_type[i].length;
-
-	input_dev->name = interact_type[i].name;
-	input_dev->phys = interact->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_INTERACT;
-	input_dev->id.product = interact_type[i].id;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &gameport->dev;
-
-	input_set_drvdata(input_dev, interact);
-
-	input_dev->open = interact_open;
-	input_dev->close = interact_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (i = 0; (t = interact_type[interact->type].abs[i]) >= 0; i++) {
-		if (i < interact_type[interact->type].b8)
-			input_set_abs_params(input_dev, t, 0, 255, 0, 0);
-		else
-			input_set_abs_params(input_dev, t, -1, 1, 0, 0);
-	}
-
-	for (i = 0; (t = interact_type[interact->type].btn[i]) >= 0; i++)
-		__set_bit(t, input_dev->keybit);
-
-	err = input_register_device(interact->dev);
-	if (err)
-		goto fail2;
-
-	return 0;
-
-fail2:	gameport_close(gameport);
-fail1:  gameport_set_drvdata(gameport, NULL);
-	input_free_device(input_dev);
-	kfree(interact);
-	return err;
-}
-
-static void interact_disconnect(struct gameport *gameport)
-{
-	struct interact *interact = gameport_get_drvdata(gameport);
-
-	input_unregister_device(interact->dev);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(interact);
-}
-
-static struct gameport_driver interact_drv = {
-	.driver		= {
-		.name	= "interact",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= interact_connect,
-	.disconnect	= interact_disconnect,
-};
-
-module_gameport_driver(interact_drv);
diff --git a/drivers/input/joystick/joydump.c b/drivers/input/joystick/joydump.c
deleted file mode 100644
index d1c6e48..0000000
--- a/drivers/input/joystick/joydump.c
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- *  Copyright (c) 1996-2001 Vojtech Pavlik
- */
-
-/*
- * This is just a very simple driver that can dump the data
- * out of the joystick port into the syslog ...
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/module.h>
-#include <linux/gameport.h>
-#include <linux/kernel.h>
-#include <linux/delay.h>
-#include <linux/slab.h>
-
-#define DRIVER_DESC	"Gameport data dumper module"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define BUF_SIZE 256
-
-struct joydump {
-	unsigned int time;
-	unsigned char data;
-};
-
-static int joydump_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct joydump *buf;	/* all entries */
-	struct joydump *dump, *prev;	/* one entry each */
-	int axes[4], buttons;
-	int i, j, t, timeout;
-	unsigned long flags;
-	unsigned char u;
-
-	printk(KERN_INFO "joydump: ,------------------ START ----------------.\n");
-	printk(KERN_INFO "joydump: | Dumping: %30s |\n", gameport->phys);
-	printk(KERN_INFO "joydump: | Speed: %28d kHz |\n", gameport->speed);
-
-	if (gameport_open(gameport, drv, GAMEPORT_MODE_RAW)) {
-
-		printk(KERN_INFO "joydump: | Raw mode not available - trying cooked.    |\n");
-
-		if (gameport_open(gameport, drv, GAMEPORT_MODE_COOKED)) {
-
-			printk(KERN_INFO "joydump: | Cooked not available either. Failing.   |\n");
-			printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
-			return -ENODEV;
-		}
-
-		gameport_cooked_read(gameport, axes, &buttons);
-
-		for (i = 0; i < 4; i++)
-			printk(KERN_INFO "joydump: | Axis %d: %4d.                           |\n", i, axes[i]);
-		printk(KERN_INFO "joydump: | Buttons %02x.                             |\n", buttons);
-		printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
-	}
-
-	timeout = gameport_time(gameport, 10000); /* 10 ms */
-
-	buf = kmalloc(BUF_SIZE * sizeof(struct joydump), GFP_KERNEL);
-	if (!buf) {
-		printk(KERN_INFO "joydump: no memory for testing\n");
-		goto jd_end;
-	}
-	dump = buf;
-	t = 0;
-	i = 1;
-
-	local_irq_save(flags);
-
-	u = gameport_read(gameport);
-
-	dump->data = u;
-	dump->time = t;
-	dump++;
-
-	gameport_trigger(gameport);
-
-	while (i < BUF_SIZE && t < timeout) {
-
-		dump->data = gameport_read(gameport);
-
-		if (dump->data ^ u) {
-			u = dump->data;
-			dump->time = t;
-			i++;
-			dump++;
-		}
-		t++;
-	}
-
-	local_irq_restore(flags);
-
-/*
- * Dump data.
- */
-
-	t = i;
-	dump = buf;
-	prev = dump;
-
-	printk(KERN_INFO "joydump: >------------------ DATA -----------------<\n");
-	printk(KERN_INFO "joydump: | index: %3d delta: %3d us data: ", 0, 0);
-	for (j = 7; j >= 0; j--)
-		printk("%d", (dump->data >> j) & 1);
-	printk(" |\n");
-	dump++;
-
-	for (i = 1; i < t; i++, dump++, prev++) {
-		printk(KERN_INFO "joydump: | index: %3d delta: %3d us data: ",
-			i, dump->time - prev->time);
-		for (j = 7; j >= 0; j--)
-			printk("%d", (dump->data >> j) & 1);
-		printk(" |\n");
-	}
-	kfree(buf);
-
-jd_end:
-	printk(KERN_INFO "joydump: `------------------- END -----------------'\n");
-
-	return 0;
-}
-
-static void joydump_disconnect(struct gameport *gameport)
-{
-	gameport_close(gameport);
-}
-
-static struct gameport_driver joydump_drv = {
-	.driver		= {
-		.name	= "joydump",
-	},
-	.description	= DRIVER_DESC,
-	.connect	= joydump_connect,
-	.disconnect	= joydump_disconnect,
-};
-
-module_gameport_driver(joydump_drv);
diff --git a/drivers/input/joystick/sidewinder.c b/drivers/input/joystick/sidewinder.c
deleted file mode 100644
index 4a95b22..0000000
--- a/drivers/input/joystick/sidewinder.c
+++ /dev/null
@@ -1,822 +0,0 @@
-/*
- *  Copyright (c) 1998-2005 Vojtech Pavlik
- */
-
-/*
- * Microsoft SideWinder joystick family driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/slab.h>
-#include <linux/input.h>
-#include <linux/gameport.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"Microsoft SideWinder joystick family driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-/*
- * These are really magic values. Changing them can make a problem go away,
- * as well as break everything.
- */
-
-#undef SW_DEBUG
-#undef SW_DEBUG_DATA
-
-#define SW_START	600	/* The time we wait for the first bit [600 us] */
-#define SW_STROBE	60	/* Max time per bit [60 us] */
-#define SW_TIMEOUT	6	/* Wait for everything to settle [6 ms] */
-#define SW_KICK		45	/* Wait after A0 fall till kick [45 us] */
-#define SW_END		8	/* Number of bits before end of packet to kick */
-#define SW_FAIL		16	/* Number of packet read errors to fail and reinitialize */
-#define SW_BAD		2	/* Number of packet read errors to switch off 3d Pro optimization */
-#define SW_OK		64	/* Number of packet read successes to switch optimization back on */
-#define SW_LENGTH	512	/* Max number of bits in a packet */
-
-#ifdef SW_DEBUG
-#define dbg(format, arg...) printk(KERN_DEBUG __FILE__ ": " format "\n" , ## arg)
-#else
-#define dbg(format, arg...) do {} while (0)
-#endif
-
-/*
- * SideWinder joystick types ...
- */
-
-#define SW_ID_3DP	0
-#define SW_ID_GP	1
-#define SW_ID_PP	2
-#define SW_ID_FFP	3
-#define SW_ID_FSP	4
-#define SW_ID_FFW	5
-
-/*
- * Names, buttons, axes ...
- */
-
-static char *sw_name[] = {	"3D Pro", "GamePad", "Precision Pro", "Force Feedback Pro", "FreeStyle Pro",
-				"Force Feedback Wheel" };
-
-static char sw_abs[][7] = {
-	{ ABS_X, ABS_Y, ABS_RZ, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y },
-	{ ABS_X, ABS_Y },
-	{ ABS_X, ABS_Y, ABS_RZ, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y },
-	{ ABS_X, ABS_Y, ABS_RZ, ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y },
-	{ ABS_X, ABS_Y,         ABS_THROTTLE, ABS_HAT0X, ABS_HAT0Y },
-	{ ABS_RX, ABS_RUDDER,   ABS_THROTTLE }};
-
-static char sw_bit[][7] = {
-	{ 10, 10,  9, 10,  1,  1 },
-	{  1,  1                 },
-	{ 10, 10,  6,  7,  1,  1 },
-	{ 10, 10,  6,  7,  1,  1 },
-	{ 10, 10,  6,  1,  1     },
-	{ 10,  7,  7,  1,  1     }};
-
-static short sw_btn[][12] = {
-	{ BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_THUMB2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_MODE },
-	{ BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_START, BTN_MODE },
-	{ BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_SELECT },
-	{ BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4, BTN_SELECT },
-	{ BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_TL, BTN_TR, BTN_START, BTN_MODE, BTN_SELECT },
-	{ BTN_TRIGGER, BTN_TOP, BTN_THUMB, BTN_THUMB2, BTN_BASE, BTN_BASE2, BTN_BASE3, BTN_BASE4 }};
-
-static struct {
-	int x;
-	int y;
-} sw_hat_to_axis[] = {{ 0, 0}, { 0,-1}, { 1,-1}, { 1, 0}, { 1, 1}, { 0, 1}, {-1, 1}, {-1, 0}, {-1,-1}};
-
-struct sw {
-	struct gameport *gameport;
-	struct input_dev *dev[4];
-	char name[64];
-	char phys[4][32];
-	int length;
-	int type;
-	int bits;
-	int number;
-	int fail;
-	int ok;
-	int reads;
-	int bads;
-};
-
-/*
- * sw_read_packet() is a function which reads either a data packet, or an
- * identification packet from a SideWinder joystick. The protocol is very,
- * very, very braindamaged. Microsoft patented it in US patent #5628686.
- */
-
-static int sw_read_packet(struct gameport *gameport, unsigned char *buf, int length, int id)
-{
-	unsigned long flags;
-	int timeout, bitout, sched, i, kick, start, strobe;
-	unsigned char pending, u, v;
-
-	i = -id;						/* Don't care about data, only want ID */
-	timeout = id ? gameport_time(gameport, SW_TIMEOUT * 1000) : 0; /* Set up global timeout for ID packet */
-	kick = id ? gameport_time(gameport, SW_KICK) : 0;	/* Set up kick timeout for ID packet */
-	start = gameport_time(gameport, SW_START);
-	strobe = gameport_time(gameport, SW_STROBE);
-	bitout = start;
-	pending = 0;
-	sched = 0;
-
-        local_irq_save(flags);					/* Quiet, please */
-
-	gameport_trigger(gameport);				/* Trigger */
-	v = gameport_read(gameport);
-
-	do {
-		bitout--;
-		u = v;
-		v = gameport_read(gameport);
-	} while (!(~v & u & 0x10) && (bitout > 0));		/* Wait for first falling edge on clock */
-
-	if (bitout > 0)
-		bitout = strobe;				/* Extend time if not timed out */
-
-	while ((timeout > 0 || bitout > 0) && (i < length)) {
-
-		timeout--;
-		bitout--;					/* Decrement timers */
-		sched--;
-
-		u = v;
-		v = gameport_read(gameport);
-
-		if ((~u & v & 0x10) && (bitout > 0)) {		/* Rising edge on clock - data bit */
-			if (i >= 0)				/* Want this data */
-				buf[i] = v >> 5;		/* Store it */
-			i++;					/* Advance index */
-			bitout = strobe;			/* Extend timeout for next bit */
-		}
-
-		if (kick && (~v & u & 0x01)) {			/* Falling edge on axis 0 */
-			sched = kick;				/* Schedule second trigger */
-			kick = 0;				/* Don't schedule next time on falling edge */
-			pending = 1;				/* Mark schedule */
-		}
-
-		if (pending && sched < 0 && (i > -SW_END)) {	/* Second trigger time */
-			gameport_trigger(gameport);		/* Trigger */
-			bitout = start;				/* Long bit timeout */
-			pending = 0;				/* Unmark schedule */
-			timeout = 0;				/* Switch from global to bit timeouts */
-		}
-	}
-
-	local_irq_restore(flags);					/* Done - relax */
-
-#ifdef SW_DEBUG_DATA
-	{
-		int j;
-		printk(KERN_DEBUG "sidewinder.c: Read %d triplets. [", i);
-		for (j = 0; j < i; j++) printk("%d", buf[j]);
-		printk("]\n");
-	}
-#endif
-
-	return i;
-}
-
-/*
- * sw_get_bits() and GB() compose bits from the triplet buffer into a __u64.
- * Parameter 'pos' is bit number inside packet where to start at, 'num' is number
- * of bits to be read, 'shift' is offset in the resulting __u64 to start at, bits
- * is number of bits per triplet.
- */
-
-#define GB(pos,num) sw_get_bits(buf, pos, num, sw->bits)
-
-static __u64 sw_get_bits(unsigned char *buf, int pos, int num, char bits)
-{
-	__u64 data = 0;
-	int tri = pos % bits;						/* Start position */
-	int i   = pos / bits;
-	int bit = 0;
-
-	while (num--) {
-		data |= (__u64)((buf[i] >> tri++) & 1) << bit++;	/* Transfer bit */
-		if (tri == bits) {
-			i++;						/* Next triplet */
-			tri = 0;
-		}
-	}
-
-	return data;
-}
-
-/*
- * sw_init_digital() initializes a SideWinder 3D Pro joystick
- * into digital mode.
- */
-
-static void sw_init_digital(struct gameport *gameport)
-{
-	int seq[] = { 140, 140+725, 140+300, 0 };
-	unsigned long flags;
-	int i, t;
-
-        local_irq_save(flags);
-
-	i = 0;
-        do {
-                gameport_trigger(gameport);			/* Trigger */
-		t = gameport_time(gameport, SW_TIMEOUT * 1000);
-		while ((gameport_read(gameport) & 1) && t) t--;	/* Wait for axis to fall back to 0 */
-                udelay(seq[i]);					/* Delay magic time */
-        } while (seq[++i]);
-
-	gameport_trigger(gameport);				/* Last trigger */
-
-	local_irq_restore(flags);
-}
-
-/*
- * sw_parity() computes parity of __u64
- */
-
-static int sw_parity(__u64 t)
-{
-	int x = t ^ (t >> 32);
-
-	x ^= x >> 16;
-	x ^= x >> 8;
-	x ^= x >> 4;
-	x ^= x >> 2;
-	x ^= x >> 1;
-	return x & 1;
-}
-
-/*
- * sw_ccheck() checks synchronization bits and computes checksum of nibbles.
- */
-
-static int sw_check(__u64 t)
-{
-	unsigned char sum = 0;
-
-	if ((t & 0x8080808080808080ULL) ^ 0x80)			/* Sync */
-		return -1;
-
-	while (t) {						/* Sum */
-		sum += t & 0xf;
-		t >>= 4;
-	}
-
-	return sum & 0xf;
-}
-
-/*
- * sw_parse() analyzes SideWinder joystick data, and writes the results into
- * the axes and buttons arrays.
- */
-
-static int sw_parse(unsigned char *buf, struct sw *sw)
-{
-	int hat, i, j;
-	struct input_dev *dev;
-
-	switch (sw->type) {
-
-		case SW_ID_3DP:
-
-			if (sw_check(GB(0,64)) || (hat = (GB(6,1) << 3) | GB(60,3)) > 8)
-				return -1;
-
-			dev = sw->dev[0];
-
-			input_report_abs(dev, ABS_X,        (GB( 3,3) << 7) | GB(16,7));
-			input_report_abs(dev, ABS_Y,        (GB( 0,3) << 7) | GB(24,7));
-			input_report_abs(dev, ABS_RZ,       (GB(35,2) << 7) | GB(40,7));
-			input_report_abs(dev, ABS_THROTTLE, (GB(32,3) << 7) | GB(48,7));
-
-			input_report_abs(dev, ABS_HAT0X, sw_hat_to_axis[hat].x);
-			input_report_abs(dev, ABS_HAT0Y, sw_hat_to_axis[hat].y);
-
-			for (j = 0; j < 7; j++)
-				input_report_key(dev, sw_btn[SW_ID_3DP][j], !GB(j+8,1));
-
-			input_report_key(dev, BTN_BASE4, !GB(38,1));
-			input_report_key(dev, BTN_BASE5, !GB(37,1));
-
-			input_sync(dev);
-
-			return 0;
-
-		case SW_ID_GP:
-
-			for (i = 0; i < sw->number; i ++) {
-
-				if (sw_parity(GB(i*15,15)))
-					return -1;
-
-				input_report_abs(sw->dev[i], ABS_X, GB(i*15+3,1) - GB(i*15+2,1));
-				input_report_abs(sw->dev[i], ABS_Y, GB(i*15+0,1) - GB(i*15+1,1));
-
-				for (j = 0; j < 10; j++)
-					input_report_key(sw->dev[i], sw_btn[SW_ID_GP][j], !GB(i*15+j+4,1));
-
-				input_sync(sw->dev[i]);
-			}
-
-			return 0;
-
-		case SW_ID_PP:
-		case SW_ID_FFP:
-
-			if (!sw_parity(GB(0,48)) || (hat = GB(42,4)) > 8)
-				return -1;
-
-			dev = sw->dev[0];
-			input_report_abs(dev, ABS_X,        GB( 9,10));
-			input_report_abs(dev, ABS_Y,        GB(19,10));
-			input_report_abs(dev, ABS_RZ,       GB(36, 6));
-			input_report_abs(dev, ABS_THROTTLE, GB(29, 7));
-
-			input_report_abs(dev, ABS_HAT0X, sw_hat_to_axis[hat].x);
-			input_report_abs(dev, ABS_HAT0Y, sw_hat_to_axis[hat].y);
-
-			for (j = 0; j < 9; j++)
-				input_report_key(dev, sw_btn[SW_ID_PP][j], !GB(j,1));
-
-			input_sync(dev);
-
-			return 0;
-
-		case SW_ID_FSP:
-
-			if (!sw_parity(GB(0,43)) || (hat = GB(28,4)) > 8)
-				return -1;
-
-			dev = sw->dev[0];
-			input_report_abs(dev, ABS_X,        GB( 0,10));
-			input_report_abs(dev, ABS_Y,        GB(16,10));
-			input_report_abs(dev, ABS_THROTTLE, GB(32, 6));
-
-			input_report_abs(dev, ABS_HAT0X, sw_hat_to_axis[hat].x);
-			input_report_abs(dev, ABS_HAT0Y, sw_hat_to_axis[hat].y);
-
-			for (j = 0; j < 6; j++)
-				input_report_key(dev, sw_btn[SW_ID_FSP][j], !GB(j+10,1));
-
-			input_report_key(dev, BTN_TR,     !GB(26,1));
-			input_report_key(dev, BTN_START,  !GB(27,1));
-			input_report_key(dev, BTN_MODE,   !GB(38,1));
-			input_report_key(dev, BTN_SELECT, !GB(39,1));
-
-			input_sync(dev);
-
-			return 0;
-
-		case SW_ID_FFW:
-
-			if (!sw_parity(GB(0,33)))
-				return -1;
-
-			dev = sw->dev[0];
-			input_report_abs(dev, ABS_RX,       GB( 0,10));
-			input_report_abs(dev, ABS_RUDDER,   GB(10, 6));
-			input_report_abs(dev, ABS_THROTTLE, GB(16, 6));
-
-			for (j = 0; j < 8; j++)
-				input_report_key(dev, sw_btn[SW_ID_FFW][j], !GB(j+22,1));
-
-			input_sync(dev);
-
-			return 0;
-	}
-
-	return -1;
-}
-
-/*
- * sw_read() reads SideWinder joystick data, and reinitializes
- * the joystick in case of persistent problems. This is the function that is
- * called from the generic code to poll the joystick.
- */
-
-static int sw_read(struct sw *sw)
-{
-	unsigned char buf[SW_LENGTH];
-	int i;
-
-	i = sw_read_packet(sw->gameport, buf, sw->length, 0);
-
-	if (sw->type == SW_ID_3DP && sw->length == 66 && i != 66) {		/* Broken packet, try to fix */
-
-		if (i == 64 && !sw_check(sw_get_bits(buf,0,64,1))) {		/* Last init failed, 1 bit mode */
-			printk(KERN_WARNING "sidewinder.c: Joystick in wrong mode on %s"
-				" - going to reinitialize.\n", sw->gameport->phys);
-			sw->fail = SW_FAIL;					/* Reinitialize */
-			i = 128;						/* Bogus value */
-		}
-
-		if (i < 66 && GB(0,64) == GB(i*3-66,64))			/* 1 == 3 */
-			i = 66;							/* Everything is fine */
-
-		if (i < 66 && GB(0,64) == GB(66,64))				/* 1 == 2 */
-			i = 66;							/* Everything is fine */
-
-		if (i < 66 && GB(i*3-132,64) == GB(i*3-66,64)) {		/* 2 == 3 */
-			memmove(buf, buf + i - 22, 22);				/* Move data */
-			i = 66;							/* Carry on */
-		}
-	}
-
-	if (i == sw->length && !sw_parse(buf, sw)) {				/* Parse data */
-
-		sw->fail = 0;
-		sw->ok++;
-
-		if (sw->type == SW_ID_3DP && sw->length == 66			/* Many packets OK */
-			&& sw->ok > SW_OK) {
-
-			printk(KERN_INFO "sidewinder.c: No more trouble on %s"
-				" - enabling optimization again.\n", sw->gameport->phys);
-			sw->length = 22;
-		}
-
-		return 0;
-	}
-
-	sw->ok = 0;
-	sw->fail++;
-
-	if (sw->type == SW_ID_3DP && sw->length == 22 && sw->fail > SW_BAD) {	/* Consecutive bad packets */
-
-		printk(KERN_INFO "sidewinder.c: Many bit errors on %s"
-			" - disabling optimization.\n", sw->gameport->phys);
-		sw->length = 66;
-	}
-
-	if (sw->fail < SW_FAIL)
-		return -1;							/* Not enough, don't reinitialize yet */
-
-	printk(KERN_WARNING "sidewinder.c: Too many bit errors on %s"
-		" - reinitializing joystick.\n", sw->gameport->phys);
-
-	if (!i && sw->type == SW_ID_3DP) {					/* 3D Pro can be in analog mode */
-		mdelay(3 * SW_TIMEOUT);
-		sw_init_digital(sw->gameport);
-	}
-
-	mdelay(SW_TIMEOUT);
-	i = sw_read_packet(sw->gameport, buf, SW_LENGTH, 0);			/* Read normal data packet */
-	mdelay(SW_TIMEOUT);
-	sw_read_packet(sw->gameport, buf, SW_LENGTH, i);			/* Read ID packet, this initializes the stick */
-
-	sw->fail = SW_FAIL;
-
-	return -1;
-}
-
-static void sw_poll(struct gameport *gameport)
-{
-	struct sw *sw = gameport_get_drvdata(gameport);
-
-	sw->reads++;
-	if (sw_read(sw))
-		sw->bads++;
-}
-
-static int sw_open(struct input_dev *dev)
-{
-	struct sw *sw = input_get_drvdata(dev);
-
-	gameport_start_polling(sw->gameport);
-	return 0;
-}
-
-static void sw_close(struct input_dev *dev)
-{
-	struct sw *sw = input_get_drvdata(dev);
-
-	gameport_stop_polling(sw->gameport);
-}
-
-/*
- * sw_print_packet() prints the contents of a SideWinder packet.
- */
-
-static void sw_print_packet(char *name, int length, unsigned char *buf, char bits)
-{
-	int i;
-
-	printk(KERN_INFO "sidewinder.c: %s packet, %d bits. [", name, length);
-	for (i = (((length + 3) >> 2) - 1); i >= 0; i--)
-		printk("%x", (int)sw_get_bits(buf, i << 2, 4, bits));
-	printk("]\n");
-}
-
-/*
- * sw_3dp_id() translates the 3DP id into a human legible string.
- * Unfortunately I don't know how to do this for the other SW types.
- */
-
-static void sw_3dp_id(unsigned char *buf, char *comment, size_t size)
-{
-	int i;
-	char pnp[8], rev[9];
-
-	for (i = 0; i < 7; i++)						/* ASCII PnP ID */
-		pnp[i] = sw_get_bits(buf, 24+8*i, 8, 1);
-
-	for (i = 0; i < 8; i++)						/* ASCII firmware revision */
-		rev[i] = sw_get_bits(buf, 88+8*i, 8, 1);
-
-	pnp[7] = rev[8] = 0;
-
-	snprintf(comment, size, " [PnP %d.%02d id %s rev %s]",
-		(int) ((sw_get_bits(buf, 8, 6, 1) << 6) |		/* Two 6-bit values */
-			sw_get_bits(buf, 16, 6, 1)) / 100,
-		(int) ((sw_get_bits(buf, 8, 6, 1) << 6) |
-			sw_get_bits(buf, 16, 6, 1)) % 100,
-		 pnp, rev);
-}
-
-/*
- * sw_guess_mode() checks the upper two button bits for toggling -
- * indication of that the joystick is in 3-bit mode. This is documented
- * behavior for 3DP ID packet, and for example the FSP does this in
- * normal packets instead. Fun ...
- */
-
-static int sw_guess_mode(unsigned char *buf, int len)
-{
-	int i;
-	unsigned char xor = 0;
-
-	for (i = 1; i < len; i++)
-		xor |= (buf[i - 1] ^ buf[i]) & 6;
-
-	return !!xor * 2 + 1;
-}
-
-/*
- * sw_connect() probes for SideWinder type joysticks.
- */
-
-static int sw_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	struct sw *sw;
-	struct input_dev *input_dev;
-	int i, j, k, l;
-	int err = 0;
-	unsigned char *buf = NULL;	/* [SW_LENGTH] */
-	unsigned char *idbuf = NULL;	/* [SW_LENGTH] */
-	unsigned char m = 1;
-	char comment[40];
-
-	comment[0] = 0;
-
-	sw = kzalloc(sizeof(struct sw), GFP_KERNEL);
-	buf = kmalloc(SW_LENGTH, GFP_KERNEL);
-	idbuf = kmalloc(SW_LENGTH, GFP_KERNEL);
-	if (!sw || !buf || !idbuf) {
-		err = -ENOMEM;
-		goto fail1;
-	}
-
-	sw->gameport = gameport;
-
-	gameport_set_drvdata(gameport, sw);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	dbg("Init 0: Opened %s, io %#x, speed %d",
-		gameport->phys, gameport->io, gameport->speed);
-
-	i = sw_read_packet(gameport, buf, SW_LENGTH, 0);		/* Read normal packet */
-	msleep(SW_TIMEOUT);
-	dbg("Init 1: Mode %d. Length %d.", m , i);
-
-	if (!i) {							/* No data. 3d Pro analog mode? */
-		sw_init_digital(gameport);				/* Switch to digital */
-		msleep(SW_TIMEOUT);
-		i = sw_read_packet(gameport, buf, SW_LENGTH, 0);	/* Retry reading packet */
-		msleep(SW_TIMEOUT);
-		dbg("Init 1b: Length %d.", i);
-		if (!i) {						/* No data -> FAIL */
-			err = -ENODEV;
-			goto fail2;
-		}
-	}
-
-	j = sw_read_packet(gameport, idbuf, SW_LENGTH, i);		/* Read ID. This initializes the stick */
-	m |= sw_guess_mode(idbuf, j);					/* ID packet should carry mode info [3DP] */
-	dbg("Init 2: Mode %d. ID Length %d.", m, j);
-
-	if (j <= 0) {							/* Read ID failed. Happens in 1-bit mode on PP */
-		msleep(SW_TIMEOUT);
-		i = sw_read_packet(gameport, buf, SW_LENGTH, 0);	/* Retry reading packet */
-		m |= sw_guess_mode(buf, i);
-		dbg("Init 2b: Mode %d. Length %d.", m, i);
-		if (!i) {
-			err = -ENODEV;
-			goto fail2;
-		}
-		msleep(SW_TIMEOUT);
-		j = sw_read_packet(gameport, idbuf, SW_LENGTH, i);	/* Retry reading ID */
-		dbg("Init 2c: ID Length %d.", j);
-	}
-
-	sw->type = -1;
-	k = SW_FAIL;							/* Try SW_FAIL times */
-	l = 0;
-
-	do {
-		k--;
-		msleep(SW_TIMEOUT);
-		i = sw_read_packet(gameport, buf, SW_LENGTH, 0);	/* Read data packet */
-		dbg("Init 3: Mode %d. Length %d. Last %d. Tries %d.", m, i, l, k);
-
-		if (i > l) {						/* Longer? As we can only lose bits, it makes */
-									/* no sense to try detection for a packet shorter */
-			l = i;						/* than the previous one */
-
-			sw->number = 1;
-			sw->gameport = gameport;
-			sw->length = i;
-			sw->bits = m;
-
-			dbg("Init 3a: Case %d.\n", i * m);
-
-			switch (i * m) {
-				case 60:
-					sw->number++;
-				case 45:				/* Ambiguous packet length */
-					if (j <= 40) {			/* ID length less or eq 40 -> FSP */
-				case 43:
-						sw->type = SW_ID_FSP;
-						break;
-					}
-					sw->number++;
-				case 30:
-					sw->number++;
-				case 15:
-					sw->type = SW_ID_GP;
-					break;
-				case 33:
-				case 31:
-					sw->type = SW_ID_FFW;
-					break;
-				case 48:				/* Ambiguous */
-					if (j == 14) {			/* ID length 14*3 -> FFP */
-						sw->type = SW_ID_FFP;
-						sprintf(comment, " [AC %s]", sw_get_bits(idbuf,38,1,3) ? "off" : "on");
-					} else
-						sw->type = SW_ID_PP;
-					break;
-				case 66:
-					sw->bits = 3;
-				case 198:
-					sw->length = 22;
-				case 64:
-					sw->type = SW_ID_3DP;
-					if (j == 160)
-						sw_3dp_id(idbuf, comment, sizeof(comment));
-					break;
-			}
-		}
-
-	} while (k && sw->type == -1);
-
-	if (sw->type == -1) {
-		printk(KERN_WARNING "sidewinder.c: unknown joystick device detected "
-			"on %s, contact <vojtech@ucw.cz>\n", gameport->phys);
-		sw_print_packet("ID", j * 3, idbuf, 3);
-		sw_print_packet("Data", i * m, buf, m);
-		err = -ENODEV;
-		goto fail2;
-	}
-
-#ifdef SW_DEBUG
-	sw_print_packet("ID", j * 3, idbuf, 3);
-	sw_print_packet("Data", i * m, buf, m);
-#endif
-
-	gameport_set_poll_handler(gameport, sw_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	k = i;
-	l = j;
-
-	for (i = 0; i < sw->number; i++) {
-		int bits, code;
-
-		snprintf(sw->name, sizeof(sw->name),
-			 "Microsoft SideWinder %s", sw_name[sw->type]);
-		snprintf(sw->phys[i], sizeof(sw->phys[i]),
-			 "%s/input%d", gameport->phys, i);
-
-		sw->dev[i] = input_dev = input_allocate_device();
-		if (!input_dev) {
-			err = -ENOMEM;
-			goto fail3;
-		}
-
-		input_dev->name = sw->name;
-		input_dev->phys = sw->phys[i];
-		input_dev->id.bustype = BUS_GAMEPORT;
-		input_dev->id.vendor = GAMEPORT_ID_VENDOR_MICROSOFT;
-		input_dev->id.product = sw->type;
-		input_dev->id.version = 0x0100;
-		input_dev->dev.parent = &gameport->dev;
-
-		input_set_drvdata(input_dev, sw);
-
-		input_dev->open = sw_open;
-		input_dev->close = sw_close;
-
-		input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-		for (j = 0; (bits = sw_bit[sw->type][j]); j++) {
-			int min, max, fuzz, flat;
-
-			code = sw_abs[sw->type][j];
-			min = bits == 1 ? -1 : 0;
-			max = (1 << bits) - 1;
-			fuzz = (bits >> 1) >= 2 ? 1 << ((bits >> 1) - 2) : 0;
-			flat = code == ABS_THROTTLE || bits < 5 ?
-				0 : 1 << (bits - 5);
-
-			input_set_abs_params(input_dev, code,
-					     min, max, fuzz, flat);
-		}
-
-		for (j = 0; (code = sw_btn[sw->type][j]); j++)
-			__set_bit(code, input_dev->keybit);
-
-		dbg("%s%s [%d-bit id %d data %d]\n", sw->name, comment, m, l, k);
-
-		err = input_register_device(sw->dev[i]);
-		if (err)
-			goto fail4;
-	}
-
- out:	kfree(buf);
-	kfree(idbuf);
-
-	return err;
-
- fail4:	input_free_device(sw->dev[i]);
- fail3:	while (--i >= 0)
-		input_unregister_device(sw->dev[i]);
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(sw);
-	goto out;
-}
-
-static void sw_disconnect(struct gameport *gameport)
-{
-	struct sw *sw = gameport_get_drvdata(gameport);
-	int i;
-
-	for (i = 0; i < sw->number; i++)
-		input_unregister_device(sw->dev[i]);
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(sw);
-}
-
-static struct gameport_driver sw_drv = {
-	.driver		= {
-		.name	= "sidewinder",
-		.owner	= THIS_MODULE,
-	},
-	.description	= DRIVER_DESC,
-	.connect	= sw_connect,
-	.disconnect	= sw_disconnect,
-};
-
-module_gameport_driver(sw_drv);
diff --git a/drivers/input/joystick/tmdc.c b/drivers/input/joystick/tmdc.c
deleted file mode 100644
index 7e17cde..0000000
--- a/drivers/input/joystick/tmdc.c
+++ /dev/null
@@ -1,438 +0,0 @@
-/*
- *  Copyright (c) 1998-2001 Vojtech Pavlik
- *
- *   Based on the work of:
- *	Trystan Larey-Williams
- */
-
-/*
- * ThrustMaster DirectConnect (BSP) joystick family driver for Linux
- */
-
-/*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- * Should you need to contact me, the author, you can do so either by
- * e-mail - mail your message to <vojtech@ucw.cz>, or by paper mail:
- * Vojtech Pavlik, Simunkova 1594, Prague 8, 182 00 Czech Republic
- */
-
-#include <linux/delay.h>
-#include <linux/kernel.h>
-#include <linux/slab.h>
-#include <linux/module.h>
-#include <linux/gameport.h>
-#include <linux/input.h>
-#include <linux/jiffies.h>
-
-#define DRIVER_DESC	"ThrustMaster DirectConnect joystick driver"
-
-MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
-MODULE_DESCRIPTION(DRIVER_DESC);
-MODULE_LICENSE("GPL");
-
-#define TMDC_MAX_START		600	/* 600 us */
-#define TMDC_MAX_STROBE		60	/* 60 us */
-#define TMDC_MAX_LENGTH		13
-
-#define TMDC_MODE_M3DI		1
-#define TMDC_MODE_3DRP		3
-#define TMDC_MODE_AT		4
-#define TMDC_MODE_FM		8
-#define TMDC_MODE_FGP		163
-
-#define TMDC_BYTE_ID		10
-#define TMDC_BYTE_REV		11
-#define TMDC_BYTE_DEF		12
-
-#define TMDC_ABS		7
-#define TMDC_ABS_HAT		4
-#define TMDC_BTN		16
-
-static const unsigned char tmdc_byte_a[16] = { 0, 1, 3, 4, 6, 7 };
-static const unsigned char tmdc_byte_d[16] = { 2, 5, 8, 9 };
-
-static const signed char tmdc_abs[TMDC_ABS] =
-	{ ABS_X, ABS_Y, ABS_RUDDER, ABS_THROTTLE, ABS_RX, ABS_RY, ABS_RZ };
-static const signed char tmdc_abs_hat[TMDC_ABS_HAT] =
-	{ ABS_HAT0X, ABS_HAT0Y, ABS_HAT1X, ABS_HAT1Y };
-static const signed char tmdc_abs_at[TMDC_ABS] =
-	{ ABS_X, ABS_Y, ABS_RUDDER, -1, ABS_THROTTLE };
-static const signed char tmdc_abs_fm[TMDC_ABS] =
-	{ ABS_RX, ABS_RY, ABS_X, ABS_Y };
-
-static const short tmdc_btn_pad[TMDC_BTN] =
-	{ BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, BTN_START, BTN_SELECT, BTN_TL, BTN_TR };
-static const short tmdc_btn_joy[TMDC_BTN] =
-	{ BTN_TRIGGER, BTN_THUMB, BTN_TOP, BTN_TOP2, BTN_BASE, BTN_BASE2, BTN_THUMB2, BTN_PINKIE,
-	  BTN_BASE3, BTN_BASE4, BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z };
-static const short tmdc_btn_fm[TMDC_BTN] =
-        { BTN_TRIGGER, BTN_C, BTN_B, BTN_A, BTN_THUMB, BTN_X, BTN_Y, BTN_Z, BTN_TOP, BTN_TOP2 };
-static const short tmdc_btn_at[TMDC_BTN] =
-        { BTN_TRIGGER, BTN_THUMB2, BTN_PINKIE, BTN_THUMB, BTN_BASE6, BTN_BASE5, BTN_BASE4,
-          BTN_BASE3, BTN_BASE2, BTN_BASE };
-
-static const struct {
-        int x;
-        int y;
-} tmdc_hat_to_axis[] = {{ 0, 0}, { 1, 0}, { 0,-1}, {-1, 0}, { 0, 1}};
-
-static const struct tmdc_model {
-	unsigned char id;
-	const char *name;
-	char abs;
-	char hats;
-	char btnc[4];
-	char btno[4];
-	const signed char *axes;
-	const short *buttons;
-} tmdc_models[] = {
-	{   1, "ThrustMaster Millenium 3D Inceptor",	  6, 2, { 4, 2 }, { 4, 6 }, tmdc_abs, tmdc_btn_joy },
-	{   3, "ThrustMaster Rage 3D Gamepad",		  2, 0, { 8, 2 }, { 0, 0 }, tmdc_abs, tmdc_btn_pad },
-	{   4, "ThrustMaster Attack Throttle",		  5, 2, { 4, 6 }, { 4, 2 }, tmdc_abs_at, tmdc_btn_at },
-	{   8, "ThrustMaster FragMaster",		  4, 0, { 8, 2 }, { 0, 0 }, tmdc_abs_fm, tmdc_btn_fm },
-	{ 163, "Thrustmaster Fusion GamePad",		  2, 0, { 8, 2 }, { 0, 0 }, tmdc_abs, tmdc_btn_pad },
-	{   0, "Unknown %d-axis, %d-button TM device %d", 0, 0, { 0, 0 }, { 0, 0 }, tmdc_abs, tmdc_btn_joy }
-};
-
-
-struct tmdc_port {
-	struct input_dev *dev;
-	char name[64];
-	char phys[32];
-	int mode;
-	const signed char *abs;
-	const short *btn;
-	unsigned char absc;
-	unsigned char btnc[4];
-	unsigned char btno[4];
-};
-
-struct tmdc {
-	struct gameport *gameport;
-	struct tmdc_port *port[2];
-#if 0
-	struct input_dev *dev[2];
-	char name[2][64];
-	char phys[2][32];
-	int mode[2];
-	signed char *abs[2];
-	short *btn[2];
-	unsigned char absc[2];
-	unsigned char btnc[2][4];
-	unsigned char btno[2][4];
-#endif
-	int reads;
-	int bads;
-	unsigned char exists;
-};
-
-/*
- * tmdc_read_packet() reads a ThrustMaster packet.
- */
-
-static int tmdc_read_packet(struct gameport *gameport, unsigned char data[2][TMDC_MAX_LENGTH])
-{
-	unsigned char u, v, w, x;
-	unsigned long flags;
-	int i[2], j[2], t[2], p, k;
-
-	p = gameport_time(gameport, TMDC_MAX_STROBE);
-
-	for (k = 0; k < 2; k++) {
-		t[k] = gameport_time(gameport, TMDC_MAX_START);
-		i[k] = j[k] = 0;
-	}
-
-	local_irq_save(flags);
-	gameport_trigger(gameport);
-
-	w = gameport_read(gameport) >> 4;
-
-	do {
-		x = w;
-		w = gameport_read(gameport) >> 4;
-
-		for (k = 0, v = w, u = x; k < 2; k++, v >>= 2, u >>= 2) {
-			if (~v & u & 2) {
-				if (t[k] <= 0 || i[k] >= TMDC_MAX_LENGTH) continue;
-				t[k] = p;
-				if (j[k] == 0) {				 /* Start bit */
-					if (~v & 1) t[k] = 0;
-					data[k][i[k]] = 0; j[k]++; continue;
-				}
-				if (j[k] == 9) {				/* Stop bit */
-					if (v & 1) t[k] = 0;
-					j[k] = 0; i[k]++; continue;
-				}
-				data[k][i[k]] |= (~v & 1) << (j[k]++ - 1);	/* Data bit */
-			}
-			t[k]--;
-		}
-	} while (t[0] > 0 || t[1] > 0);
-
-	local_irq_restore(flags);
-
-	return (i[0] == TMDC_MAX_LENGTH) | ((i[1] == TMDC_MAX_LENGTH) << 1);
-}
-
-static int tmdc_parse_packet(struct tmdc_port *port, unsigned char *data)
-{
-	int i, k, l;
-
-	if (data[TMDC_BYTE_ID] != port->mode)
-		return -1;
-
-	for (i = 0; i < port->absc; i++) {
-		if (port->abs[i] < 0)
-			return 0;
-
-		input_report_abs(port->dev, port->abs[i], data[tmdc_byte_a[i]]);
-	}
-
-	switch (port->mode) {
-
-		case TMDC_MODE_M3DI:
-
-			i = tmdc_byte_d[0];
-			input_report_abs(port->dev, ABS_HAT0X, ((data[i] >> 3) & 1) - ((data[i] >> 1) & 1));
-			input_report_abs(port->dev, ABS_HAT0Y, ((data[i] >> 2) & 1) - ( data[i]       & 1));
-			break;
-
-		case TMDC_MODE_AT:
-
-			i = tmdc_byte_a[3];
-			input_report_abs(port->dev, ABS_HAT0X, tmdc_hat_to_axis[(data[i] - 141) / 25].x);
-			input_report_abs(port->dev, ABS_HAT0Y, tmdc_hat_to_axis[(data[i] - 141) / 25].y);
-			break;
-
-	}
-
-	for (k = l = 0; k < 4; k++) {
-		for (i = 0; i < port->btnc[k]; i++)
-			input_report_key(port->dev, port->btn[i + l],
-				((data[tmdc_byte_d[k]] >> (i + port->btno[k])) & 1));
-		l += port->btnc[k];
-	}
-
-	input_sync(port->dev);
-
-	return 0;
-}
-
-/*
- * tmdc_poll() reads and analyzes ThrustMaster joystick data.
- */
-
-static void tmdc_poll(struct gameport *gameport)
-{
-	unsigned char data[2][TMDC_MAX_LENGTH];
-	struct tmdc *tmdc = gameport_get_drvdata(gameport);
-	unsigned char r, bad = 0;
-	int i;
-
-	tmdc->reads++;
-
-	if ((r = tmdc_read_packet(tmdc->gameport, data)) != tmdc->exists)
-		bad = 1;
-	else {
-		for (i = 0; i < 2; i++) {
-			if (r & (1 << i) & tmdc->exists) {
-
-				if (tmdc_parse_packet(tmdc->port[i], data[i]))
-					bad = 1;
-			}
-		}
-	}
-
-	tmdc->bads += bad;
-}
-
-static int tmdc_open(struct input_dev *dev)
-{
-	struct tmdc *tmdc = input_get_drvdata(dev);
-
-	gameport_start_polling(tmdc->gameport);
-	return 0;
-}
-
-static void tmdc_close(struct input_dev *dev)
-{
-	struct tmdc *tmdc = input_get_drvdata(dev);
-
-	gameport_stop_polling(tmdc->gameport);
-}
-
-static int tmdc_setup_port(struct tmdc *tmdc, int idx, unsigned char *data)
-{
-	const struct tmdc_model *model;
-	struct tmdc_port *port;
-	struct input_dev *input_dev;
-	int i, j, b = 0;
-	int err;
-
-	tmdc->port[idx] = port = kzalloc(sizeof (struct tmdc_port), GFP_KERNEL);
-	input_dev = input_allocate_device();
-	if (!port || !input_dev) {
-		err = -ENOMEM;
-		goto fail;
-	}
-
-	port->mode = data[TMDC_BYTE_ID];
-
-	for (model = tmdc_models; model->id && model->id != port->mode; model++)
-		/* empty */;
-
-	port->abs = model->axes;
-	port->btn = model->buttons;
-
-	if (!model->id) {
-		port->absc = data[TMDC_BYTE_DEF] >> 4;
-		for (i = 0; i < 4; i++)
-			port->btnc[i] = i < (data[TMDC_BYTE_DEF] & 0xf) ? 8 : 0;
-	} else {
-		port->absc = model->abs;
-		for (i = 0; i < 4; i++)
-			port->btnc[i] = model->btnc[i];
-	}
-
-	for (i = 0; i < 4; i++)
-		port->btno[i] = model->btno[i];
-
-	snprintf(port->name, sizeof(port->name), model->name,
-		 port->absc, (data[TMDC_BYTE_DEF] & 0xf) << 3, port->mode);
-	snprintf(port->phys, sizeof(port->phys), "%s/input%d", tmdc->gameport->phys, i);
-
-	port->dev = input_dev;
-
-	input_dev->name = port->name;
-	input_dev->phys = port->phys;
-	input_dev->id.bustype = BUS_GAMEPORT;
-	input_dev->id.vendor = GAMEPORT_ID_VENDOR_THRUSTMASTER;
-	input_dev->id.product = model->id;
-	input_dev->id.version = 0x0100;
-	input_dev->dev.parent = &tmdc->gameport->dev;
-
-	input_set_drvdata(input_dev, tmdc);
-
-	input_dev->open = tmdc_open;
-	input_dev->close = tmdc_close;
-
-	input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
-
-	for (i = 0; i < port->absc && i < TMDC_ABS; i++)
-		if (port->abs[i] >= 0)
-			input_set_abs_params(input_dev, port->abs[i], 8, 248, 2, 4);
-
-	for (i = 0; i < model->hats && i < TMDC_ABS_HAT; i++)
-		input_set_abs_params(input_dev, tmdc_abs_hat[i], -1, 1, 0, 0);
-
-	for (i = 0; i < 4; i++) {
-		for (j = 0; j < port->btnc[i] && j < TMDC_BTN; j++)
-			set_bit(port->btn[j + b], input_dev->keybit);
-		b += port->btnc[i];
-	}
-
-	err = input_register_device(port->dev);
-	if (err)
-		goto fail;
-
-	return 0;
-
- fail:	input_free_device(input_dev);
-	kfree(port);
-	return err;
-}
-
-/*
- * tmdc_probe() probes for ThrustMaster type joysticks.
- */
-
-static int tmdc_connect(struct gameport *gameport, struct gameport_driver *drv)
-{
-	unsigned char data[2][TMDC_MAX_LENGTH];
-	struct tmdc *tmdc;
-	int i;
-	int err;
-
-	if (!(tmdc = kzalloc(sizeof(struct tmdc), GFP_KERNEL)))
-		return -ENOMEM;
-
-	tmdc->gameport = gameport;
-
-	gameport_set_drvdata(gameport, tmdc);
-
-	err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
-	if (err)
-		goto fail1;
-
-	if (!(tmdc->exists = tmdc_read_packet(gameport, data))) {
-		err = -ENODEV;
-		goto fail2;
-	}
-
-	gameport_set_poll_handler(gameport, tmdc_poll);
-	gameport_set_poll_interval(gameport, 20);
-
-	for (i = 0; i < 2; i++) {
-		if (tmdc->exists & (1 << i)) {
-
-			err = tmdc_setup_port(tmdc, i, data[i]);
-			if (err)
-				goto fail3;
-		}
-	}
-
-	return 0;
-
- fail3: while (--i >= 0) {
-		if (tmdc->port[i]) {
-			input_unregister_device(tmdc->port[i]->dev);
-			kfree(tmdc->port[i]);
-		}
-	}
- fail2:	gameport_close(gameport);
- fail1:	gameport_set_drvdata(gameport, NULL);
-	kfree(tmdc);
-	return err;
-}
-
-static void tmdc_disconnect(struct gameport *gameport)
-{
-	struct tmdc *tmdc = gameport_get_drvdata(gameport);
-	int i;
-
-	for (i = 0; i < 2; i++) {
-		if (tmdc->port[i]) {
-			input_unregister_device(tmdc->port[i]->dev);
-			kfree(tmdc->port[i]);
-		}
-	}
-	gameport_close(gameport);
-	gameport_set_drvdata(gameport, NULL);
-	kfree(tmdc);
-}
-
-static struct gameport_driver tmdc_drv = {
-	.driver		= {
-		.name	= "tmdc",
-		.owner	= THIS_MODULE,
-	},
-	.description	= DRIVER_DESC,
-	.connect	= tmdc_connect,
-	.disconnect	= tmdc_disconnect,
-};
-
-module_gameport_driver(tmdc_drv);
diff --git a/include/linux/gameport.h b/include/linux/gameport.h
deleted file mode 100644
index bb7de09..0000000
--- a/include/linux/gameport.h
+++ /dev/null
@@ -1,219 +0,0 @@
-/*
- *  Copyright (c) 1999-2002 Vojtech Pavlik
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-#ifndef _GAMEPORT_H
-#define _GAMEPORT_H
-
-#include <asm/io.h>
-#include <linux/types.h>
-#include <linux/list.h>
-#include <linux/mutex.h>
-#include <linux/device.h>
-#include <linux/timer.h>
-#include <linux/slab.h>
-#include <uapi/linux/gameport.h>
-
-struct gameport {
-
-	void *port_data;	/* Private pointer for gameport drivers */
-	char name[32];
-	char phys[32];
-
-	int io;
-	int speed;
-	int fuzz;
-
-	void (*trigger)(struct gameport *);
-	unsigned char (*read)(struct gameport *);
-	int (*cooked_read)(struct gameport *, int *, int *);
-	int (*calibrate)(struct gameport *, int *, int *);
-	int (*open)(struct gameport *, int);
-	void (*close)(struct gameport *);
-
-	struct timer_list poll_timer;
-	unsigned int poll_interval;	/* in msecs */
-	spinlock_t timer_lock;
-	unsigned int poll_cnt;
-	void (*poll_handler)(struct gameport *);
-
-	struct gameport *parent, *child;
-
-	struct gameport_driver *drv;
-	struct mutex drv_mutex;		/* protects serio->drv so attributes can pin driver */
-
-	struct device dev;
-
-	struct list_head node;
-};
-#define to_gameport_port(d)	container_of(d, struct gameport, dev)
-
-struct gameport_driver {
-	const char *description;
-
-	int (*connect)(struct gameport *, struct gameport_driver *drv);
-	int (*reconnect)(struct gameport *);
-	void (*disconnect)(struct gameport *);
-
-	struct device_driver driver;
-
-	bool ignore;
-};
-#define to_gameport_driver(d)	container_of(d, struct gameport_driver, driver)
-
-int gameport_open(struct gameport *gameport, struct gameport_driver *drv, int mode);
-void gameport_close(struct gameport *gameport);
-
-#if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
-
-void __gameport_register_port(struct gameport *gameport, struct module *owner);
-/* use a define to avoid include chaining to get THIS_MODULE */
-#define gameport_register_port(gameport) \
-	__gameport_register_port(gameport, THIS_MODULE)
-
-void gameport_unregister_port(struct gameport *gameport);
-
-__printf(2, 3)
-void gameport_set_phys(struct gameport *gameport, const char *fmt, ...);
-
-#else
-
-static inline void gameport_register_port(struct gameport *gameport)
-{
-	return;
-}
-
-static inline void gameport_unregister_port(struct gameport *gameport)
-{
-	return;
-}
-
-static inline __printf(2, 3)
-void gameport_set_phys(struct gameport *gameport, const char *fmt, ...)
-{
-	return;
-}
-
-#endif
-
-static inline struct gameport *gameport_allocate_port(void)
-{
-	struct gameport *gameport = kzalloc(sizeof(struct gameport), GFP_KERNEL);
-
-	return gameport;
-}
-
-static inline void gameport_free_port(struct gameport *gameport)
-{
-	kfree(gameport);
-}
-
-static inline void gameport_set_name(struct gameport *gameport, const char *name)
-{
-	strlcpy(gameport->name, name, sizeof(gameport->name));
-}
-
-/*
- * Use the following functions to manipulate gameport's per-port
- * driver-specific data.
- */
-static inline void *gameport_get_drvdata(struct gameport *gameport)
-{
-	return dev_get_drvdata(&gameport->dev);
-}
-
-static inline void gameport_set_drvdata(struct gameport *gameport, void *data)
-{
-	dev_set_drvdata(&gameport->dev, data);
-}
-
-/*
- * Use the following functions to pin gameport's driver in process context
- */
-static inline int gameport_pin_driver(struct gameport *gameport)
-{
-	return mutex_lock_interruptible(&gameport->drv_mutex);
-}
-
-static inline void gameport_unpin_driver(struct gameport *gameport)
-{
-	mutex_unlock(&gameport->drv_mutex);
-}
-
-int __must_check __gameport_register_driver(struct gameport_driver *drv,
-				struct module *owner, const char *mod_name);
-
-/* use a define to avoid include chaining to get THIS_MODULE & friends */
-#define gameport_register_driver(drv) \
-	__gameport_register_driver(drv, THIS_MODULE, KBUILD_MODNAME)
-
-void gameport_unregister_driver(struct gameport_driver *drv);
-
-/**
- * module_gameport_driver() - Helper macro for registering a gameport driver
- * @__gameport_driver: gameport_driver struct
- *
- * Helper macro for gameport drivers which do not do anything special in
- * module init/exit. This eliminates a lot of boilerplate. Each module may
- * only use this macro once, and calling it replaces module_init() and
- * module_exit().
- */
-#define module_gameport_driver(__gameport_driver) \
-	module_driver(__gameport_driver, gameport_register_driver, \
-		       gameport_unregister_driver)
-
-
-static inline void gameport_trigger(struct gameport *gameport)
-{
-	if (gameport->trigger)
-		gameport->trigger(gameport);
-	else
-		outb(0xff, gameport->io);
-}
-
-static inline unsigned char gameport_read(struct gameport *gameport)
-{
-	if (gameport->read)
-		return gameport->read(gameport);
-	else
-		return inb(gameport->io);
-}
-
-static inline int gameport_cooked_read(struct gameport *gameport, int *axes, int *buttons)
-{
-	if (gameport->cooked_read)
-		return gameport->cooked_read(gameport, axes, buttons);
-	else
-		return -1;
-}
-
-static inline int gameport_calibrate(struct gameport *gameport, int *axes, int *max)
-{
-	if (gameport->calibrate)
-		return gameport->calibrate(gameport, axes, max);
-	else
-		return -1;
-}
-
-static inline int gameport_time(struct gameport *gameport, int time)
-{
-	return (time * gameport->speed) / 1000;
-}
-
-static inline void gameport_set_poll_handler(struct gameport *gameport, void (*handler)(struct gameport *))
-{
-	gameport->poll_handler = handler;
-}
-
-static inline void gameport_set_poll_interval(struct gameport *gameport, unsigned int msecs)
-{
-	gameport->poll_interval = msecs;
-}
-
-void gameport_start_polling(struct gameport *gameport);
-void gameport_stop_polling(struct gameport *gameport);
-
-#endif
diff --git a/include/uapi/linux/Kbuild b/include/uapi/linux/Kbuild
index 24e9033..5482e82 100644
--- a/include/uapi/linux/Kbuild
+++ b/include/uapi/linux/Kbuild
@@ -127,7 +127,6 @@ header-y += fs.h
 header-y += fsl_hypervisor.h
 header-y += fuse.h
 header-y += futex.h
-header-y += gameport.h
 header-y += gen_stats.h
 header-y += genetlink.h
 header-y += gfs2_ondisk.h
diff --git a/include/uapi/linux/gameport.h b/include/uapi/linux/gameport.h
deleted file mode 100644
index 49b29b0..0000000
--- a/include/uapi/linux/gameport.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- *  Copyright (c) 1999-2002 Vojtech Pavlik
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 as published by
- * the Free Software Foundation.
- */
-#ifndef _UAPI_GAMEPORT_H
-#define _UAPI_GAMEPORT_H
-
-
-
-#define GAMEPORT_MODE_DISABLED		0
-#define GAMEPORT_MODE_RAW		1
-#define GAMEPORT_MODE_COOKED		2
-
-#define GAMEPORT_ID_VENDOR_ANALOG	0x0001
-#define GAMEPORT_ID_VENDOR_MADCATZ	0x0002
-#define GAMEPORT_ID_VENDOR_LOGITECH	0x0003
-#define GAMEPORT_ID_VENDOR_CREATIVE	0x0004
-#define GAMEPORT_ID_VENDOR_GENIUS	0x0005
-#define GAMEPORT_ID_VENDOR_INTERACT	0x0006
-#define GAMEPORT_ID_VENDOR_MICROSOFT	0x0007
-#define GAMEPORT_ID_VENDOR_THRUSTMASTER	0x0008
-#define GAMEPORT_ID_VENDOR_GRAVIS	0x0009
-#define GAMEPORT_ID_VENDOR_GUILLEMOT	0x000a
-
-#endif /* _UAPI_GAMEPORT_H */
-- 
2.1.0.rc2.206.gedb03e5


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-19 16:41 [PATCH 1/2] SOUND: kill gameport bits Dmitry Torokhov
  2014-08-19 16:41 ` [PATCH 2/2] Input: remove gameport subsystem Dmitry Torokhov
@ 2014-08-20  7:33 ` Clemens Ladisch
  1 sibling, 0 replies; 23+ messages in thread
From: Clemens Ladisch @ 2014-08-20  7:33 UTC (permalink / raw)
  To: Dmitry Torokhov, linux-input
  Cc: linux-kernel, Vojtech Pavlik, Jiri Kosina, Takashi Iwai

Dmitry Torokhov wrote:
> Gameport support hasn't been working well ever since cpufreq became
> mainstream

Back in the gameport-mainstream days, we did not have a usable high-
resolution timer API.  But why can't we use something like
getrawmonotonic() now?  (Yes, I'm volunteering ...)

> and it becomes increasingly hard to find hardware and software that
> would run on such old hardware.

I have two such sound cards, and a joystick.


Regards,
Clemens

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-28 20:03               ` Clemens Ladisch
@ 2014-08-28 21:11                 ` Vojtech Pavlik
  0 siblings, 0 replies; 23+ messages in thread
From: Vojtech Pavlik @ 2014-08-28 21:11 UTC (permalink / raw)
  To: Clemens Ladisch
  Cc: Takashi Iwai, Andreas Mohr, Dmitry Torokhov, linux-input,
	linux-kernel, Jiri Kosina

On Thu, Aug 28, 2014 at 10:03:55PM +0200, Clemens Ladisch wrote:
> Takashi Iwai wrote:
> > did anyone test the patch at all...?
> 
> Appears to work.  The ymfpci gameport seems to be somewhat unreliable:
> 
>  analog.c: 100 out of 17347 reads (0%) on pci0000:06:06.1/gameport0 failed
>  analog.c: 122 out of 1111 reads (10%) on pci0000:06:07.0/gameport0 failed

The analog.c gameport read routine is unreliable by design. 

The 558 chip is not an ADC, it's an one-shot timer from 1971. The analog
position of the joystick is measured by timing bit changes on the
gameport.

analog.c does that without disabling interrupts, as the read can take
several milliseconds. analog.c instead detects when an interrupt influenced
the measurement too much and retries.

The retries are counted and reported.

10% is a largeish number, but still something the analog.c driver can
cope with and give reliable results. 

> There is still some dependence of the CPU speed on the loop counts
> calculated by gameport_time(), but it's not very high; the following are
> for 3200 and 800 MHz, 5 times each:
> 
>  gameport gameport7: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
>  gameport gameport8: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
>  gameport gameport9: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
>  gameport gameport10: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
>  gameport gameport11: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
>  gameport gameport12: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz
>  gameport gameport13: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz
>  gameport gameport14: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz
>  gameport gameport15: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 611kHz
>  gameport gameport16: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz

The gameport speed is speed of the i/o to the port. It may change as
frequencies in the system change. It's used for timeouts on digital
gameport protocols only and thus a variation of less than 20% shouldn't cause
trouble.

The analog.c driver uses its own timing calibration to make the
analog_cooked_read() reliable even when the speed of the i/o operations
changes.

What is important is that the GET_TIME() macro is fast (0.1 usec or
less), precise (sub-microsecond resolution) and reliable. Digital
protocols also rely on udelay() and mdelay() waiting precisely for the
amount of time specified.

-- 
Vojtech Pavlik
Director SuSE Labs

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-25  7:13             ` Takashi Iwai
@ 2014-08-28 20:03               ` Clemens Ladisch
  2014-08-28 21:11                 ` Vojtech Pavlik
  0 siblings, 1 reply; 23+ messages in thread
From: Clemens Ladisch @ 2014-08-28 20:03 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Andreas Mohr, Dmitry Torokhov, linux-input, linux-kernel,
	Vojtech Pavlik, Jiri Kosina

Takashi Iwai wrote:
> did anyone test the patch at all...?

Appears to work.  The ymfpci gameport seems to be somewhat unreliable:

 analog.c: 100 out of 17347 reads (0%) on pci0000:06:06.1/gameport0 failed
 analog.c: 122 out of 1111 reads (10%) on pci0000:06:07.0/gameport0 failed

There is still some dependence of the CPU speed on the loop counts
calculated by gameport_time(), but it's not very high; the following are
for 3200 and 800 MHz, 5 times each:

 gameport gameport7: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
 gameport gameport8: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
 gameport gameport9: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
 gameport gameport10: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
 gameport gameport11: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 651kHz
 gameport gameport12: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz
 gameport gameport13: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz
 gameport gameport14: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz
 gameport gameport15: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 611kHz
 gameport gameport16: EMU10K1 is pci0000:06:06.1/gameport0, io 0xe480, speed 612kHz


Regards,
Clemens

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-24  5:07           ` Andreas Mohr
@ 2014-08-25  7:13             ` Takashi Iwai
  2014-08-28 20:03               ` Clemens Ladisch
  0 siblings, 1 reply; 23+ messages in thread
From: Takashi Iwai @ 2014-08-25  7:13 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: Dmitry Torokhov, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

At Sun, 24 Aug 2014 07:07:16 +0200,
Andreas Mohr wrote:
> 
> On Thu, Aug 21, 2014 at 01:29:03PM +0200, Takashi Iwai wrote:
> > I did a quick hack and it seems working on my box.
> > The patch is below.
> 
> Thanks!!
> 
> Further comments below.
> 
> I will be testing this ASAP.
> > +static bool use_ktime = true;
> > +module_param(use_ktime, bool, 0400);
> 
> Towards final commit, should probably add param docs on what may be switched here and why.
> 
> > +
> >  /*
> >   * gameport_mutex protects entire gameport subsystem and is taken
> >   * every time gameport port or driver registrered or unregistered.
> > @@ -76,6 +80,36 @@ static unsigned int get_time_pit(void)
> >  
> >  static int gameport_measure_speed(struct gameport *gameport)
> >  {
> > +	unsigned int i, t, tx;
> > +	u64 t1, t2;
> > +	unsigned long flags;
> > +
> > +	if (gameport_open(gameport, NULL, GAMEPORT_MODE_RAW))
> > +		return 0;
> > +
> > +	tx = ~0;
> > +
> > +	for (i = 0; i < 50; i++) {
> > +		local_irq_save(flags);
> > +		t1 = ktime_get_ns();
> > +		for (t = 0; t < 50; t++)
> > +			gameport_read(gameport);
> > +		t2 = ktime_get_ns();
> > +		local_irq_restore(flags);
> > +		udelay(i * 10);
> > +		if (t2 - t1 < tx)
> > +			tx = t2 - t1;
> 
> This impl is not doing the more complex t3, t2, t1 calculation
> that the PIT impl is doing (likely for the uncommented purpose
> of eliminating timer I/O delay from timing consideration).
> Do/don't ktime/TSC impls better need such an I/O timing correction,
> or are they so fast relative to gameport I/O delays
> that it does not matter? (probably the case for TSC at least).

It's based on x86-64 implementation that doesn't take t3 into
account.  I don't think it doesn't matter so much on the recent
systems, but certainly it can't hurt to measure it, too.

> Oh, and any reason that such a speed calculation remains painfully duplicated
> in both source files? That's possibly done for layering reasons,
> but I'd have to analyze it further.

Yeah, a layer should be one reason.  Another reason is that TSC read
has to be a macro, thus you'd need anyway reimplementation, either
static inline or such.

In my patch, I didn't want to change too much in a shot.  It just adds
the replacement using ktime, that's all.  If you'd like to work on
this further, feel free to do it.

> > +static inline u64 get_time(void)
> > +{
> > +	if (use_ktime) {
> > +		return ktime_get_ns();
> > +	} else {
> > +		unsigned int x;
> > +		GET_TIME(x);
> > +		return x;
> > +	}
> > +}
> 
> It might be useful to have a first commit to introduce these helpers,
> and a second commit to then add ktime support (to keep review code size
> down).

The very purpose of this helper is for ktime.  For TSC, the helper
*is* GET_TIME().  So, splitting commit without introducing ktime
doesn't make much sense.

Nevertheless: did anyone test the patch at all...?


thanks,

Takashi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-21 11:29         ` Takashi Iwai
@ 2014-08-24  5:07           ` Andreas Mohr
  2014-08-25  7:13             ` Takashi Iwai
  0 siblings, 1 reply; 23+ messages in thread
From: Andreas Mohr @ 2014-08-24  5:07 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Dmitry Torokhov, Andreas Mohr, linux-input, linux-kernel,
	Vojtech Pavlik, Jiri Kosina

On Thu, Aug 21, 2014 at 01:29:03PM +0200, Takashi Iwai wrote:
> I did a quick hack and it seems working on my box.
> The patch is below.

Thanks!!

Further comments below.

I will be testing this ASAP.
> +static bool use_ktime = true;
> +module_param(use_ktime, bool, 0400);

Towards final commit, should probably add param docs on what may be switched here and why.

> +
>  /*
>   * gameport_mutex protects entire gameport subsystem and is taken
>   * every time gameport port or driver registrered or unregistered.
> @@ -76,6 +80,36 @@ static unsigned int get_time_pit(void)
>  
>  static int gameport_measure_speed(struct gameport *gameport)
>  {
> +	unsigned int i, t, tx;
> +	u64 t1, t2;
> +	unsigned long flags;
> +
> +	if (gameport_open(gameport, NULL, GAMEPORT_MODE_RAW))
> +		return 0;
> +
> +	tx = ~0;
> +
> +	for (i = 0; i < 50; i++) {
> +		local_irq_save(flags);
> +		t1 = ktime_get_ns();
> +		for (t = 0; t < 50; t++)
> +			gameport_read(gameport);
> +		t2 = ktime_get_ns();
> +		local_irq_restore(flags);
> +		udelay(i * 10);
> +		if (t2 - t1 < tx)
> +			tx = t2 - t1;

This impl is not doing the more complex t3, t2, t1 calculation
that the PIT impl is doing (likely for the uncommented purpose
of eliminating timer I/O delay from timing consideration).
Do/don't ktime/TSC impls better need such an I/O timing correction,
or are they so fast relative to gameport I/O delays
that it does not matter? (probably the case for TSC at least).


Oh, and any reason that such a speed calculation remains painfully duplicated
in both source files? That's possibly done for layering reasons,
but I'd have to analyze it further.

> +static inline u64 get_time(void)
> +{
> +	if (use_ktime) {
> +		return ktime_get_ns();
> +	} else {
> +		unsigned int x;
> +		GET_TIME(x);
> +		return x;
> +	}
> +}

It might be useful to have a first commit to introduce these helpers,
and a second commit to then add ktime support (to keep review code size
down).

Thanks,

Andreas Mohr

-- 
GNU/Linux. It's not the software that's free, it's you.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  7:05       ` Takashi Iwai
  2014-08-20 12:15         ` Takashi Iwai
  2014-08-20 12:29         ` One Thousand Gnomes
@ 2014-08-21 11:29         ` Takashi Iwai
  2014-08-24  5:07           ` Andreas Mohr
  2 siblings, 1 reply; 23+ messages in thread
From: Takashi Iwai @ 2014-08-21 11:29 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

At Wed, 20 Aug 2014 09:05:58 +0200,
Takashi Iwai wrote:
> 
> > > > > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > > > > choice for longer times) would be affected by Cpufreq...
> > > > > And there are no details on how exactly cpufreq is a problem or how this
> > > > > timing issue could be fixed...
> > > > 
> > > > If you take a look at gameport_measure_speed() in gameport.c you will see that
> > > > it counts cycles for timing, which obviously does not work that well when CPU
> > > > frequency changes.
> > > > 
> > > > The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> > > > stepped up to fix that.
> > > 
> > > Hm, can't we just use the standard ktime for measuring the time diff?
> > 
> > We could use high-res timers, if they are available. Are they available on such
> > old hardware and are they sufficiently fast to provide needed timings? I
> > definitely do not have any hardware to est with.
> 
> The boards aren't necessarily bound with the old hardware.  PCI boards
> run fine on the modern machines if they still have a PCI slot (how
> lucky).  And, the highres timer itself isn't so new...

I did a quick hack and it seems working on my box.
The patch is below.


thanks,

Takashi

-- 8< --
From: Takashi Iwai <tiwai@suse.de>
Subject: [PATCH] Input: joystick - Use ktime for measuring timing

The current codes in gameport and analog joystick drivers for the time
accounting have a long-standing problem when the system is running
with CPU freq; since the timing is measured via TSC or sample counter,
the calculation isn't reliable.

In this patch, as a simple fix, use the standard ktime to measure the
timing.  In case where no high resolution timer is available,
use_ktime bool option is provided to both modules.  Setting
use_ktime=false switches to the old methods.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/input/gameport/gameport.c | 38 ++++++++++++++++++++-
 drivers/input/joystick/analog.c   | 70 ++++++++++++++++++++++++++++-----------
 2 files changed, 88 insertions(+), 20 deletions(-)

diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c
index 24c41ba7d4e0..48d91f12e397 100644
--- a/drivers/input/gameport/gameport.c
+++ b/drivers/input/gameport/gameport.c
@@ -23,6 +23,7 @@
 #include <linux/workqueue.h>
 #include <linux/sched.h>	/* HZ */
 #include <linux/mutex.h>
+#include <linux/timekeeping.h>
 
 /*#include <asm/io.h>*/
 
@@ -30,6 +31,9 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION("Generic gameport layer");
 MODULE_LICENSE("GPL");
 
+static bool use_ktime = true;
+module_param(use_ktime, bool, 0400);
+
 /*
  * gameport_mutex protects entire gameport subsystem and is taken
  * every time gameport port or driver registrered or unregistered.
@@ -76,6 +80,36 @@ static unsigned int get_time_pit(void)
 
 static int gameport_measure_speed(struct gameport *gameport)
 {
+	unsigned int i, t, tx;
+	u64 t1, t2;
+	unsigned long flags;
+
+	if (gameport_open(gameport, NULL, GAMEPORT_MODE_RAW))
+		return 0;
+
+	tx = ~0;
+
+	for (i = 0; i < 50; i++) {
+		local_irq_save(flags);
+		t1 = ktime_get_ns();
+		for (t = 0; t < 50; t++)
+			gameport_read(gameport);
+		t2 = ktime_get_ns();
+		local_irq_restore(flags);
+		udelay(i * 10);
+		if (t2 - t1 < tx)
+			tx = t2 - t1;
+	}
+
+	gameport_close(gameport);
+	t = 1000000 * 50;
+	if (tx)
+		t /= tx;
+	return t;
+}
+
+static int old_gameport_measure_speed(struct gameport *gameport)
+{
 #if defined(__i386__)
 
 	unsigned int i, t, t1, t2, t3, tx;
@@ -521,7 +555,9 @@ static void gameport_add_port(struct gameport *gameport)
 	if (gameport->parent)
 		gameport->parent->child = gameport;
 
-	gameport->speed = gameport_measure_speed(gameport);
+	gameport->speed = use_ktime ?
+		gameport_measure_speed(gameport) :
+		old_gameport_measure_speed(gameport);
 
 	list_add_tail(&gameport->node, &gameport_list);
 
diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index ab0fdcd36e18..723276d40b58 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -36,6 +36,7 @@
 #include <linux/gameport.h>
 #include <linux/jiffies.h>
 #include <linux/timex.h>
+#include <linux/timekeeping.h>
 
 #define DRIVER_DESC	"Analog joystick and gamepad driver"
 
@@ -43,6 +44,9 @@ MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>");
 MODULE_DESCRIPTION(DRIVER_DESC);
 MODULE_LICENSE("GPL");
 
+static bool use_ktime = true;
+module_param(use_ktime, bool, 0400);
+
 /*
  * Option parsing.
  */
@@ -171,6 +175,25 @@ static unsigned long analog_faketime = 0;
 #warning Precise timer not defined for this architecture.
 #endif
 
+static inline u64 get_time(void)
+{
+	if (use_ktime) {
+		return ktime_get_ns();
+	} else {
+		unsigned int x;
+		GET_TIME(x);
+		return x;
+	}
+}
+
+static inline unsigned int delta(u64 x, u64 y)
+{
+	if (use_ktime)
+		return y - x;
+	else
+		return DELTA((unsigned int)x, (unsigned int)y);
+}
+
 /*
  * analog_decode() decodes analog joystick data and reports input events.
  */
@@ -226,7 +249,8 @@ static void analog_decode(struct analog *analog, int *axes, int *initial, int bu
 static int analog_cooked_read(struct analog_port *port)
 {
 	struct gameport *gameport = port->gameport;
-	unsigned int time[4], start, loop, now, loopout, timeout;
+	u64 time[4], start, loop, now;
+	unsigned int loopout, timeout;
 	unsigned char data[4], this, last;
 	unsigned long flags;
 	int i, j;
@@ -236,7 +260,7 @@ static int analog_cooked_read(struct analog_port *port)
 
 	local_irq_save(flags);
 	gameport_trigger(gameport);
-	GET_TIME(now);
+	now = get_time();
 	local_irq_restore(flags);
 
 	start = now;
@@ -249,16 +273,16 @@ static int analog_cooked_read(struct analog_port *port)
 
 		local_irq_disable();
 		this = gameport_read(gameport) & port->mask;
-		GET_TIME(now);
+		now = get_time();
 		local_irq_restore(flags);
 
-		if ((last ^ this) && (DELTA(loop, now) < loopout)) {
+		if ((last ^ this) && (delta(loop, now) < loopout)) {
 			data[i] = last ^ this;
 			time[i] = now;
 			i++;
 		}
 
-	} while (this && (i < 4) && (DELTA(start, now) < timeout));
+	} while (this && (i < 4) && (delta(start, now) < timeout));
 
 	this <<= 4;
 
@@ -266,7 +290,7 @@ static int analog_cooked_read(struct analog_port *port)
 		this |= data[i];
 		for (j = 0; j < 4; j++)
 			if (data[i] & (1 << j))
-				port->axes[j] = (DELTA(start, time[i]) << ANALOG_FUZZ_BITS) / port->loop;
+				port->axes[j] = (delta(start, time[i]) << ANALOG_FUZZ_BITS) / port->loop;
 	}
 
 	return -(this != port->mask);
@@ -365,31 +389,39 @@ static void analog_close(struct input_dev *dev)
 static void analog_calibrate_timer(struct analog_port *port)
 {
 	struct gameport *gameport = port->gameport;
-	unsigned int i, t, tx, t1, t2, t3;
+	unsigned int i, t, tx;
+	u64 t1, t2, t3;
 	unsigned long flags;
 
-	local_irq_save(flags);
-	GET_TIME(t1);
+	if (use_ktime) {
+		port->speed = 1000000;
+	} else {
+		local_irq_save(flags);
+		t1 = get_time();
 #ifdef FAKE_TIME
-	analog_faketime += 830;
+		analog_faketime += 830;
 #endif
-	mdelay(1);
-	GET_TIME(t2);
-	GET_TIME(t3);
-	local_irq_restore(flags);
+		mdelay(1);
+		t2 = get_time();
+		t3 = get_time();
+		local_irq_restore(flags);
 
-	port->speed = DELTA(t1, t2) - DELTA(t2, t3);
+		port->speed = delta(t1, t2) - delta(t2, t3);
+	}
 
 	tx = ~0;
 
 	for (i = 0; i < 50; i++) {
 		local_irq_save(flags);
-		GET_TIME(t1);
-		for (t = 0; t < 50; t++) { gameport_read(gameport); GET_TIME(t2); }
-		GET_TIME(t3);
+		t1 = get_time();
+		for (t = 0; t < 50; t++) {
+			gameport_read(gameport);
+			t2 = get_time();
+		}
+		t3 = get_time();
 		local_irq_restore(flags);
 		udelay(i);
-		t = DELTA(t1, t2) - DELTA(t2, t3);
+		t = delta(t1, t2) - delta(t2, t3);
 		if (t < tx) tx = t;
 	}
 
-- 
2.0.4


^ permalink raw reply related	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20 14:49           ` Dmitry Torokhov
@ 2014-08-21  7:16             ` Geert Uytterhoeven
  0 siblings, 0 replies; 23+ messages in thread
From: Geert Uytterhoeven @ 2014-08-21  7:16 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Takashi Iwai, Andreas Mohr, linux-input, linux-kernel,
	Vojtech Pavlik, Jiri Kosina

Hi Dmitry,

On Wed, Aug 20, 2014 at 4:49 PM, Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
> On Wed, Aug 20, 2014 at 02:15:30PM +0200, Takashi Iwai wrote:
>> At Wed, 20 Aug 2014 09:05:58 +0200,
>> Takashi Iwai wrote:
>> > Well, it worked on my test machine a year ago or so.  Maybe I had a
>> > good luck.
>>
>> FYI, now I tested again an analog joystick on SB Live put on a Dell
>> IvyBridge desktop with 3.17-rc1 x86-64 kernel, and it worked fine as
>> is.
>>
>> So it's not that broken.
>
> That's probably because in your system TSCs are stable when switching CPU
> frequency. Earlier systems had bunch of issues there IIRC.

>From the success stories above, it seems gameport doesn't work on only
a limited number of systems.

Perhaps the subsystem can fail with a big fat warning at runtime if such
a system is detected?

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20 12:15         ` Takashi Iwai
@ 2014-08-20 14:49           ` Dmitry Torokhov
  2014-08-21  7:16             ` Geert Uytterhoeven
  0 siblings, 1 reply; 23+ messages in thread
From: Dmitry Torokhov @ 2014-08-20 14:49 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

On Wed, Aug 20, 2014 at 02:15:30PM +0200, Takashi Iwai wrote:
> At Wed, 20 Aug 2014 09:05:58 +0200,
> Takashi Iwai wrote:
> > Well, it worked on my test machine a year ago or so.  Maybe I had a
> > good luck.
> 
> FYI, now I tested again an analog joystick on SB Live put on a Dell
> IvyBridge desktop with 3.17-rc1 x86-64 kernel, and it worked fine as
> is.
> 
> So it's not that broken.

That's probably because in your system TSCs are stable when switching CPU
frequency. Earlier systems had bunch of issues there IIRC.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20 14:27     ` Andreas Mohr
@ 2014-08-20 14:48       ` Dmitry Torokhov
  0 siblings, 0 replies; 23+ messages in thread
From: Dmitry Torokhov @ 2014-08-20 14:48 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: Takashi Iwai, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

On Wed, Aug 20, 2014 at 04:27:19PM +0200, Andreas Mohr wrote:
> > > > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > > > choice for longer times) would be affected by Cpufreq...
> > > > And there are no details on how exactly cpufreq is a problem or how this
> > > > timing issue could be fixed...
> > > 
> > > If you take a look at gameport_measure_speed() in gameport.c you will see that
> > > it counts cycles for timing, which obviously does not work that well when CPU
> > > frequency changes.
> > > 
> > > The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> > > stepped up to fix that.
> 
> He probably meant one issue filed about this problem here:
> "Direct use of tsc: Analog joystick doesn't work properly with CPU
> frequency scaling activated"
> https://bugzilla.kernel.org/show_bug.cgi?id=12297
> right?

Right. There is also about a3d joystick not workign and I think a few others.

> 
> > Hm, can't we just use the standard ktime for measuring the time diff?
> > And, I guess only few programs care the speed parameter.
> 
> For clocksource matters, I've got an initial patch for Azt3328 which
> adds its 1MHz timer as a clocksource, which probably means that on this
> hardware the gameport would be accurate for both digital and non-digital
> modes (not that that would help much for machines without this soundcard
> which also don't sport a high-res timer...).
> 
> Since I've got some more patches waiting for some gameport compatible
> soundcard devices, I should be able to take this opportunity to retest
> gameport support, too...
> And since there's in fact my VIA system which has my second azt3328 in
> its single-slot PCI and which in fact probably is a cpufreq system,
> I might be able to work on fixing the cpufreq timer issue (but if
> Vojtech managed to golden his offer to work on a fix to this issue, I
> would be far from unhappy :).
> 
> 
> 
> BTW, I think I spotted a bug in the gameport removal commit (one driver
> did an if (!joystick) ... where the subsequent line was removed as well
> even though logically it quite likely shouldn't).
> 
> 
> From my POV it would be much more favourable to do this relatively simple(??)
> timer fix rather than removing an entire subsystem since it's partially(?)
> broken.

Fair enough. If you send me patches that fixes issues then I do not see any
problem with it staying in. Vojtech also promised to dig out his old hardware.

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  6:09   ` Takashi Iwai
  2014-08-20  6:31     ` Dmitry Torokhov
@ 2014-08-20 14:27     ` Andreas Mohr
  2014-08-20 14:48       ` Dmitry Torokhov
  1 sibling, 1 reply; 23+ messages in thread
From: Andreas Mohr @ 2014-08-20 14:27 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Dmitry Torokhov, Andreas Mohr, linux-input, linux-kernel,
	Vojtech Pavlik, Jiri Kosina

Hi,

Sorry for having introduced a cut in discussion threading (broken
formatting which caused In-Reply-To header loss).

Will add several slightly disconnected items in single mail
due to restricted environment.

On Wed, Aug 20, 2014 at 08:09:49AM +0200, Takashi Iwai wrote:
> At Tue, 19 Aug 2014 22:18:15 -0700,
> Dmitry Torokhov wrote:
> > 
> > Hi Andreas,
> > 
> > On Wed, Aug 20, 2014 at 04:46:38AM +0200, Andreas Mohr wrote:
> > > drivers (where the ones I'm owning hardware of are intended to be in
> > > active maintenance)
> > 
> > Are you actively testing gameport interfaces with real joysticks/gamepads on
> > these cards? And what software is still in use that runs on these old boxes
> > (with mainline kernel)?
> 
> MPlayer and some programs have the joystick interface (even often
> activated as default), IIRC.  I don't use it.  But I tested it
> sometime ago.

BTW, I have a slightly extended vested interest in that topic since I
did initial joystick driver support on Wine, too...
(Read: there is the possibility of using many Windows apps with their
joystick support, too - not to mention the various arcade emulators
which probably have that as well).

> > > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > > choice for longer times) would be affected by Cpufreq...
> > > And there are no details on how exactly cpufreq is a problem or how this
> > > timing issue could be fixed...
> > 
> > If you take a look at gameport_measure_speed() in gameport.c you will see that
> > it counts cycles for timing, which obviously does not work that well when CPU
> > frequency changes.
> > 
> > The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> > stepped up to fix that.

He probably meant one issue filed about this problem here:
"Direct use of tsc: Analog joystick doesn't work properly with CPU
frequency scaling activated"
https://bugzilla.kernel.org/show_bug.cgi?id=12297
right?

> Hm, can't we just use the standard ktime for measuring the time diff?
> And, I guess only few programs care the speed parameter.

For clocksource matters, I've got an initial patch for Azt3328 which
adds its 1MHz timer as a clocksource, which probably means that on this
hardware the gameport would be accurate for both digital and non-digital
modes (not that that would help much for machines without this soundcard
which also don't sport a high-res timer...).

Since I've got some more patches waiting for some gameport compatible
soundcard devices, I should be able to take this opportunity to retest
gameport support, too...
And since there's in fact my VIA system which has my second azt3328 in
its single-slot PCI and which in fact probably is a cpufreq system,
I might be able to work on fixing the cpufreq timer issue (but if
Vojtech managed to golden his offer to work on a fix to this issue, I
would be far from unhappy :).



BTW, I think I spotted a bug in the gameport removal commit (one driver
did an if (!joystick) ... where the subsequent line was removed as well
even though logically it quite likely shouldn't).


>From my POV it would be much more favourable to do this relatively simple(??)
timer fix rather than removing an entire subsystem since it's partially(?)
broken.

Andreas Mohr

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20 12:29         ` One Thousand Gnomes
@ 2014-08-20 12:53           ` Geert Uytterhoeven
  0 siblings, 0 replies; 23+ messages in thread
From: Geert Uytterhoeven @ 2014-08-20 12:53 UTC (permalink / raw)
  To: One Thousand Gnomes
  Cc: Takashi Iwai, Dmitry Torokhov, Andreas Mohr, linux-input,
	linux-kernel, Vojtech Pavlik, Jiri Kosina

On Wed, Aug 20, 2014 at 2:29 PM, One Thousand Gnomes
<gnomes@lxorguk.ukuu.org.uk> wrote:
>> It's the gameport core code that is currently broken under some
>> situation, right?  If so, marking it as broken is the first step, and
>> we don't need to touch else.  We may fix it later, or we may not.  If
>> the thing isn't improved, then we can drop the whole stuff.
>
> It's only broken on x86 with frequency changing. x86 is not the only
> platform with ISA or PCI bus or gameports.
>
> It really ought to go via staging, and the other arch maintainers be
> asked. The m68k and mips world does include a department of relics and
> retro-computing 8)

It seems there are no m68k-specific drivers with gameport support...

Good, let's kill all joystick ports that are newer than ports with 2600-style
connectors ;-)

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  7:05       ` Takashi Iwai
  2014-08-20 12:15         ` Takashi Iwai
@ 2014-08-20 12:29         ` One Thousand Gnomes
  2014-08-20 12:53           ` Geert Uytterhoeven
  2014-08-21 11:29         ` Takashi Iwai
  2 siblings, 1 reply; 23+ messages in thread
From: One Thousand Gnomes @ 2014-08-20 12:29 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Dmitry Torokhov, Andreas Mohr, linux-input, linux-kernel,
	Vojtech Pavlik, Jiri Kosina

> It's the gameport core code that is currently broken under some
> situation, right?  If so, marking it as broken is the first step, and
> we don't need to touch else.  We may fix it later, or we may not.  If
> the thing isn't improved, then we can drop the whole stuff.

It's only broken on x86 with frequency changing. x86 is not the only
platform with ISA or PCI bus or gameports.

It really ought to go via staging, and the other arch maintainers be
asked. The m68k and mips world does include a department of relics and
retro-computing 8)

I suspect nobody cares however.

Alan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  6:39   ` Vojtech Pavlik
@ 2014-08-20 12:20     ` One Thousand Gnomes
  0 siblings, 0 replies; 23+ messages in thread
From: One Thousand Gnomes @ 2014-08-20 12:20 UTC (permalink / raw)
  To: Vojtech Pavlik
  Cc: Dmitry Torokhov, Andreas Mohr, linux-input, linux-kernel,
	Jiri Kosina, Takashi Iwai

> It wouldn't be hard to fix: That code was developed when the timing
> infrastructure in the kernel was non-existent, making use of it today
> would make things a lot easier.

You can also use pm_qos on most machines to stop PM messing it up. Ugly
but works.

Alan

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  7:05       ` Takashi Iwai
@ 2014-08-20 12:15         ` Takashi Iwai
  2014-08-20 14:49           ` Dmitry Torokhov
  2014-08-20 12:29         ` One Thousand Gnomes
  2014-08-21 11:29         ` Takashi Iwai
  2 siblings, 1 reply; 23+ messages in thread
From: Takashi Iwai @ 2014-08-20 12:15 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

At Wed, 20 Aug 2014 09:05:58 +0200,
Takashi Iwai wrote:
> Well, it worked on my test machine a year ago or so.  Maybe I had a
> good luck.

FYI, now I tested again an analog joystick on SB Live put on a Dell
IvyBridge desktop with 3.17-rc1 x86-64 kernel, and it worked fine as
is.

So it's not that broken.


Takashi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  6:31     ` Dmitry Torokhov
@ 2014-08-20  7:05       ` Takashi Iwai
  2014-08-20 12:15         ` Takashi Iwai
                           ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Takashi Iwai @ 2014-08-20  7:05 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

At Tue, 19 Aug 2014 23:31:30 -0700,
Dmitry Torokhov wrote:
> 
> On Wed, Aug 20, 2014 at 08:09:49AM +0200, Takashi Iwai wrote:
> > At Tue, 19 Aug 2014 22:18:15 -0700,
> > Dmitry Torokhov wrote:
> > > 
> > > Hi Andreas,
> > > 
> > > On Wed, Aug 20, 2014 at 04:46:38AM +0200, Andreas Mohr wrote:
> > > 
> > > > Hi,
> > > > 
> > > > > Gameport support hasn't been working well ever since cpufreq became
> > > > > mainstream and it becomes increasingly hard to find hardware and
> > > > > software
> > > > > that would run on such old hardware.
> > > > 
> > > > Given that I'm puzzled why one would want to deprecate a whole subsystem
> > > > which appears to be supported by a whole 14 different PCI sound card
> > > > drivers (where the ones I'm owning hardware of are intended to be in
> > > > active maintenance)
> > > 
> > > Are you actively testing gameport interfaces with real joysticks/gamepads on
> > > these cards? And what software is still in use that runs on these old boxes
> > > (with mainline kernel)?
> > 
> > MPlayer and some programs have the joystick interface (even often
> > activated as default), IIRC.  I don't use it.  But I tested it
> > sometime ago.
> 
> But we are not dropping joystick support, you can still use USB, BT, etc
> joysticks. It is only gameport joysticks that I think are pretty much extinct
> by now.

They are dying, I agree.  But is it really extinct?  It's hard to
judge.

> > > > and only 3 ISA-based ones, I'm missing several
> > > > details and justifications of that decision here (perhaps there was a
> > > > prior discussion/activity that I'm missing?).
> > > 
> > > There was a post to linux-input a few days ago when I ased if anyone woudl cry
> > > over gameport going away.
> > 
> > Well, asking the usage in the devel ML isn't enough, I'm afraid.
> > ML is only for a small group of developers, where no user cares unless
> > they hit a problem.
> 
> That is true, but what is better venue? Even disabling in Kconfig won't help
> much as distros will re-enable it and users do not compile their own kernels.

I meant to statically disable Kconfig, or just "depends on BROKEN".
Only user who edits Kconfig and build the kernel can enable it again.

> > > > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > > > choice for longer times) would be affected by Cpufreq...
> > > > And there are no details on how exactly cpufreq is a problem or how this
> > > > timing issue could be fixed...
> > > 
> > > If you take a look at gameport_measure_speed() in gameport.c you will see that
> > > it counts cycles for timing, which obviously does not work that well when CPU
> > > frequency changes.
> > > 
> > > The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> > > stepped up to fix that.
> > 
> > Hm, can't we just use the standard ktime for measuring the time diff?
> 
> We could use high-res timers, if they are available. Are they available on such
> old hardware and are they sufficiently fast to provide needed timings? I
> definitely do not have any hardware to est with.

The boards aren't necessarily bound with the old hardware.  PCI boards
run fine on the modern machines if they still have a PCI slot (how
lucky).  And, the highres timer itself isn't so new...

> > And, I guess only few programs care the speed parameter.
> 
> It is not programs that care about speed parameter, it is joystick kernel
> drivers that need it to time access.

OK.

> > > > The obvious workaround for such an ensuing dearth of hardware support
> > > > could be USB 15-pin gameport adapters - but are they even supported on
> > > > Linux? Haven't seen info on this...
> > > > And even if supported, these adapters (at least the non-perfect ones, as
> > > > can be seen from reviews on a well-known online shop site) are said to
> > > > be hit-or-miss.
> > > > 
> > > > http://www.flightsim.com/vbfs/showthread.php?238938-joystick-GamePort-to-USB-adapter-question
> > > > http://reviews.thesource.ca/9026/2600164/nexxtech-usb-gameport-adapter-reviews/reviews.htm
> > > > 
> > > 
> > > They have better chance of being supported ;) I had a couple a few years back
> > > and they did work for me.
> > > 
> > > > If we keep removing functionality like this, then why stop short of
> > > > removing x86 32bit as a whole? By having Linux support nicely restricted
> > > > to hardware made within the last 5 years, we would surely be doing the
> > > > planned-obsolescence Micro$oft "ecosystem" (what was ecological about
> > > > this again?) a huge favour...
> > > 
> > > I really do not care about Microsoft and favors, I just go by the fact that
> > > this hardware is becoming naturally extinct. And not only hardware, but also
> > > software that uses it. Do you still play a lot of games with joysticks on such
> > > hardware?
> > 
> > IMO, the number of users is less relevant for such an action.  Even if
> > there're only a few users, users do exist.
> > 
> > But, if the code maintenance becomes a too big burden, it's time to
> > think of code removal.  Is this the case?  Really difficult to keep
> > the code?
> 
> We can keep it, but it is pretty much broken, so why?

Well, it worked on my test machine a year ago or so.  Maybe I had a
good luck.

It's the gameport core code that is currently broken under some
situation, right?  If so, marking it as broken is the first step, and
we don't need to touch else.  We may fix it later, or we may not.  If
the thing isn't improved, then we can drop the whole stuff.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  5:18 ` Dmitry Torokhov
  2014-08-20  5:50   ` Andreas Mohr
  2014-08-20  6:09   ` Takashi Iwai
@ 2014-08-20  6:39   ` Vojtech Pavlik
  2014-08-20 12:20     ` One Thousand Gnomes
  2 siblings, 1 reply; 23+ messages in thread
From: Vojtech Pavlik @ 2014-08-20  6:39 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Mohr, linux-input, linux-kernel, Jiri Kosina, Takashi Iwai

On Tue, Aug 19, 2014 at 10:18:15PM -0700, Dmitry Torokhov wrote:

> Are you actively testing gameport interfaces with real joysticks/gamepads on
> these cards? And what software is still in use that runs on these old boxes
> (with mainline kernel)?

I still do have a huge box of gameport hardware in my office, it's just
that I haven't opened it for a number of years. However, if this thread
spurred enough interest in gameport devices, I would be willing to open
it and do the needed fixes.

If not, I think dropping makes sense. I still would shed a tear for all
those weird devices in the box, and possibly design an ATMega-based
USB<->Gameport adapter that actually works and supports even the digital
joysticks.

> > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > choice for longer times) would be affected by Cpufreq...
> > And there are no details on how exactly cpufreq is a problem or how this
> > timing issue could be fixed...
> 
> If you take a look at gameport_measure_speed() in gameport.c you will see that
> it counts cycles for timing, which obviously does not work that well when CPU
> frequency changes.
> 
> The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> stepped up to fix that.

It wouldn't be hard to fix: That code was developed when the timing
infrastructure in the kernel was non-existent, making use of it today
would make things a lot easier.

> > The obvious workaround for such an ensuing dearth of hardware support
> > could be USB 15-pin gameport adapters - but are they even supported on
> > Linux? Haven't seen info on this...
> > And even if supported, these adapters (at least the non-perfect ones, as
> > can be seen from reviews on a well-known online shop site) are said to
> > be hit-or-miss.
> > 
> > http://www.flightsim.com/vbfs/showthread.php?238938-joystick-GamePort-to-USB-adapter-question
> > http://reviews.thesource.ca/9026/2600164/nexxtech-usb-gameport-adapter-reviews/reviews.htm
> > 
> 
> They have better chance of being supported ;) I had a couple a few years back
> and they did work for me.

They do work for analog joysticks if you don't want any extended
functionality. I have a couple in said box.

-- 
Vojtech Pavlik
Director SuSE Labs

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  6:09   ` Takashi Iwai
@ 2014-08-20  6:31     ` Dmitry Torokhov
  2014-08-20  7:05       ` Takashi Iwai
  2014-08-20 14:27     ` Andreas Mohr
  1 sibling, 1 reply; 23+ messages in thread
From: Dmitry Torokhov @ 2014-08-20  6:31 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

On Wed, Aug 20, 2014 at 08:09:49AM +0200, Takashi Iwai wrote:
> At Tue, 19 Aug 2014 22:18:15 -0700,
> Dmitry Torokhov wrote:
> > 
> > Hi Andreas,
> > 
> > On Wed, Aug 20, 2014 at 04:46:38AM +0200, Andreas Mohr wrote:
> > 
> > > Hi,
> > > 
> > > > Gameport support hasn't been working well ever since cpufreq became
> > > > mainstream and it becomes increasingly hard to find hardware and
> > > > software
> > > > that would run on such old hardware.
> > > 
> > > Given that I'm puzzled why one would want to deprecate a whole subsystem
> > > which appears to be supported by a whole 14 different PCI sound card
> > > drivers (where the ones I'm owning hardware of are intended to be in
> > > active maintenance)
> > 
> > Are you actively testing gameport interfaces with real joysticks/gamepads on
> > these cards? And what software is still in use that runs on these old boxes
> > (with mainline kernel)?
> 
> MPlayer and some programs have the joystick interface (even often
> activated as default), IIRC.  I don't use it.  But I tested it
> sometime ago.

But we are not dropping joystick support, you can still use USB, BT, etc
joysticks. It is only gameport joysticks that I think are pretty much extinct
by now.

> 
> > > and only 3 ISA-based ones, I'm missing several
> > > details and justifications of that decision here (perhaps there was a
> > > prior discussion/activity that I'm missing?).
> > 
> > There was a post to linux-input a few days ago when I ased if anyone woudl cry
> > over gameport going away.
> 
> Well, asking the usage in the devel ML isn't enough, I'm afraid.
> ML is only for a small group of developers, where no user cares unless
> they hit a problem.

That is true, but what is better venue? Even disabling in Kconfig won't help
much as distros will re-enable it and users do not compile their own kernels.

> 
> > > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > > choice for longer times) would be affected by Cpufreq...
> > > And there are no details on how exactly cpufreq is a problem or how this
> > > timing issue could be fixed...
> > 
> > If you take a look at gameport_measure_speed() in gameport.c you will see that
> > it counts cycles for timing, which obviously does not work that well when CPU
> > frequency changes.
> > 
> > The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> > stepped up to fix that.
> 
> Hm, can't we just use the standard ktime for measuring the time diff?

We could use high-res timers, if they are available. Are they available on such
old hardware and are they sufficiently fast to provide needed timings? I
definitely do not have any hardware to est with.

> And, I guess only few programs care the speed parameter.

It is not programs that care about speed parameter, it is joystick kernel
drivers that need it to time access.

> 
> 
> > > The obvious workaround for such an ensuing dearth of hardware support
> > > could be USB 15-pin gameport adapters - but are they even supported on
> > > Linux? Haven't seen info on this...
> > > And even if supported, these adapters (at least the non-perfect ones, as
> > > can be seen from reviews on a well-known online shop site) are said to
> > > be hit-or-miss.
> > > 
> > > http://www.flightsim.com/vbfs/showthread.php?238938-joystick-GamePort-to-USB-adapter-question
> > > http://reviews.thesource.ca/9026/2600164/nexxtech-usb-gameport-adapter-reviews/reviews.htm
> > > 
> > 
> > They have better chance of being supported ;) I had a couple a few years back
> > and they did work for me.
> > 
> > > If we keep removing functionality like this, then why stop short of
> > > removing x86 32bit as a whole? By having Linux support nicely restricted
> > > to hardware made within the last 5 years, we would surely be doing the
> > > planned-obsolescence Micro$oft "ecosystem" (what was ecological about
> > > this again?) a huge favour...
> > 
> > I really do not care about Microsoft and favors, I just go by the fact that
> > this hardware is becoming naturally extinct. And not only hardware, but also
> > software that uses it. Do you still play a lot of games with joysticks on such
> > hardware?
> 
> IMO, the number of users is less relevant for such an action.  Even if
> there're only a few users, users do exist.
> 
> But, if the code maintenance becomes a too big burden, it's time to
> think of code removal.  Is this the case?  Really difficult to keep
> the code?

We can keep it, but it is pretty much broken, so why?

Thanks.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  5:18 ` Dmitry Torokhov
  2014-08-20  5:50   ` Andreas Mohr
@ 2014-08-20  6:09   ` Takashi Iwai
  2014-08-20  6:31     ` Dmitry Torokhov
  2014-08-20 14:27     ` Andreas Mohr
  2014-08-20  6:39   ` Vojtech Pavlik
  2 siblings, 2 replies; 23+ messages in thread
From: Takashi Iwai @ 2014-08-20  6:09 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina

At Tue, 19 Aug 2014 22:18:15 -0700,
Dmitry Torokhov wrote:
> 
> Hi Andreas,
> 
> On Wed, Aug 20, 2014 at 04:46:38AM +0200, Andreas Mohr wrote:
> 
> > Hi,
> > 
> > > Gameport support hasn't been working well ever since cpufreq became
> > > mainstream and it becomes increasingly hard to find hardware and
> > > software
> > > that would run on such old hardware.
> > 
> > Given that I'm puzzled why one would want to deprecate a whole subsystem
> > which appears to be supported by a whole 14 different PCI sound card
> > drivers (where the ones I'm owning hardware of are intended to be in
> > active maintenance)
> 
> Are you actively testing gameport interfaces with real joysticks/gamepads on
> these cards? And what software is still in use that runs on these old boxes
> (with mainline kernel)?

MPlayer and some programs have the joystick interface (even often
activated as default), IIRC.  I don't use it.  But I tested it
sometime ago.

> > and only 3 ISA-based ones, I'm missing several
> > details and justifications of that decision here (perhaps there was a
> > prior discussion/activity that I'm missing?).
> 
> There was a post to linux-input a few days ago when I ased if anyone woudl cry
> over gameport going away.

Well, asking the usage in the devel ML isn't enough, I'm afraid.
ML is only for a small group of developers, where no user cares unless
they hit a problem.

> > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > choice for longer times) would be affected by Cpufreq...
> > And there are no details on how exactly cpufreq is a problem or how this
> > timing issue could be fixed...
> 
> If you take a look at gameport_measure_speed() in gameport.c you will see that
> it counts cycles for timing, which obviously does not work that well when CPU
> frequency changes.
> 
> The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> stepped up to fix that.

Hm, can't we just use the standard ktime for measuring the time diff?
And, I guess only few programs care the speed parameter.


> > The obvious workaround for such an ensuing dearth of hardware support
> > could be USB 15-pin gameport adapters - but are they even supported on
> > Linux? Haven't seen info on this...
> > And even if supported, these adapters (at least the non-perfect ones, as
> > can be seen from reviews on a well-known online shop site) are said to
> > be hit-or-miss.
> > 
> > http://www.flightsim.com/vbfs/showthread.php?238938-joystick-GamePort-to-USB-adapter-question
> > http://reviews.thesource.ca/9026/2600164/nexxtech-usb-gameport-adapter-reviews/reviews.htm
> > 
> 
> They have better chance of being supported ;) I had a couple a few years back
> and they did work for me.
> 
> > If we keep removing functionality like this, then why stop short of
> > removing x86 32bit as a whole? By having Linux support nicely restricted
> > to hardware made within the last 5 years, we would surely be doing the
> > planned-obsolescence Micro$oft "ecosystem" (what was ecological about
> > this again?) a huge favour...
> 
> I really do not care about Microsoft and favors, I just go by the fact that
> this hardware is becoming naturally extinct. And not only hardware, but also
> software that uses it. Do you still play a lot of games with joysticks on such
> hardware?

IMO, the number of users is less relevant for such an action.  Even if
there're only a few users, users do exist.

But, if the code maintenance becomes a too big burden, it's time to
think of code removal.  Is this the case?  Really difficult to keep
the code?

Last but not least, the usual steps for such a big deprecation is to
disable the build in Kconfig at first, watch out for a couple of
release cycles, then drop the actual codes.  Dropping the whole stuff
from the beginning is too risky, especially if there is no
alternative.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  5:18 ` Dmitry Torokhov
@ 2014-08-20  5:50   ` Andreas Mohr
  2014-08-20  6:09   ` Takashi Iwai
  2014-08-20  6:39   ` Vojtech Pavlik
  2 siblings, 0 replies; 23+ messages in thread
From: Andreas Mohr @ 2014-08-20  5:50 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: Andreas Mohr, linux-input, linux-kernel, Vojtech Pavlik,
	Jiri Kosina, Takashi Iwai

On Tue, Aug 19, 2014 at 10:18:15PM -0700, Dmitry Torokhov wrote:
> Hi Andreas,
> 
> On Wed, Aug 20, 2014 at 04:46:38AM +0200, Andreas Mohr wrote:
> 
> > Hi,
> > 
> > > Gameport support hasn't been working well ever since cpufreq became
> > > mainstream and it becomes increasingly hard to find hardware and
> > > software
> > > that would run on such old hardware.
> > 
> > Given that I'm puzzled why one would want to deprecate a whole subsystem
> > which appears to be supported by a whole 14 different PCI sound card
> > drivers (where the ones I'm owning hardware of are intended to be in
> > active maintenance)
> 
> Are you actively testing gameport interfaces with real joysticks/gamepads on
> these cards? And what software is still in use that runs on these old boxes
> (with mainline kernel)?

Well, I did test some games with real joysticks
e.g. in order to implement working Digital Enhanced Game Port support
(where BTW the couple cards/driver combos which support that
should also be completely unaffected by cpufreq
since its delay accounting is digital).


> > and only 3 ISA-based ones, I'm missing several
> > details and justifications of that decision here (perhaps there was a
> > prior discussion/activity that I'm missing?).
> 
> There was a post to linux-input a few days ago when I ased if anyone woudl cry
> over gameport going away.

Missed that one (not subscribed), sorry.

> > Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> > choice for longer times) would be affected by Cpufreq...
> > And there are no details on how exactly cpufreq is a problem or how this
> > timing issue could be fixed...
> 
> If you take a look at gameport_measure_speed() in gameport.c you will see that
> it counts cycles for timing, which obviously does not work that well when CPU
> frequency changes.

Yup, but at least not for the candidates above.

> The bugs have been opened in bugzilla/reported on lists ages ago but nobody
> stepped up to fix that.

Ouch.
I'm afraid I don't have any cpufreq-supporting hardware (hint, hint)
which would enable me to work on it, though.

> > The obvious workaround for such an ensuing dearth of hardware support
> > could be USB 15-pin gameport adapters - but are they even supported on
> > Linux? Haven't seen info on this...
> > And even if supported, these adapters (at least the non-perfect ones, as
> > can be seen from reviews on a well-known online shop site) are said to
> > be hit-or-miss.

> They have better chance of being supported ;) I had a couple a few years back
> and they did work for me.

Good to know. I took a note to buy a good adapter as well.

> > If we keep removing functionality like this, then why stop short of
> > removing x86 32bit as a whole? By having Linux support nicely restricted
> > to hardware made within the last 5 years, we would surely be doing the
> > planned-obsolescence Micro$oft "ecosystem" (what was ecological about
> > this again?) a huge favour...
> 
> I really do not care about Microsoft and favors, I just go by the fact that
> this hardware is becoming naturally extinct. And not only hardware, but also
> software that uses it. Do you still play a lot of games with joysticks on such
> hardware?

Not me (I'm a developer). But other people probably would be inclined to
do so, as long as sufficient support remains in place,
on an architecture which is still in very wide use.
And this case here (as opposed to e.g. the NI5010 ISA BNC network
card where it was arguably very likely that it was totally unused)
seems like a self-fulfilling prophecy...

Andreas Mohr

-- 
GNU/Linux. It's not the software that's free, it's you.

^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
  2014-08-20  2:46 Andreas Mohr
@ 2014-08-20  5:18 ` Dmitry Torokhov
  2014-08-20  5:50   ` Andreas Mohr
                     ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Dmitry Torokhov @ 2014-08-20  5:18 UTC (permalink / raw)
  To: Andreas Mohr
  Cc: linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina, Takashi Iwai

Hi Andreas,

On Wed, Aug 20, 2014 at 04:46:38AM +0200, Andreas Mohr wrote:

> Hi,
> 
> > Gameport support hasn't been working well ever since cpufreq became
> > mainstream and it becomes increasingly hard to find hardware and
> > software
> > that would run on such old hardware.
> 
> Given that I'm puzzled why one would want to deprecate a whole subsystem
> which appears to be supported by a whole 14 different PCI sound card
> drivers (where the ones I'm owning hardware of are intended to be in
> active maintenance)

Are you actively testing gameport interfaces with real joysticks/gamepads on
these cards? And what software is still in use that runs on these old boxes
(with mainline kernel)?

> and only 3 ISA-based ones, I'm missing several
> details and justifications of that decision here (perhaps there was a
> prior discussion/activity that I'm missing?).

There was a post to linux-input a few days ago when I ased if anyone woudl cry
over gameport going away.

> 
> Also, I'm left wondering why e.g. my Athlon XP system (a very popular
> choice for longer times) would be affected by Cpufreq...
> And there are no details on how exactly cpufreq is a problem or how this
> timing issue could be fixed...

If you take a look at gameport_measure_speed() in gameport.c you will see that
it counts cycles for timing, which obviously does not work that well when CPU
frequency changes.

The bugs have been opened in bugzilla/reported on lists ages ago but nobody
stepped up to fix that.

> The obvious workaround for such an ensuing dearth of hardware support
> could be USB 15-pin gameport adapters - but are they even supported on
> Linux? Haven't seen info on this...
> And even if supported, these adapters (at least the non-perfect ones, as
> can be seen from reviews on a well-known online shop site) are said to
> be hit-or-miss.
> 
> http://www.flightsim.com/vbfs/showthread.php?238938-joystick-GamePort-to-USB-adapter-question
> http://reviews.thesource.ca/9026/2600164/nexxtech-usb-gameport-adapter-reviews/reviews.htm
> 

They have better chance of being supported ;) I had a couple a few years back
and they did work for me.

> If we keep removing functionality like this, then why stop short of
> removing x86 32bit as a whole? By having Linux support nicely restricted
> to hardware made within the last 5 years, we would surely be doing the
> planned-obsolescence Micro$oft "ecosystem" (what was ecological about
> this again?) a huge favour...

I really do not care about Microsoft and favors, I just go by the fact that
this hardware is becoming naturally extinct. And not only hardware, but also
software that uses it. Do you still play a lot of games with joysticks on such
hardware?

Thanks.

-- 
Dmitry



^ permalink raw reply	[flat|nested] 23+ messages in thread

* Re: [PATCH 1/2] SOUND: kill gameport bits
@ 2014-08-20  2:46 Andreas Mohr
  2014-08-20  5:18 ` Dmitry Torokhov
  0 siblings, 1 reply; 23+ messages in thread
From: Andreas Mohr @ 2014-08-20  2:46 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-input, linux-kernel, Vojtech Pavlik, Jiri Kosina, Takashi Iwai

Reply-To: 
In-Reply-To: <1408466497-25640-1-git-send-email-dmitry.torokhov@gmail.com>
X-Priority: none

Hi,

> Gameport support hasn't been working well ever since cpufreq became
> mainstream and it becomes increasingly hard to find hardware and
> software
> that would run on such old hardware.

Given that I'm puzzled why one would want to deprecate a whole subsystem
which appears to be supported by a whole 14 different PCI sound card
drivers (where the ones I'm owning hardware of are intended to be in
active maintenance) and only 3 ISA-based ones, I'm missing several
details and justifications of that decision here (perhaps there was a
prior discussion/activity that I'm missing?).

Also, I'm left wondering why e.g. my Athlon XP system (a very popular
choice for longer times) would be affected by Cpufreq...
And there are no details on how exactly cpufreq is a problem or how this
timing issue could be fixed...
The obvious workaround for such an ensuing dearth of hardware support
could be USB 15-pin gameport adapters - but are they even supported on
Linux? Haven't seen info on this...
And even if supported, these adapters (at least the non-perfect ones, as
can be seen from reviews on a well-known online shop site) are said to
be hit-or-miss.

http://www.flightsim.com/vbfs/showthread.php?238938-joystick-GamePort-to-USB-adapter-question
http://reviews.thesource.ca/9026/2600164/nexxtech-usb-gameport-adapter-reviews/reviews.htm

If we keep removing functionality like this, then why stop short of
removing x86 32bit as a whole? By having Linux support nicely restricted
to hardware made within the last 5 years, we would surely be doing the
planned-obsolescence Micro$oft "ecosystem" (what was ecological about
this again?) a huge favour...

We already have an IMHO dangerous state in support of somewhat less mainstream
hardware, so do we want to keep furthering that?

Could we have more details/discussion prior to activities to remove
whole subsystems?

Thanks,

Andreas Mohr

-- 
GNU/Linux. It's not the software that's free, it's you.

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-08-28 21:10 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-19 16:41 [PATCH 1/2] SOUND: kill gameport bits Dmitry Torokhov
2014-08-19 16:41 ` [PATCH 2/2] Input: remove gameport subsystem Dmitry Torokhov
2014-08-20  7:33 ` [PATCH 1/2] SOUND: kill gameport bits Clemens Ladisch
2014-08-20  2:46 Andreas Mohr
2014-08-20  5:18 ` Dmitry Torokhov
2014-08-20  5:50   ` Andreas Mohr
2014-08-20  6:09   ` Takashi Iwai
2014-08-20  6:31     ` Dmitry Torokhov
2014-08-20  7:05       ` Takashi Iwai
2014-08-20 12:15         ` Takashi Iwai
2014-08-20 14:49           ` Dmitry Torokhov
2014-08-21  7:16             ` Geert Uytterhoeven
2014-08-20 12:29         ` One Thousand Gnomes
2014-08-20 12:53           ` Geert Uytterhoeven
2014-08-21 11:29         ` Takashi Iwai
2014-08-24  5:07           ` Andreas Mohr
2014-08-25  7:13             ` Takashi Iwai
2014-08-28 20:03               ` Clemens Ladisch
2014-08-28 21:11                 ` Vojtech Pavlik
2014-08-20 14:27     ` Andreas Mohr
2014-08-20 14:48       ` Dmitry Torokhov
2014-08-20  6:39   ` Vojtech Pavlik
2014-08-20 12:20     ` One Thousand Gnomes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).