linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chase Douglas <chase.douglas@canonical.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Henrik Rydberg <rydberg@euromail.se>
Cc: Chris Bagwell <chris@cnpbagwell.com>,
	Peter Hutterer <peter.hutterer@who-t.net>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 4/4] Input: synaptics - Add support for ABS_RECT_*
Date: Tue, 14 Dec 2010 13:21:12 -0800	[thread overview]
Message-ID: <1292361672-2581-5-git-send-email-chase.douglas@canonical.com> (raw)
In-Reply-To: <1292361672-2581-1-git-send-email-chase.douglas@canonical.com>

Add support for partial multitouch support through the ABS_RECT_* evdev
codes.

Signed-off-by: Chase Douglas <chase.douglas@canonical.com>
---
 drivers/input/mouse/synaptics.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
index 2e300a4..7cebdce 100644
--- a/drivers/input/mouse/synaptics.c
+++ b/drivers/input/mouse/synaptics.c
@@ -525,6 +525,13 @@ static void synaptics_process_packet(struct psmouse *psmouse)
 	}
 	input_report_abs(dev, ABS_PRESSURE, hw.z);
 
+	if (priv->multitouch && num_fingers >= 2) {
+		input_report_abs(dev, ABS_RECT_MIN_X, min(hw.x, priv->mt.x));
+		input_report_abs(dev, ABS_RECT_MAX_X, max(hw.x, priv->mt.x));
+		input_report_abs(dev, ABS_RECT_MIN_Y, min(hw.y, priv->mt.y));
+		input_report_abs(dev, ABS_RECT_MAX_Y, max(hw.y, priv->mt.y));
+	}
+
 	if (SYN_CAP_PALMDETECT(priv->capabilities))
 		input_report_abs(dev, ABS_TOOL_WIDTH, finger_width);
 
@@ -667,6 +674,17 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv)
 		__clear_bit(BTN_RIGHT, dev->keybit);
 		__clear_bit(BTN_MIDDLE, dev->keybit);
 	}
+
+	if (priv->multitouch) {
+		input_set_abs_params(dev, ABS_RECT_MIN_X, XMIN_NOMINAL,
+				     priv->x_max ?: XMAX_NOMINAL, 0, 0);
+		input_set_abs_params(dev, ABS_RECT_MAX_X, XMIN_NOMINAL,
+				     priv->x_max ?: XMAX_NOMINAL, 0, 0);
+		input_set_abs_params(dev, ABS_RECT_MIN_Y, YMIN_NOMINAL,
+				     priv->y_max ?: YMAX_NOMINAL, 0, 0);
+		input_set_abs_params(dev, ABS_RECT_MAX_Y, YMIN_NOMINAL,
+				     priv->y_max ?: YMAX_NOMINAL, 0, 0);
+	}
 }
 
 static void synaptics_disconnect(struct psmouse *psmouse)
-- 
1.7.1

  parent reply	other threads:[~2010-12-14 21:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-14 21:21 [PATCH 0/4] Alternative approach to MT_TOOL_ENVELOPE Chase Douglas
2010-12-14 21:21 ` [PATCH 1/4] Revert "input: mt: Interface and MT_TOOL documentation updates" Chase Douglas
2010-12-14 21:21 ` [PATCH 2/4] Documentation: Add evdev type and code definitions Chase Douglas
2010-12-15 23:59   ` Peter Hutterer
2010-12-16 14:56     ` Chris Bagwell
2010-12-16 16:57       ` Dmitry Torokhov
2011-01-07 20:39       ` Chase Douglas
2011-01-07 20:34     ` Chase Douglas
2010-12-16 14:12   ` Henrik Rydberg
2011-01-07 20:43     ` Chase Douglas
2010-12-17 10:18   ` Nikolai Kondrashov
2010-12-14 21:21 ` [PATCH 3/4] Input: Add ABS_RECT_* legacy multitouch evdev codes Chase Douglas
2010-12-14 21:21 ` Chase Douglas [this message]
2010-12-14 21:38 ` [PATCH 0/4] Alternative approach to MT_TOOL_ENVELOPE Chase Douglas
2010-12-14 22:12 ` Dmitry Torokhov
2010-12-15  0:21   ` Chase Douglas
2010-12-15  1:37     ` Henrik Rydberg
2010-12-15  7:25       ` Dmitry Torokhov
2010-12-15 17:31         ` Chase Douglas
2010-12-15 20:25           ` Chris Bagwell

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=1292361672-2581-5-git-send-email-chase.douglas@canonical.com \
    --to=chase.douglas@canonical.com \
    --cc=chris@cnpbagwell.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.hutterer@who-t.net \
    --cc=rydberg@euromail.se \
    /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;
as well as URLs for NNTP newsgroup(s).