diff mbox

[Raring,Saucy,1/1] Input: cypress_ps2 - Return zero finger count if palm is detected.

Message ID 007c09ae4ef7f72ffb657de0fb3854fcbc6d88f0.1379968154.git.joseph.salisbury@canonical.com
State New
Headers show

Commit Message

Joseph Salisbury Sept. 24, 2013, 3:57 p.m. UTC
BugLink: http://bugs.launchpad.net/bugs/1229361

This patch sets the finger count to 0 in the case of palm contact.

Signed-off-by: Joseph Salisbury <joseph.salisbury@canonical.com>

---
 drivers/input/mouse/cypress_ps2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Tim Gardner Sept. 24, 2013, 8:57 p.m. UTC | #1

Stefan Bader Sept. 25, 2013, 7:32 a.m. UTC | #2
One cannot tell from the snipped whether there are other possibilities to get a
contact_cnt < 0, but as this applies to a very specific hw and was tested this
sounds good enough.
Andy Whitcroft Sept. 25, 2013, 1:56 p.m. UTC | #3
Applied to Raring and Saucy.

-apw
diff mbox

Patch

diff --git a/drivers/input/mouse/cypress_ps2.c b/drivers/input/mouse/cypress_ps2.c
index 45b3eda..95b2c40 100644
--- a/drivers/input/mouse/cypress_ps2.c
+++ b/drivers/input/mouse/cypress_ps2.c
@@ -441,7 +441,7 @@  static int cypress_get_finger_count(unsigned char header_byte)
 			case 2: return 5;
 			default:
 				/* Invalid contact (e.g. palm). Ignore it. */
-				return -1;
+				return 0;
 		}
 	}
 
@@ -460,7 +460,7 @@  static int cypress_parse_packet(struct psmouse *psmouse,
 
 	contact_cnt = cypress_get_finger_count(header_byte);
 
-	if (contact_cnt < 0) /* e.g. palm detect */
+	if (contact_cnt < 0)
 		return -EINVAL;
 
 	report_data->contact_cnt = contact_cnt;