grip_mp.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689
  1. /*
  2. * Driver for the Gravis Grip Multiport, a gamepad "hub" that
  3. * connects up to four 9-pin digital gamepads/joysticks.
  4. * Driver tested on SMP and UP kernel versions 2.4.18-4 and 2.4.18-5.
  5. *
  6. * Thanks to Chris Gassib for helpful advice.
  7. *
  8. * Copyright (c) 2002 Brian Bonnlander, Bill Soudan
  9. * Copyright (c) 1998-2000 Vojtech Pavlik
  10. */
  11. #include <linux/kernel.h>
  12. #include <linux/module.h>
  13. #include <linux/slab.h>
  14. #include <linux/gameport.h>
  15. #include <linux/input.h>
  16. #include <linux/delay.h>
  17. #include <linux/proc_fs.h>
  18. #include <linux/jiffies.h>
  19. #define DRIVER_DESC "Gravis Grip Multiport driver"
  20. MODULE_AUTHOR("Brian Bonnlander");
  21. MODULE_DESCRIPTION(DRIVER_DESC);
  22. MODULE_LICENSE("GPL");
  23. #ifdef GRIP_DEBUG
  24. #define dbg(format, arg...) printk(KERN_ERR __FILE__ ": " format "\n" , ## arg)
  25. #else
  26. #define dbg(format, arg...) do {} while (0)
  27. #endif
  28. #define GRIP_MAX_PORTS 4
  29. /*
  30. * Grip multiport state
  31. */
  32. struct grip_port {
  33. struct input_dev *dev;
  34. int mode;
  35. int registered;
  36. /* individual gamepad states */
  37. int buttons;
  38. int xaxes;
  39. int yaxes;
  40. int dirty; /* has the state been updated? */
  41. };
  42. struct grip_mp {
  43. struct gameport *gameport;
  44. struct grip_port *port[GRIP_MAX_PORTS];
  45. int reads;
  46. int bads;
  47. };
  48. /*
  49. * Multiport packet interpretation
  50. */
  51. #define PACKET_FULL 0x80000000 /* packet is full */
  52. #define PACKET_IO_FAST 0x40000000 /* 3 bits per gameport read */
  53. #define PACKET_IO_SLOW 0x20000000 /* 1 bit per gameport read */
  54. #define PACKET_MP_MORE 0x04000000 /* multiport wants to send more */
  55. #define PACKET_MP_DONE 0x02000000 /* multiport done sending */
  56. /*
  57. * Packet status code interpretation
  58. */
  59. #define IO_GOT_PACKET 0x0100 /* Got a packet */
  60. #define IO_MODE_FAST 0x0200 /* Used 3 data bits per gameport read */
  61. #define IO_SLOT_CHANGE 0x0800 /* Multiport physical slot status changed */
  62. #define IO_DONE 0x1000 /* Multiport is done sending packets */
  63. #define IO_RETRY 0x4000 /* Try again later to get packet */
  64. #define IO_RESET 0x8000 /* Force multiport to resend all packets */
  65. /*
  66. * Gamepad configuration data. Other 9-pin digital joystick devices
  67. * may work with the multiport, so this may not be an exhaustive list!
  68. * Commodore 64 joystick remains untested.
  69. */
  70. #define GRIP_INIT_DELAY 2000 /* 2 ms */
  71. #define GRIP_MODE_NONE 0
  72. #define GRIP_MODE_RESET 1
  73. #define GRIP_MODE_GP 2
  74. #define GRIP_MODE_C64 3
  75. static const int grip_btn_gp[] = { BTN_TR, BTN_TL, BTN_A, BTN_B, BTN_C, BTN_X, BTN_Y, BTN_Z, -1 };
  76. static const int grip_btn_c64[] = { BTN_JOYSTICK, -1 };
  77. static const int grip_abs_gp[] = { ABS_X, ABS_Y, -1 };
  78. static const int grip_abs_c64[] = { ABS_X, ABS_Y, -1 };
  79. static const int *grip_abs[] = { NULL, NULL, grip_abs_gp, grip_abs_c64 };
  80. static const int *grip_btn[] = { NULL, NULL, grip_btn_gp, grip_btn_c64 };
  81. static const char *grip_name[] = { NULL, NULL, "Gravis Grip Pad", "Commodore 64 Joystick" };
  82. static const int init_seq[] = {
  83. 1, 0, 1, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1,
  84. 1, 0, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1, 0, 1, 1,
  85. 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1,
  86. 0, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1 };
  87. /* Maps multiport directional values to X,Y axis values (each axis encoded in 3 bits) */
  88. static const int axis_map[] = { 5, 9, 1, 5, 6, 10, 2, 6, 4, 8, 0, 4, 5, 9, 1, 5 };
  89. static int register_slot(int i, struct grip_mp *grip);
  90. /*
  91. * Returns whether an odd or even number of bits are on in pkt.
  92. */
  93. static int bit_parity(u32 pkt)
  94. {
  95. int x = pkt ^ (pkt >> 16);
  96. x ^= x >> 8;
  97. x ^= x >> 4;
  98. x ^= x >> 2;
  99. x ^= x >> 1;
  100. return x & 1;
  101. }
  102. /*
  103. * Poll gameport; return true if all bits set in 'onbits' are on and
  104. * all bits set in 'offbits' are off.
  105. */
  106. static inline int poll_until(u8 onbits, u8 offbits, int u_sec, struct gameport* gp, u8 *data)
  107. {
  108. int i, nloops;
  109. nloops = gameport_time(gp, u_sec);
  110. for (i = 0; i < nloops; i++) {
  111. *data = gameport_read(gp);
  112. if ((*data & onbits) == onbits &&
  113. (~(*data) & offbits) == offbits)
  114. return 1;
  115. }
  116. dbg("gameport timed out after %d microseconds.\n", u_sec);
  117. return 0;
  118. }
  119. /*
  120. * Gets a 28-bit packet from the multiport.
  121. *
  122. * After getting a packet successfully, commands encoded by sendcode may
  123. * be sent to the multiport.
  124. *
  125. * The multiport clock value is reflected in gameport bit B4.
  126. *
  127. * Returns a packet status code indicating whether packet is valid, the transfer
  128. * mode, and any error conditions.
  129. *
  130. * sendflags: current I/O status
  131. * sendcode: data to send to the multiport if sendflags is nonzero
  132. */
  133. static int mp_io(struct gameport* gameport, int sendflags, int sendcode, u32 *packet)
  134. {
  135. u8 raw_data; /* raw data from gameport */
  136. u8 data_mask; /* packet data bits from raw_data */
  137. u32 pkt; /* packet temporary storage */
  138. int bits_per_read; /* num packet bits per gameport read */
  139. int portvals = 0; /* used for port value sanity check */
  140. int i;
  141. /* Gameport bits B0, B4, B5 should first be off, then B4 should come on. */
  142. *packet = 0;
  143. raw_data = gameport_read(gameport);
  144. if (raw_data & 1)
  145. return IO_RETRY;
  146. for (i = 0; i < 64; i++) {
  147. raw_data = gameport_read(gameport);
  148. portvals |= 1 << ((raw_data >> 4) & 3); /* Demux B4, B5 */
  149. }
  150. if (portvals == 1) { /* B4, B5 off */
  151. raw_data = gameport_read(gameport);
  152. portvals = raw_data & 0xf0;
  153. if (raw_data & 0x31)
  154. return IO_RESET;
  155. gameport_trigger(gameport);
  156. if (!poll_until(0x10, 0, 308, gameport, &raw_data))
  157. return IO_RESET;
  158. } else
  159. return IO_RETRY;
  160. /* Determine packet transfer mode and prepare for packet construction. */
  161. if (raw_data & 0x20) { /* 3 data bits/read */
  162. portvals |= raw_data >> 4; /* Compare B4-B7 before & after trigger */
  163. if (portvals != 0xb)
  164. return 0;
  165. data_mask = 7;
  166. bits_per_read = 3;
  167. pkt = (PACKET_FULL | PACKET_IO_FAST) >> 28;
  168. } else { /* 1 data bit/read */
  169. data_mask = 1;
  170. bits_per_read = 1;
  171. pkt = (PACKET_FULL | PACKET_IO_SLOW) >> 28;
  172. }
  173. /* Construct a packet. Final data bits must be zero. */
  174. while (1) {
  175. if (!poll_until(0, 0x10, 77, gameport, &raw_data))
  176. return IO_RESET;
  177. raw_data = (raw_data >> 5) & data_mask;
  178. if (pkt & PACKET_FULL)
  179. break;
  180. pkt = (pkt << bits_per_read) | raw_data;
  181. if (!poll_until(0x10, 0, 77, gameport, &raw_data))
  182. return IO_RESET;
  183. }
  184. if (raw_data)
  185. return IO_RESET;
  186. /* If 3 bits/read used, drop from 30 bits to 28. */
  187. if (bits_per_read == 3) {
  188. pkt = (pkt & 0xffff0000) | ((pkt << 1) & 0xffff);
  189. pkt = (pkt >> 2) | 0xf0000000;
  190. }
  191. if (bit_parity(pkt) == 1)
  192. return IO_RESET;
  193. /* Acknowledge packet receipt */
  194. if (!poll_until(0x30, 0, 77, gameport, &raw_data))
  195. return IO_RESET;
  196. raw_data = gameport_read(gameport);
  197. if (raw_data & 1)
  198. return IO_RESET;
  199. gameport_trigger(gameport);
  200. if (!poll_until(0, 0x20, 77, gameport, &raw_data))
  201. return IO_RESET;
  202. /* Return if we just wanted the packet or multiport wants to send more */
  203. *packet = pkt;
  204. if ((sendflags == 0) || ((sendflags & IO_RETRY) && !(pkt & PACKET_MP_DONE)))
  205. return IO_GOT_PACKET;
  206. if (pkt & PACKET_MP_MORE)
  207. return IO_GOT_PACKET | IO_RETRY;
  208. /* Multiport is done sending packets and is ready to receive data */
  209. if (!poll_until(0x20, 0, 77, gameport, &raw_data))
  210. return IO_GOT_PACKET | IO_RESET;
  211. raw_data = gameport_read(gameport);
  212. if (raw_data & 1)
  213. return IO_GOT_PACKET | IO_RESET;
  214. /* Trigger gameport based on bits in sendcode */
  215. gameport_trigger(gameport);
  216. do {
  217. if (!poll_until(0x20, 0x10, 116, gameport, &raw_data))
  218. return IO_GOT_PACKET | IO_RESET;
  219. if (!poll_until(0x30, 0, 193, gameport, &raw_data))
  220. return IO_GOT_PACKET | IO_RESET;
  221. if (raw_data & 1)
  222. return IO_GOT_PACKET | IO_RESET;
  223. if (sendcode & 1)
  224. gameport_trigger(gameport);
  225. sendcode >>= 1;
  226. } while (sendcode);
  227. return IO_GOT_PACKET | IO_MODE_FAST;
  228. }
  229. /*
  230. * Disables and restores interrupts for mp_io(), which does the actual I/O.
  231. */
  232. static int multiport_io(struct gameport* gameport, int sendflags, int sendcode, u32 *packet)
  233. {
  234. int status;
  235. unsigned long flags;
  236. local_irq_save(flags);
  237. status = mp_io(gameport, sendflags, sendcode, packet);
  238. local_irq_restore(flags);
  239. return status;
  240. }
  241. /*
  242. * Puts multiport into digital mode. Multiport LED turns green.
  243. *
  244. * Returns true if a valid digital packet was received, false otherwise.
  245. */
  246. static int dig_mode_start(struct gameport *gameport, u32 *packet)
  247. {
  248. int i;
  249. int flags, tries = 0, bads = 0;
  250. for (i = 0; i < ARRAY_SIZE(init_seq); i++) { /* Send magic sequence */
  251. if (init_seq[i])
  252. gameport_trigger(gameport);
  253. udelay(GRIP_INIT_DELAY);
  254. }
  255. for (i = 0; i < 16; i++) /* Wait for multiport to settle */
  256. udelay(GRIP_INIT_DELAY);
  257. while (tries < 64 && bads < 8) { /* Reset multiport and try getting a packet */
  258. flags = multiport_io(gameport, IO_RESET, 0x27, packet);
  259. if (flags & IO_MODE_FAST)
  260. return 1;
  261. if (flags & IO_RETRY)
  262. tries++;
  263. else
  264. bads++;
  265. }
  266. return 0;
  267. }
  268. /*
  269. * Packet structure: B0-B15 => gamepad state
  270. * B16-B20 => gamepad device type
  271. * B21-B24 => multiport slot index (1-4)
  272. *
  273. * Known device types: 0x1f (grip pad), 0x0 (no device). Others may exist.
  274. *
  275. * Returns the packet status.
  276. */
  277. static int get_and_decode_packet(struct grip_mp *grip, int flags)
  278. {
  279. struct grip_port *port;
  280. u32 packet;
  281. int joytype = 0;
  282. int slot;
  283. /* Get a packet and check for validity */
  284. flags &= IO_RESET | IO_RETRY;
  285. flags = multiport_io(grip->gameport, flags, 0, &packet);
  286. grip->reads++;
  287. if (packet & PACKET_MP_DONE)
  288. flags |= IO_DONE;
  289. if (flags && !(flags & IO_GOT_PACKET)) {
  290. grip->bads++;
  291. return flags;
  292. }
  293. /* Ignore non-gamepad packets, e.g. multiport hardware version */
  294. slot = ((packet >> 21) & 0xf) - 1;
  295. if ((slot < 0) || (slot > 3))
  296. return flags;
  297. port = grip->port[slot];
  298. /*
  299. * Handle "reset" packets, which occur at startup, and when gamepads
  300. * are removed or plugged in. May contain configuration of a new gamepad.
  301. */
  302. joytype = (packet >> 16) & 0x1f;
  303. if (!joytype) {
  304. if (port->registered) {
  305. printk(KERN_INFO "grip_mp: removing %s, slot %d\n",
  306. grip_name[port->mode], slot);
  307. input_unregister_device(port->dev);
  308. port->registered = 0;
  309. }
  310. dbg("Reset: grip multiport slot %d\n", slot);
  311. port->mode = GRIP_MODE_RESET;
  312. flags |= IO_SLOT_CHANGE;
  313. return flags;
  314. }
  315. /* Interpret a grip pad packet */
  316. if (joytype == 0x1f) {
  317. int dir = (packet >> 8) & 0xf; /* eight way directional value */
  318. port->buttons = (~packet) & 0xff;
  319. port->yaxes = ((axis_map[dir] >> 2) & 3) - 1;
  320. port->xaxes = (axis_map[dir] & 3) - 1;
  321. port->dirty = 1;
  322. if (port->mode == GRIP_MODE_RESET)
  323. flags |= IO_SLOT_CHANGE;
  324. port->mode = GRIP_MODE_GP;
  325. if (!port->registered) {
  326. dbg("New Grip pad in multiport slot %d.\n", slot);
  327. if (register_slot(slot, grip)) {
  328. port->mode = GRIP_MODE_RESET;
  329. port->dirty = 0;
  330. }
  331. }
  332. return flags;
  333. }
  334. /* Handle non-grip device codes. For now, just print diagnostics. */
  335. {
  336. static int strange_code = 0;
  337. if (strange_code != joytype) {
  338. printk(KERN_INFO "Possible non-grip pad/joystick detected.\n");
  339. printk(KERN_INFO "Got joy type 0x%x and packet 0x%x.\n", joytype, packet);
  340. strange_code = joytype;
  341. }
  342. }
  343. return flags;
  344. }
  345. /*
  346. * Returns true if all multiport slot states appear valid.
  347. */
  348. static int slots_valid(struct grip_mp *grip)
  349. {
  350. int flags, slot, invalid = 0, active = 0;
  351. flags = get_and_decode_packet(grip, 0);
  352. if (!(flags & IO_GOT_PACKET))
  353. return 0;
  354. for (slot = 0; slot < 4; slot++) {
  355. if (grip->port[slot]->mode == GRIP_MODE_RESET)
  356. invalid = 1;
  357. if (grip->port[slot]->mode != GRIP_MODE_NONE)
  358. active = 1;
  359. }
  360. /* Return true if no active slot but multiport sent all its data */
  361. if (!active)
  362. return (flags & IO_DONE) ? 1 : 0;
  363. /* Return false if invalid device code received */
  364. return invalid ? 0 : 1;
  365. }
  366. /*
  367. * Returns whether the multiport was placed into digital mode and
  368. * able to communicate its state successfully.
  369. */
  370. static int multiport_init(struct grip_mp *grip)
  371. {
  372. int dig_mode, initialized = 0, tries = 0;
  373. u32 packet;
  374. dig_mode = dig_mode_start(grip->gameport, &packet);
  375. while (!dig_mode && tries < 4) {
  376. dig_mode = dig_mode_start(grip->gameport, &packet);
  377. tries++;
  378. }
  379. if (dig_mode)
  380. dbg("multiport_init(): digital mode activated.\n");
  381. else {
  382. dbg("multiport_init(): unable to activate digital mode.\n");
  383. return 0;
  384. }
  385. /* Get packets, store multiport state, and check state's validity */
  386. for (tries = 0; tries < 4096; tries++) {
  387. if (slots_valid(grip)) {
  388. initialized = 1;
  389. break;
  390. }
  391. }
  392. dbg("multiport_init(): initialized == %d\n", initialized);
  393. return initialized;
  394. }
  395. /*
  396. * Reports joystick state to the linux input layer.
  397. */
  398. static void report_slot(struct grip_mp *grip, int slot)
  399. {
  400. struct grip_port *port = grip->port[slot];
  401. int i;
  402. /* Store button states with linux input driver */
  403. for (i = 0; i < 8; i++)
  404. input_report_key(port->dev, grip_btn_gp[i], (port->buttons >> i) & 1);
  405. /* Store axis states with linux driver */
  406. input_report_abs(port->dev, ABS_X, port->xaxes);
  407. input_report_abs(port->dev, ABS_Y, port->yaxes);
  408. /* Tell the receiver of the events to process them */
  409. input_sync(port->dev);
  410. port->dirty = 0;
  411. }
  412. /*
  413. * Get the multiport state.
  414. */
  415. static void grip_poll(struct gameport *gameport)
  416. {
  417. struct grip_mp *grip = gameport_get_drvdata(gameport);
  418. int i, npkts, flags;
  419. for (npkts = 0; npkts < 4; npkts++) {
  420. flags = IO_RETRY;
  421. for (i = 0; i < 32; i++) {
  422. flags = get_and_decode_packet(grip, flags);
  423. if ((flags & IO_GOT_PACKET) || !(flags & IO_RETRY))
  424. break;
  425. }
  426. if (flags & IO_DONE)
  427. break;
  428. }
  429. for (i = 0; i < 4; i++)
  430. if (grip->port[i]->dirty)
  431. report_slot(grip, i);
  432. }
  433. /*
  434. * Called when a joystick device file is opened
  435. */
  436. static int grip_open(struct input_dev *dev)
  437. {
  438. struct grip_mp *grip = input_get_drvdata(dev);
  439. gameport_start_polling(grip->gameport);
  440. return 0;
  441. }
  442. /*
  443. * Called when a joystick device file is closed
  444. */
  445. static void grip_close(struct input_dev *dev)
  446. {
  447. struct grip_mp *grip = input_get_drvdata(dev);
  448. gameport_stop_polling(grip->gameport);
  449. }
  450. /*
  451. * Tell the linux input layer about a newly plugged-in gamepad.
  452. */
  453. static int register_slot(int slot, struct grip_mp *grip)
  454. {
  455. struct grip_port *port = grip->port[slot];
  456. struct input_dev *input_dev;
  457. int j, t;
  458. int err;
  459. port->dev = input_dev = input_allocate_device();
  460. if (!input_dev)
  461. return -ENOMEM;
  462. input_dev->name = grip_name[port->mode];
  463. input_dev->id.bustype = BUS_GAMEPORT;
  464. input_dev->id.vendor = GAMEPORT_ID_VENDOR_GRAVIS;
  465. input_dev->id.product = 0x0100 + port->mode;
  466. input_dev->id.version = 0x0100;
  467. input_dev->dev.parent = &grip->gameport->dev;
  468. input_set_drvdata(input_dev, grip);
  469. input_dev->open = grip_open;
  470. input_dev->close = grip_close;
  471. input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
  472. for (j = 0; (t = grip_abs[port->mode][j]) >= 0; j++)
  473. input_set_abs_params(input_dev, t, -1, 1, 0, 0);
  474. for (j = 0; (t = grip_btn[port->mode][j]) >= 0; j++)
  475. if (t > 0)
  476. set_bit(t, input_dev->keybit);
  477. err = input_register_device(port->dev);
  478. if (err) {
  479. input_free_device(port->dev);
  480. return err;
  481. }
  482. port->registered = 1;
  483. if (port->dirty) /* report initial state, if any */
  484. report_slot(grip, slot);
  485. return 0;
  486. }
  487. static int grip_connect(struct gameport *gameport, struct gameport_driver *drv)
  488. {
  489. struct grip_mp *grip;
  490. int err;
  491. if (!(grip = kzalloc(sizeof(struct grip_mp), GFP_KERNEL)))
  492. return -ENOMEM;
  493. grip->gameport = gameport;
  494. gameport_set_drvdata(gameport, grip);
  495. err = gameport_open(gameport, drv, GAMEPORT_MODE_RAW);
  496. if (err)
  497. goto fail1;
  498. gameport_set_poll_handler(gameport, grip_poll);
  499. gameport_set_poll_interval(gameport, 20);
  500. if (!multiport_init(grip)) {
  501. err = -ENODEV;
  502. goto fail2;
  503. }
  504. if (!grip->port[0]->mode && !grip->port[1]->mode && !grip->port[2]->mode && !grip->port[3]->mode) {
  505. /* nothing plugged in */
  506. err = -ENODEV;
  507. goto fail2;
  508. }
  509. return 0;
  510. fail2: gameport_close(gameport);
  511. fail1: gameport_set_drvdata(gameport, NULL);
  512. kfree(grip);
  513. return err;
  514. }
  515. static void grip_disconnect(struct gameport *gameport)
  516. {
  517. struct grip_mp *grip = gameport_get_drvdata(gameport);
  518. int i;
  519. for (i = 0; i < 4; i++)
  520. if (grip->port[i]->registered)
  521. input_unregister_device(grip->port[i]->dev);
  522. gameport_close(gameport);
  523. gameport_set_drvdata(gameport, NULL);
  524. kfree(grip);
  525. }
  526. static struct gameport_driver grip_drv = {
  527. .driver = {
  528. .name = "grip_mp",
  529. },
  530. .description = DRIVER_DESC,
  531. .connect = grip_connect,
  532. .disconnect = grip_disconnect,
  533. };
  534. module_gameport_driver(grip_drv);