public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@ucw.cz>
To: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: [PATCH 11/11] input: Make GC_PSX_DELAY lower and configurable
Date: Sat, 21 Jun 2003 15:51:57 +0200	[thread overview]
Message-ID: <10562035172209@twilight.ucw.cz> (raw)
In-Reply-To: <10562035174020@twilight.ucw.cz>

You can pull this changeset from:
	bk://kernel.bkbits.net/vojtech/input

===================================================================

ChangeSet@1.1369, 2003-06-21 04:49:07-07:00, vojtech@kernel.bkbits.net
  input: make GC_PSX_DELAY lower (25 usec instead of 60), to burn less
         CPU time while reading PSX pads, and make it a module parameter also,
         for devices which would need the huge value of 60.


 gamecon.c |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

===================================================================

diff -Nru a/drivers/input/joystick/gamecon.c b/drivers/input/joystick/gamecon.c
--- a/drivers/input/joystick/gamecon.c	Sat Jun 21 15:26:06 2003
+++ b/drivers/input/joystick/gamecon.c	Sat Jun 21 15:26:06 2003
@@ -46,6 +46,7 @@
 MODULE_PARM(gc, "2-6i");
 MODULE_PARM(gc_2,"2-6i");
 MODULE_PARM(gc_3,"2-6i");
+MODULE_PARM(gc_psx_delay, "i");
 
 #define GC_SNES		1
 #define GC_NES		2
@@ -213,7 +214,7 @@
  *	
  */
 
-#define GC_PSX_DELAY	60		/* 60 usec */
+#define GC_PSX_DELAY	25		/* 25 usec */
 #define GC_PSX_LENGTH	8		/* talk to the controller in bytes */
 
 #define GC_PSX_MOUSE	1		/* Mouse */
@@ -230,6 +231,7 @@
 #define GC_PSX_ID(x)	((x) >> 4)	/* High nibble is device type */
 #define GC_PSX_LEN(x)	((x) & 0xf)	/* Low nibble is length in words */
 
+static int gc_psx_delay = GC_PSX_DELAY;
 static short gc_psx_abs[] = { ABS_X, ABS_Y, ABS_RX, ABS_RY, ABS_HAT0X, ABS_HAT0Y };
 static short gc_psx_btn[] = { BTN_TL, BTN_TR, BTN_TL2, BTN_TR2, BTN_A, BTN_B, BTN_X, BTN_Y,
 				BTN_START, BTN_SELECT, BTN_THUMBL, BTN_THUMBR };
@@ -246,10 +248,10 @@
 	for (i = 0; i < 8; i++, b >>= 1) {
 		cmd = (b & 1) ? GC_PSX_COMMAND : 0;
 		parport_write_data(gc->pd->port, cmd | GC_PSX_POWER);
-		udelay(GC_PSX_DELAY);
+		udelay(gc_psx_delay);
 		data |= ((parport_read_status(gc->pd->port) ^ 0x80) & gc->pads[GC_PSX]) ? (1 << i) : 0;
 		parport_write_data(gc->pd->port, cmd | GC_PSX_CLOCK | GC_PSX_POWER);
-		udelay(GC_PSX_DELAY);
+		udelay(gc_psx_delay);
 	}
 	return data;
 }
@@ -265,9 +267,9 @@
 	unsigned long flags;
 
 	parport_write_data(gc->pd->port, GC_PSX_CLOCK | GC_PSX_SELECT | GC_PSX_POWER);	/* Select pad */
-	udelay(GC_PSX_DELAY * 2);
+	udelay(gc_psx_delay * 2);
 	parport_write_data(gc->pd->port, GC_PSX_CLOCK | GC_PSX_POWER);			/* Deselect, begin command */
-	udelay(GC_PSX_DELAY * 2);
+	udelay(gc_psx_delay * 2);
 
 	local_irq_save(flags);
 
@@ -649,9 +651,15 @@
 	for (i = 0; i <= ints[0] && i < 6; i++) gc_3[i] = ints[i + 1];
 	return 1;
 }
+static int __init gc_psx_setup(char *str)
+{
+        get_option(&str, &gc_psx_delay);
+        return 1;
+}
 __setup("gc=", gc_setup);
 __setup("gc_2=", gc_setup_2);
 __setup("gc_3=", gc_setup_3);
+__setup("gc_psx_delay=", gc_psx_setup);
 #endif
 
 int __init gc_init(void)


      reply	other threads:[~2003-06-21 13:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-21 13:51 [PATCH 1/11] input: HID devices can have the same logical max and min Vojtech Pavlik
2003-06-21 13:51 ` [PATCH 2/11] input: Fix misdetection of PS/2 mice as AT keyboards Vojtech Pavlik
2003-06-21 13:51   ` [PATCH 3/11] input: Add locking to serio.c Vojtech Pavlik
2003-06-21 13:51     ` [PATCH 4/11] input: Remove unused var from serio struct Vojtech Pavlik
2003-06-21 13:51       ` [PATCH 5/11] input: Gameport was never closed after calibrating Vojtech Pavlik
2003-06-21 13:51         ` [PATCH 6/11] input: Add Logitech MX PS2++ support Vojtech Pavlik
2003-06-21 13:51           ` [PATCH 7/11] input: Fixes for the uinput userspace Vojtech Pavlik
2003-06-21 13:51             ` [PATCH 8/11] input: Change order of search for beeper devices in keyboard.c Vojtech Pavlik
2003-06-21 13:51               ` [PATCH 9/11] input: Fix double kfree of device->rdesc in hid-core Vojtech Pavlik
2003-06-21 13:51                 ` [PATCH 10/11] input: Fixes for sidewinder.c Vojtech Pavlik
2003-06-21 13:51                   ` Vojtech Pavlik [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10562035172209@twilight.ucw.cz \
    --to=vojtech@ucw.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox