From patchwork Sun Jul 18 19:06:06 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: chris@cnpbagwell.com X-Patchwork-Id: 112612 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6IJ2rZH028715 for ; Sun, 18 Jul 2010 19:06:45 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757159Ab0GRTGo (ORCPT ); Sun, 18 Jul 2010 15:06:44 -0400 Received: from mail-gy0-f174.google.com ([209.85.160.174]:59382 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757154Ab0GRTGo (ORCPT ); Sun, 18 Jul 2010 15:06:44 -0400 Received: by gyh4 with SMTP id 4so1888086gyh.19 for ; Sun, 18 Jul 2010 12:06:43 -0700 (PDT) Received: by 10.150.139.21 with SMTP id m21mr3558646ybd.403.1279480003360; Sun, 18 Jul 2010 12:06:43 -0700 (PDT) Received: from localhost.localdomain (adsl-69-149-32-180.dsl.rcsntx.swbell.net [69.149.32.180]) by mx.google.com with ESMTPS id u41sm4648481yba.22.2010.07.18.12.06.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 18 Jul 2010 12:06:42 -0700 (PDT) From: chris@cnpbagwell.com To: linux-input@vger.kernel.org Cc: Chris Bagwell Subject: [PATCH 1/2] input: synaptics - only report width on hardware that supports it Date: Sun, 18 Jul 2010 14:06:06 -0500 Message-Id: <1279479967-4499-1-git-send-email-chris@cnpbagwell.com> X-Mailer: git-send-email 1.7.1.1 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 (demeter.kernel.org [140.211.167.41]); Sun, 18 Jul 2010 19:06:45 +0000 (UTC) diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 40cea33..1b49d7f 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c @@ -496,7 +496,9 @@ static void synaptics_process_packet(struct psmouse *psmouse) } input_report_abs(dev, ABS_PRESSURE, hw.z); - input_report_abs(dev, ABS_TOOL_WIDTH, finger_width); + if (SYN_CAP_PALMDETECT(priv->capabilities)) + input_report_abs(dev, ABS_TOOL_WIDTH, finger_width); + input_report_key(dev, BTN_TOOL_FINGER, num_fingers == 1); input_report_key(dev, BTN_LEFT, hw.left); input_report_key(dev, BTN_RIGHT, hw.right); @@ -596,7 +598,9 @@ static void set_input_params(struct input_dev *dev, struct synaptics_data *priv) input_set_abs_params(dev, ABS_Y, YMIN_NOMINAL, priv->y_max ?: YMAX_NOMINAL, 0, 0); input_set_abs_params(dev, ABS_PRESSURE, 0, 255, 0, 0); - __set_bit(ABS_TOOL_WIDTH, dev->absbit); + + if (SYN_CAP_PALMDETECT(priv->capabilities)) + __set_bit(ABS_TOOL_WIDTH, dev->absbit); __set_bit(EV_KEY, dev->evbit); __set_bit(BTN_TOUCH, dev->keybit);