lkml.org 
[lkml]   [1999]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] 2.3.12-pre7: make joy-db9 work again
Andree, list,

Here is a quick patch to make joy-db9 work again. It's untested, as I
don't actually have a console joystick, but it should work.

Note that JS_PAR_CTRL_OUT now does _two_ port accesses instead of one.
This can only really be avoided by re-writing some code in joy-db9.c so
that we set the data direction only when we need to.

Tim.
*/

diff -durN linux-current/include/linux/joystick.h linux/include/linux/joystick.h
--- linux-current/include/linux/joystick.h Fri May 14 08:39:52 1999
+++ linux/include/linux/joystick.h Tue Jul 27 21:02:51 1999
@@ -183,8 +183,13 @@
#define JS_PAR_DATA_OUT(x,y) parport_write_data(y->port, x)
#define JS_PAR_STATUS(y) parport_read_status(y->port)
#define JS_PAR_CTRL_IN(y) parport_read_control(y->port)
-#define JS_PAR_CTRL_OUT(x,y) parport_write_control(y->port, x)
-#define JS_PAR_ECTRL_OUT(x,y) parport_write_econtrol(y->port, x)
+#define JS_PAR_CTRL_OUT(x,y) \
+ do { \
+ if (x & 0x20) parport_data_reverse (y->port); \
+ else parport_data_forward (y->port); \
+ parport_write_control(y->port, x & ~0x20); \
+ } while (0)
+#define JS_PAR_ECTRL_OUT(x,y) /* parport sets PS/2 mode on ECR chips */
#else
#define JS_PAR_DATA_IN(y) inb(y)
#define JS_PAR_DATA_OUT(x,y) outb(x,y)

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

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.320 / U:0.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site