Skip to contentSkip to conversation

ALPS input driver problem with DualPoint on Dell E6400/E6500

DISCUSSION Alexander Hofbauer 3 participants 4 messages Nov 25, 2008 – Feb 24, 2009

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi!

Quoted 4 lines

I can put together a patch, but it's a non-trivial change... I'm interested in hearing whether anyone else has the same problem with their E6400/E6500 or other DualPoint laptop, or has better ideas regarding how to deal with this.

I'm facing the same problem here on my "Latitude E5500" and 2.6.27.7 with no found workarounds so far ("synclient TouchpadOff=0" works until reset but doesn't avoid the touchpad getting reset eventually).

If there was a patch to test I'd be happy to do so :-).

Thank you,
Alex

#1 lore raw

Re: ALPS input driver problem with DualPoint on Dell E6400/E6500 [patch]

Hi,

Here's a patch that implements the 9-byte packet format, which solves the problem for me.

Matt

Quoted 12 lines · Alexander Hofbauer

Hi!

Quoted 4 lines

I can put together a patch, but it's a non-trivial change... I'm interested in hearing whether anyone else has the same problem with their E6400/E6500 or other DualPoint laptop, or has better ideas regarding how to deal with this.

I'm facing the same problem here on my "Latitude E5500" and 2.6.27.7 with no found workarounds so far ("synclient TouchpadOff=0" works until reset but doesn't avoid the touchpad getting reset eventually).

Quoted 5 lines

If there was a patch to test I'd be happy to do so :-).

Thank you,
Alex

drivers/input/mouse/alps.c +28 -0
@@ -100,6 +100,19 @@
 		return;
 	}
 
+	if ((packet[3] & 0xf) == 0xf) {
+		/* 9-byte packet format seen on some DualPoints */
+		/* handle relative update and then fall through for remainder */
+		input_report_rel(dev2, REL_X,
+			packet[4] ? packet[4] - ((packet[3] << 4) & 0x100) : 0);
+		input_report_rel(dev2, REL_Y,
+			packet[5] ? ((packet[3] << 3) & 0x100) - packet[5] : 0);
+		input_sync(dev2);
+		packet[3] = packet[6];
+		packet[4] = packet[7];
+		packet[5] = packet[8];
+	}
+
 	if (priv->i->flags & ALPS_OLDPROTO) {
 		left = packet[2] & 0x10;
 		right = packet[2] & 0x08;
@@ -197,6 +210,21 @@
 	if ((psmouse->packet[0] & priv->i->mask0) != priv->i->byte0)
 		return PSMOUSE_BAD_DATA;
 
+	if ((psmouse->pktcnt >= 4) && ((psmouse->packet[3] & 0xf) == 0xf))
+	{
+		/* 9-byte packet format seen on some DualPoints */
+		/* Bytes 7 - 9 should have 0 in the highest bit */
+		if ((psmouse->pktcnt >= 7) && (psmouse->pktcnt <= 9) &&
+		    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
+			return PSMOUSE_BAD_DATA;
+
+		if (psmouse->pktcnt == 9) {
+			alps_process_packet(psmouse);
+			return PSMOUSE_FULL_PACKET;
+		}
+		return PSMOUSE_GOOD_DATA;
+	}
+
 	/* Bytes 2 - 6 should have 0 in the highest bit */
 	if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
 	    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
drivers/input/mouse/psmouse.h +1 -1
@@ -42,7 +42,7 @@
 	struct work_struct resync_work;
 	char *vendor;
 	char *name;
-	unsigned char packet[8];
+	unsigned char packet[9];
 	unsigned char badbyte;
 	unsigned char pktcnt;
 	unsigned char pktsize;
#2 lore raw

Re: ALPS input driver problem with DualPoint on Dell E6400/E6500 [patch]

Quoted 4 lines · Matthew Chapman

Hi,

Here's a patch that implements the 9-byte packet format, which solves the problem for me.

Thank you.

Indeed, the patch seems to work except for losing "grip" when using e.g. the DualPoint Stick and the touchpad buttons at the same time.

Let's assume I click a window decoration drawn by compiz (gtk-window-decorator) to move the window and the use the Stick. At "normal" speed the window is dropped immediately. If I start dragging very slowly I can sometimes move it successfully.

Playing around and trying to get some usable output from xev I could reproducibly freeze the whole system (at least graphical output and keyboard/mouse input) but I don't know if this is related to using 2.6.28-rc7 or the video drivers+compiz or the ALPS DualPoint anyway.

I nevertheless also experimented with metacity. Dragging works most of the time but even metacity sometimes seems to interpret a double click and maximizes the window instead of starting to move it.

So I'm quite positive that this patch still has some rough edges and events that don't belong where they appear (or at least are not expected by the window managers) because not mixing Touchpad's and -stick's controls doesn't have any issues at all.

Greetings from Austria,
Alex

#3 lore raw

Re: ALPS input driver problem with DualPoint on Dell E6400/E6500 [patch]

In reply to Matthew Chapman
Quoted 6 lines · Matthew Chapman

Hi,

Here's a patch that implements the 9-byte packet format, which solves the problem for me.

Matt

Matt,

Your patch fixes http://bugzilla.kernel.org/show_bug.cgi?id=12577 for me. Would you consider resending it to linux-input@ with your Signed-off-by?

Thanks,
-andy

Quoted 55 lines
drivers/input/mouse/alps.c +28 -0
@@ -100,6 +100,19 @@
 		return;
 	}
 
+	if ((packet[3] & 0xf) == 0xf) {
+		/* 9-byte packet format seen on some DualPoints */
+		/* handle relative update and then fall through for remainder */
+		input_report_rel(dev2, REL_X,
+			packet[4] ? packet[4] - ((packet[3] << 4) & 0x100) : 0);
+		input_report_rel(dev2, REL_Y,
+			packet[5] ? ((packet[3] << 3) & 0x100) - packet[5] : 0);
+		input_sync(dev2);
+		packet[3] = packet[6];
+		packet[4] = packet[7];
+		packet[5] = packet[8];
+	}
+
 	if (priv->i->flags & ALPS_OLDPROTO) {
 		left = packet[2] & 0x10;
 		right = packet[2] & 0x08;
@@ -197,6 +210,21 @@
 	if ((psmouse->packet[0] & priv->i->mask0) != priv->i->byte0)
 		return PSMOUSE_BAD_DATA;
 
+	if ((psmouse->pktcnt >= 4) && ((psmouse->packet[3] & 0xf) == 0xf))
+	{
+		/* 9-byte packet format seen on some DualPoints */
+		/* Bytes 7 - 9 should have 0 in the highest bit */
+		if ((psmouse->pktcnt >= 7) && (psmouse->pktcnt <= 9) &&
+		    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
+			return PSMOUSE_BAD_DATA;
+
+		if (psmouse->pktcnt == 9) {
+			alps_process_packet(psmouse);
+			return PSMOUSE_FULL_PACKET;
+		}
+		return PSMOUSE_GOOD_DATA;
+	}
+
 	/* Bytes 2 - 6 should have 0 in the highest bit */
 	if (psmouse->pktcnt >= 2 && psmouse->pktcnt <= 6 &&
 	    (psmouse->packet[psmouse->pktcnt - 1] & 0x80))
drivers/input/mouse/psmouse.h +1 -1
@@ -42,7 +42,7 @@
 	struct work_struct resync_work;
 	char *vendor;
 	char *name;
-	unsigned char packet[8];
+	unsigned char packet[9];
 	unsigned char badbyte;
 	unsigned char pktcnt;
 	unsigned char pktsize;