public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] Cleanup of the ADI gameport packet reading routine.
@ 2003-09-29 17:42 Vojtech Pavlik
  2003-09-29 17:42 ` [PATCH 2/4] Fix atkbd_softrepeat kernel command line parameter Vojtech Pavlik
  0 siblings, 1 reply; 4+ messages in thread
From: Vojtech Pavlik @ 2003-09-29 17:42 UTC (permalink / raw)
  To: torvalds, vojtech, linux-kernel

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

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

ChangeSet@1.1340.1.1, 2003-09-28 09:21:37+02:00, vojtech@suse.cz
  input: Cleanup the ADI gameport packet reading routine a bit.
         Thanks to a nice guy who wishes not to be named.


 adi.c |   17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

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

diff -Nru a/drivers/input/joystick/adi.c b/drivers/input/joystick/adi.c
--- a/drivers/input/joystick/adi.c	Mon Sep 29 19:37:19 2003
+++ b/drivers/input/joystick/adi.c	Mon Sep 29 19:37:19 2003
@@ -136,13 +136,18 @@
 
 /*
  * adi_read_packet() reads a Logitech ADI packet.
+ *
+ * A packet is sent in response to a gameport trigger command, and can arrive
+ * over one or both pairs of gameport button signals. If the top bit of the
+ * pair changes, it's a 1. If the bottom bit changes, it's a 0. The end of a
+ * packet is signalled by a timeout.
  */
 
 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;
+	unsigned char u, v, w;
 	int t[2], s[2], i;
 	unsigned long flags;
 
@@ -155,19 +160,19 @@
 	local_irq_save(flags);
 
 	gameport_trigger(gameport);
-	v = z = gameport_read(gameport);
+	v = gameport_read(gameport);
 
 	do {
-		u = v;
-		w = u ^ (v = x = gameport_read(gameport));
-		for (i = 0; i < 2; i++, w >>= 2, x >>= 2) {
+		w = v ^ (u = gameport_read(gameport));
+		v = u;
+		for (i = 0; i < 2; i++, w >>= 2, u >>= 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;
+			} else if (!(u & 0x30)) s[i] = 1;
 		}
 	} while (t[0] > 0 || t[1] > 0);
 


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

* [PATCH 2/4] Fix atkbd_softrepeat kernel command line parameter.
  2003-09-29 17:42 [PATCH 1/4] Cleanup of the ADI gameport packet reading routine Vojtech Pavlik
@ 2003-09-29 17:42 ` Vojtech Pavlik
  2003-09-29 17:42   ` [PATCH 3/4] Explicitly set All-Repeat mode in Set3 on AT keyboards Vojtech Pavlik
  0 siblings, 1 reply; 4+ messages in thread
From: Vojtech Pavlik @ 2003-09-29 17:42 UTC (permalink / raw)
  To: torvalds, vojtech, linux-kernel

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

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

ChangeSet@1.1340.1.2, 2003-09-28 18:48:05+02:00, vojtech@suse.cz
  input: Fix atkbd_softrepeat kernel command line parameter.


 atkbd.c |    8 ++++++++
 1 files changed, 8 insertions(+)

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

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Mon Sep 29 19:37:08 2003
+++ b/drivers/input/keyboard/atkbd.c	Mon Sep 29 19:37:08 2003
@@ -707,9 +707,17 @@
         if (ints[0] > 0) atkbd_reset = ints[1];
         return 1;
 }
+static int __init atkbd_setup_softrepeat(char *str)
+{
+        int ints[4];
+        str = get_options(str, ARRAY_SIZE(ints), ints);
+        if (ints[0] > 0) atkbd_softrepeat = ints[1];
+        return 1;
+}
 
 __setup("atkbd_set=", atkbd_setup_set);
 __setup("atkbd_reset", atkbd_setup_reset);
+__setup("atkbd_softrepeat=", atkbd_setup_softrepeat);
 #endif
 
 int __init atkbd_init(void)


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

* [PATCH 3/4] Explicitly set All-Repeat mode in Set3 on AT keyboards.
  2003-09-29 17:42 ` [PATCH 2/4] Fix atkbd_softrepeat kernel command line parameter Vojtech Pavlik
@ 2003-09-29 17:42   ` Vojtech Pavlik
  2003-09-29 17:42     ` [PATCH 4/4] Fix AT keyboard repeat rate setting Vojtech Pavlik
  0 siblings, 1 reply; 4+ messages in thread
From: Vojtech Pavlik @ 2003-09-29 17:42 UTC (permalink / raw)
  To: torvalds, vojtech, linux-kernel

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

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

ChangeSet@1.1385, 2003-09-29 12:59:49+02:00, vojtech@suse.cz
  input: Explicitly set All-Repeat mode in Set3 on AT keyboards.


 atkbd.c |    3 +++
 1 files changed, 3 insertions(+)

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

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Mon Sep 29 19:36:59 2003
+++ b/drivers/input/keyboard/atkbd.c	Mon Sep 29 19:36:59 2003
@@ -111,6 +111,7 @@
 #define ATKBD_CMD_SETREP	0x10f3
 #define ATKBD_CMD_ENABLE	0x00f4
 #define ATKBD_CMD_RESET_DIS	0x00f5
+#define ATKBD_CMD_SETALL_MBR    0x00fa
 #define ATKBD_CMD_RESET_BAT	0x02ff
 #define ATKBD_CMD_RESEND	0x00fe
 #define ATKBD_CMD_EX_ENABLE	0x10ea
@@ -519,6 +520,8 @@
 		if (atkbd_command(atkbd, param, ATKBD_CMD_SSCANSET))
 		return 2;
 	}
+
+	atkbd_command(atkbd, param, ATKBD_CMD_SETALL_MBR);
 
 	return 3;
 }


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

* [PATCH 4/4] Fix AT keyboard repeat rate setting.
  2003-09-29 17:42   ` [PATCH 3/4] Explicitly set All-Repeat mode in Set3 on AT keyboards Vojtech Pavlik
@ 2003-09-29 17:42     ` Vojtech Pavlik
  0 siblings, 0 replies; 4+ messages in thread
From: Vojtech Pavlik @ 2003-09-29 17:42 UTC (permalink / raw)
  To: torvalds, vojtech, linux-kernel

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

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

ChangeSet@1.1386, 2003-09-29 17:00:25+02:00, vojtech@suse.cz
  input: Fix AT keyboard repeat rate setting, also make rate selection
         in finer steps.


 atkbd.c |   19 ++++++++++---------
 1 files changed, 10 insertions(+), 9 deletions(-)

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

diff -Nru a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
--- a/drivers/input/keyboard/atkbd.c	Mon Sep 29 19:36:47 2003
+++ b/drivers/input/keyboard/atkbd.c	Mon Sep 29 19:36:47 2003
@@ -370,10 +370,11 @@
 static int atkbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value)
 {
 	struct atkbd *atkbd = dev->private;
-	struct { int p; u8 v; } period[] =	
-		{ {30, 0x00}, {25, 0x02}, {20, 0x04}, {15, 0x08}, {10, 0x0c}, {7, 0x10}, {5, 0x14}, {0, 0x14} };
-	struct { int d; u8 v; } delay[] =
-        	{ {1000, 0x60}, {750, 0x40}, {500, 0x20}, {250, 0x00}, {0, 0x00} };
+	const short period[32] =
+		{ 33,  37,  42,  46,  50,  54,  58,  63,  67,  75,  83,  92, 100, 109, 116, 125,
+		 133, 149, 167, 182, 200, 217, 232, 250, 270, 303, 333, 370, 400, 435, 470, 500 };
+	const short delay[4] =
+		{ 250, 500, 750, 1000 };
 	char param[2];
 	int i, j;
 
@@ -407,11 +408,11 @@
 			if (atkbd_softrepeat) return 0;
 
 			i = j = 0;
-			while (period[i].p > dev->rep[REP_PERIOD]) i++;
-			while (delay[j].d > dev->rep[REP_DELAY]) j++;
-			dev->rep[REP_PERIOD] = period[i].p;
-			dev->rep[REP_DELAY] = delay[j].d;
-			param[0] = period[i].v | delay[j].v;
+			while (i < 32 && period[i] < dev->rep[REP_PERIOD]) i++;
+			while (j < 4 && delay[j] < dev->rep[REP_DELAY]) j++;
+			dev->rep[REP_PERIOD] = period[i];
+			dev->rep[REP_DELAY] = delay[j];
+			param[0] = i | (j << 5);
 			atkbd_command(atkbd, param, ATKBD_CMD_SETREP);
 
 			return 0;


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

end of thread, other threads:[~2003-09-29 18:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-29 17:42 [PATCH 1/4] Cleanup of the ADI gameport packet reading routine Vojtech Pavlik
2003-09-29 17:42 ` [PATCH 2/4] Fix atkbd_softrepeat kernel command line parameter Vojtech Pavlik
2003-09-29 17:42   ` [PATCH 3/4] Explicitly set All-Repeat mode in Set3 on AT keyboards Vojtech Pavlik
2003-09-29 17:42     ` [PATCH 4/4] Fix AT keyboard repeat rate setting Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox