More cleanups

Andres Salomon dilinger at debian.unroutableorg
Wed Jan 3 03:36:25 EST 2007


Commit:     012df5ea088b7c959bc58d9b7e1729912d742598
Parent:     5ea612a3600e3795c670c8c8b05a2bb3fb199277
commit 012df5ea088b7c959bc58d9b7e1729912d742598
Author:     Andres Salomon <dilinger at debian.org>
AuthorDate: Wed Jan 3 03:21:46 2007 -0500
Commit:     Andres Salomon <dilinger at debian.org>
CommitDate: Wed Jan 3 03:21:46 2007 -0500

    More cleanups
    
    Update comments describing the now unavailable simultaneous mode, and get
    rid of some unnecessary arithmetic.
    
    Signed-off-by: Andres Salomon <dilinger at debian.org>
---
 drivers/input/mouse/olpc.c |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/drivers/input/mouse/olpc.c b/drivers/input/mouse/olpc.c
index 09f9e96..c5bbc1d 100644
--- a/drivers/input/mouse/olpc.c
+++ b/drivers/input/mouse/olpc.c
@@ -18,16 +18,12 @@
 
 /*
  * The touchpad on the OLPC is fairly wide, with the entire area usable
- * as a tablet, and the center 1/3rd also usable as a touchpad.
+ * as a tablet ("PT mode"), and the center 1/3rd also usable as a touchpad
+ * ("GS mode").
  *
- * The device has simultaneous reporting, so that both can be used at once.
- *
- * The PT+GS protocol is similar to the base ALPS protocol, in that the
- * GS data is where the ALPS parser would expect to find it, however
- * there are several additional bytes, the button bits are in a
- * different byte, and the bits used for finger and gesture indication
- * are replaced by two bits which indicate if it is reporting PT or GS
- * coordinate data in that packet.
+ * Earlier version of the device had simultaneous reporting; however, that
+ * was removed.  Instead, the device now reports packets in one mode, and
+ * tells the driver when a mode switch needs to happen.
  */
 
 #include <linux/input.h>
@@ -86,8 +82,8 @@ static void olpc_process_packet_gspt(str
 
 	left = packet[3] & 1;
 	right = packet[3] & 2;
-	x = packet[1] | ((packet[2] & 0x78) << (7 - 3));
-	y = packet[4] | ((packet[3] & 0x70) << (7 - 4));
+	x = packet[1] | ((packet[2] & 0x78) << 4);
+	y = packet[4] | ((packet[3] & 0x70) << 3);
 	z = packet[5];
 
 	if (psmouse->packet[0] == OLPC_PKT_GS) {


More information about the Commits-kernel mailing list