From patchwork Tue Dec 14 21:21:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chase Douglas X-Patchwork-Id: 411571 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBELNE89031795 for ; Tue, 14 Dec 2010 21:23:15 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1760195Ab0LNVWf (ORCPT ); Tue, 14 Dec 2010 16:22:35 -0500 Received: from adelie.canonical.com ([91.189.90.139]:32873 "EHLO adelie.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760165Ab0LNVWd (ORCPT ); Tue, 14 Dec 2010 16:22:33 -0500 Received: from hutte.canonical.com ([91.189.90.181]) by adelie.canonical.com with esmtp (Exim 4.69 #1 (Debian)) id 1PScKN-0007ct-CX; Tue, 14 Dec 2010 21:22:31 +0000 Received: from [64.168.229.50] (helo=canonical.com) by hutte.canonical.com with esmtpsa (TLS-1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1PScKM-00081E-Sf; Tue, 14 Dec 2010 21:22:31 +0000 From: Chase Douglas To: Dmitry Torokhov , Henrik Rydberg Cc: Chris Bagwell , Peter Hutterer , 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 Message-Id: <1292361672-2581-5-git-send-email-chase.douglas@canonical.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1292361672-2581-1-git-send-email-chase.douglas@canonical.com> References: <1292361672-2581-1-git-send-email-chase.douglas@canonical.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Tue, 14 Dec 2010 21:23:16 +0000 (UTC) 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)