All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vojtech Pavlik <vojtech@suse.cz>
To: akpm@osdl.org, dtor_core@ameritech.net, petero2@telia.com,
	Andries.Brouwer@cwi.nl, linux-kernel@vger.kernel.org
Subject: [PATCH 2/8] Fix multibutton handling in synaptics.c.
Date: Thu, 25 Sep 2003 18:50:12 +0200	[thread overview]
Message-ID: <1064508612553@twilight.ucw.cz> (raw)
In-Reply-To: <1064508612452@twilight.ucw.cz>

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

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

ChangeSet@1.1342, 2003-09-25 18:18:59+02:00, dtor_core@ameritech.net
  input: Fix multibutton handling in Synaptics.c (nExtBtn > 8 case)


 synaptics.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

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

diff -Nru a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
--- a/drivers/input/mouse/synaptics.c	Thu Sep 25 18:37:42 2003
+++ b/drivers/input/mouse/synaptics.c	Thu Sep 25 18:37:42 2003
@@ -164,7 +164,8 @@
 
 	if (SYN_CAP_EXTENDED(priv->capabilities)) {
 		printk(KERN_INFO " Touchpad has extended capability bits\n");
-		if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
+		if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) &&
+		    SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) <= 8)
 			printk(KERN_INFO " -> %d multi-buttons, i.e. besides standard buttons\n",
 			       (int)(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap)));
 		else if (SYN_CAP_FOUR_BUTTON(priv->capabilities))
@@ -352,7 +353,11 @@
 	if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
 		switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
 		default:
-			printk(KERN_ERR "This touchpad reports more than 8 multi-buttons, don't know how to handle.\n");
+			/*
+			 * if nExtBtn is greater than 8 it should be considered
+			 * invalid and treated as 0
+			 */
+			break;
 		case 8:
 			set_bit(BTN_7, psmouse->dev.keybit);
 			set_bit(BTN_6, psmouse->dev.keybit);
@@ -437,7 +442,11 @@
 		    ((buf[3] & 2) ? !hw->right : hw->right)) {
 			switch (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
 			default:
-				; /* we did comment while initialising... */
+				/*
+				 * if nExtBtn is greater than 8 it should be
+				 * considered invalid and treated as 0
+				 */
+				break;
 			case 8:
 				hw->b7 = ((buf[5] & 0x08)) ? 1 : 0;
 				hw->b6 = ((buf[4] & 0x08)) ? 1 : 0;
@@ -516,7 +525,11 @@
 	if (SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap))
 		switch(SYN_CAP_MULTI_BUTTON_NO(priv->ext_cap) & ~0x01) {
 		default:
-			; /* we did comment while initialising... */
+			/*
+			 * if nExtBtn is greater than 8 it should be considered
+			 * invalid and treated as 0
+			 */
+			break;
 		case 8:
 			input_report_key(dev, BTN_7,       hw.b7);
 			input_report_key(dev, BTN_6,       hw.b6);


  reply	other threads:[~2003-09-25 16:50 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-25 16:48 My current patches Vojtech Pavlik
2003-09-25 16:50 ` [PATCH 1/8] Revert synaptics->pktcnt change Vojtech Pavlik
2003-09-25 16:50   ` Vojtech Pavlik [this message]
2003-09-25 16:50     ` [PATCH 3/8] Synaptics code cleanups Vojtech Pavlik
2003-09-25 16:50       ` [PATCH 4/8] Add touchpad support to mousedev.c Vojtech Pavlik
2003-09-25 16:50         ` [PATCH 5/8] Rely less on sanity of AT keyboards Vojtech Pavlik
2003-09-25 16:50           ` [PATCH 6/8] Extend KD?BENT to handle > 256 keycodes Vojtech Pavlik
2003-09-25 16:50             ` [PATCH 7/8] Fix handling of rotated Synaptics touchpads Vojtech Pavlik
2003-09-25 16:50               ` [PATCH 8/8] Add BTN_TOUCH to Synaptics driver. Update mousedev Vojtech Pavlik
2003-09-25 18:23                 ` Dmitry Torokhov
2003-09-25 22:30                   ` Vojtech Pavlik
2003-09-26  5:24                     ` Peter Osterlund
2003-09-26  7:24                     ` Dmitry Torokhov
2003-09-26  7:54                       ` Vojtech Pavlik
2003-09-27  1:58                         ` Dmitry Torokhov
2003-09-27 20:19                         ` Pavel Machek
2003-09-27 21:05                           ` Vojtech Pavlik
2003-09-27 21:09                             ` Pavel Machek
2003-09-27 21:16                               ` Vojtech Pavlik
2003-09-27 21:18                                 ` Pavel Machek
2003-09-27 21:21                                   ` Vojtech Pavlik
2003-09-27 21:58                                     ` Matt Gibson
2003-09-28  9:49                                       ` Vojtech Pavlik
2003-09-25 22:57             ` [PATCH 6/8] Extend KD?BENT to handle > 256 keycodes Andrew Morton
2003-09-25 23:21               ` Vojtech Pavlik
2003-09-25 23:38             ` Andries Brouwer
2003-09-26  6:20               ` Vojtech Pavlik
2003-10-05 15:12           ` [PATCH 5/8] Rely less on sanity of AT keyboards Martin Josefsson
2003-09-25 18:13 ` My current patches Peter Osterlund

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=1064508612553@twilight.ucw.cz \
    --to=vojtech@suse.cz \
    --cc=Andries.Brouwer@cwi.nl \
    --cc=akpm@osdl.org \
    --cc=dtor_core@ameritech.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=petero2@telia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.