public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Vojtech Pavlik <vojtech@suse.cz>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH 6/8] Drop PS2TPP protocol identifier
Date: Wed, 29 Sep 2004 01:45:37 -0500	[thread overview]
Message-ID: <200409290145.39919.dtor_core@ameritech.net> (raw)
In-Reply-To: <200409290144.50310.dtor_core@ameritech.net>


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


ChangeSet@1.1952, 2004-09-29 01:05:22-05:00, dtor_core@ameritech.net
  Input: psmouse - drop PS2TPP protocol (it is handled exactly like
         PS2PP) to free spot for THINKPS protocol and keep old protocol
         numbers for binary compatibility with Synaptics/ALPS touchpad
         driver for X.
  
  Signed-off-by: Dmitry Torokhov <dtor@mail.ru>


 logips2pp.c    |   52 ++++++++++++++++++++++++++++------------------------
 psmouse-base.c |   11 ++++-------
 psmouse.h      |    1 -
 3 files changed, 32 insertions(+), 32 deletions(-)


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



diff -Nru a/drivers/input/mouse/logips2pp.c b/drivers/input/mouse/logips2pp.c
--- a/drivers/input/mouse/logips2pp.c	2004-09-29 01:22:10 -05:00
+++ b/drivers/input/mouse/logips2pp.c	2004-09-29 01:22:10 -05:00
@@ -274,9 +274,9 @@
 {
 	struct ps2dev *ps2dev = &psmouse->ps2dev;
 	unsigned char param[4];
-	unsigned char protocol = PSMOUSE_PS2;
 	unsigned char model, buttons;
 	struct ps2pp_info *model_info;
+	int use_ps2pp = 0;
 
 	param[0] = 0;
 	ps2_command(ps2dev, param, PSMOUSE_CMD_SETRES);
@@ -286,10 +286,13 @@
 	param[1] = 0;
 	ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO);
 
-	if (param[1] != 0) {
-		model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
-		buttons = param[1];
-		model_info = get_model_info(model);
+	if (!param[1])
+		return 0;
+
+	model = ((param[0] >> 4) & 0x07) | ((param[0] << 3) & 0x78);
+	buttons = param[1];
+
+	if ((model_info = get_model_info(model)) != NULL) {
 
 /*
  * Do Logitech PS2++ / PS2T++ magic init.
@@ -309,10 +312,10 @@
 			param[0] = 0;
 			if (!ps2_command(ps2dev, param, 0x13d1) &&
 			    param[0] == 0x06 && param[1] == 0x00 && param[2] == 0x14) {
-				protocol = PSMOUSE_PS2TPP;
+				use_ps2pp = 1;
 			}
 
-		} else if (model_info != NULL) {
+		} else {
 
 			param[0] = param[1] = param[2] = 0;
 			ps2pp_cmd(psmouse, param, 0x39); /* Magic knock */
@@ -322,30 +325,31 @@
 			    (param[1] & 0xf3) == 0xc2 &&
 			    (param[2] & 0x03) == ((param[1] >> 2) & 3)) {
 				ps2pp_set_smartscroll(psmouse, psmouse->smartscroll);
-				protocol = PSMOUSE_PS2PP;
+				use_ps2pp = 1;
 			}
 		}
+	}
 
-		if (set_properties) {
-			psmouse->vendor = "Logitech";
-			psmouse->model = model;
-			if (protocol == PSMOUSE_PS2PP) {
-				psmouse->set_resolution = ps2pp_set_resolution;
-				psmouse->disconnect = ps2pp_disconnect;
+	if (set_properties) {
+		psmouse->vendor = "Logitech";
+		psmouse->model = model;
+
+		if (use_ps2pp && model_info->kind != PS2PP_KIND_TP3) {
+			psmouse->set_resolution = ps2pp_set_resolution;
+			psmouse->disconnect = ps2pp_disconnect;
 
-				device_create_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll);
-			}
+			device_create_file(&psmouse->ps2dev.serio->dev, &psmouse_attr_smartscroll);
+		}
 
-			if (buttons < 3)
-				clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
-			if (buttons < 2)
-				clear_bit(BTN_RIGHT, psmouse->dev.keybit);
+		if (buttons < 3)
+			clear_bit(BTN_MIDDLE, psmouse->dev.keybit);
+		if (buttons < 2)
+			clear_bit(BTN_RIGHT, psmouse->dev.keybit);
 
-			if (model_info)
-				ps2pp_set_model_properties(psmouse, model_info);
-		}
+		if (model_info)
+			ps2pp_set_model_properties(psmouse, model_info);
 	}
 
-	return protocol;
+	return use_ps2pp;
 }
 
diff -Nru a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
--- a/drivers/input/mouse/psmouse-base.c	2004-09-29 01:22:10 -05:00
+++ b/drivers/input/mouse/psmouse-base.c	2004-09-29 01:22:10 -05:00
@@ -62,7 +62,7 @@
 __obsolete_setup("psmouse_resetafter=");
 __obsolete_setup("psmouse_rate=");
 
-static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "PS2T++", "ThinkPS/2", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2", "AlpsPS/2" };
+static char *psmouse_protocols[] = { "None", "PS/2", "PS2++", "ThinkPS/2", "GenPS/2", "ImPS/2", "ImExPS/2", "SynPS/2", "AlpsPS/2" };
 
 /*
  * psmouse_process_byte() analyzes the PS/2 data stream and reports
@@ -87,7 +87,7 @@
  * The PS2++ protocol is a little bit complex
  */
 
-	if (psmouse->type == PSMOUSE_PS2PP || psmouse->type == PSMOUSE_PS2TPP)
+	if (psmouse->type == PSMOUSE_PS2PP)
 		ps2pp_process_packet(psmouse);
 
 /*
@@ -442,11 +442,8 @@
 		return PSMOUSE_GENPS;
 	}
 
-	if (max_proto > PSMOUSE_IMEX) {
-		int type = ps2pp_init(psmouse, set_properties);
-		if (type > PSMOUSE_PS2)
-			return type;
-	}
+	if (max_proto > PSMOUSE_IMEX && ps2pp_init(psmouse, set_properties))
+		return PSMOUSE_PS2PP;
 
 /*
  * Reset to defaults in case the device got confused by extended
diff -Nru a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
--- a/drivers/input/mouse/psmouse.h	2004-09-29 01:22:10 -05:00
+++ b/drivers/input/mouse/psmouse.h	2004-09-29 01:22:10 -05:00
@@ -70,7 +70,6 @@
 	PSMOUSE_NONE,
 	PSMOUSE_PS2,
 	PSMOUSE_PS2PP,
-	PSMOUSE_PS2TPP,
 	PSMOUSE_THINKPS,
 	PSMOUSE_GENPS,
 	PSMOUSE_IMPS,

  reply	other threads:[~2004-09-29  6:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-29  6:40 [PATCH 0/8] Set of input (psmouse) patches Dmitry Torokhov
2004-09-29  6:41 ` [PATCH 1/8] New ALPS signature Dmitry Torokhov
2004-09-29  6:42   ` [PATCH 2/8] Psmouse rate and resolution handlers Dmitry Torokhov
2004-09-29  6:43     ` [PATCH 3/8] Guest protocol switch in synaptics Dmitry Torokhov
2004-09-29  6:44       ` [PATCH 4/8] Psmouse probe fixes Dmitry Torokhov
2004-09-29  6:44         ` [PATCH 5/8] Export psmouse parameters via sysfs Dmitry Torokhov
2004-09-29  6:45           ` Dmitry Torokhov [this message]
2004-09-29  6:46             ` [PATCH 7/8] Separate PS2PP protocol handling Dmitry Torokhov
2004-09-29  6:47               ` [PATCH 7/8] Psmouse - add packet size Dmitry Torokhov
2004-09-29  7:15                 ` Vojtech Pavlik
2004-09-29  7:29                   ` Dmitry Torokhov
2004-09-29  9:31                     ` Vojtech Pavlik
2004-09-29 13:24                       ` Dmitry Torokhov
2004-09-29 13:38                         ` Vojtech Pavlik
2004-09-30  6:43                           ` Dmitry Torokhov
2004-09-30  7:55                             ` Vojtech Pavlik
2004-09-30 10:34                             ` Jan-Benedict Glaw
2004-09-29  7:11 ` [PATCH 0/8] Set of input (psmouse) patches Vojtech Pavlik

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=200409290145.39919.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /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