From patchwork Sun Jan 23 23:26:41 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 499521 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 p0NNRBqn013362 for ; Sun, 23 Jan 2011 23:27:12 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752433Ab1AWX1L (ORCPT ); Sun, 23 Jan 2011 18:27:11 -0500 Received: from mail-gw0-f46.google.com ([74.125.83.46]:44184 "EHLO mail-gw0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194Ab1AWX1K (ORCPT ); Sun, 23 Jan 2011 18:27:10 -0500 Received: by gwj20 with SMTP id 20so1086308gwj.19 for ; Sun, 23 Jan 2011 15:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer; bh=yqbzaSM1a8DDluil+yHHg7HCGy9qCAkEGFtvRGTDCxM=; b=IZJHs9FDU+rtaX7s5/DnM8VH9g3WubVFPbp5/L8JM+qLt9HaB/dUDKDMmX7lbqCAzW XYW+rMb414xXzis/clDLno+1DAicstMr1A70YGN9PtUnudWg11oZ/kHSrL7zE/hUfDU/ hAxK0eClphWJm6mrGzAKzCqwkuIU42p/YZrp8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer; b=jE+/ia4/OUgNricc1aBMCoVcwzZPK8pnTKJWH1PtecrLh2NQCZqCKgvoOxlgZJYVlY LE7rV56h7FcQJvdjlol+6/RiSV97FAXGTpK7R6+geZr6qKvhXLstgn8f6ZAEdqqp6vVW GfP47ZouAk3J9ztWY7qxPuw7qPRAPT6moGz2o= Received: by 10.151.112.6 with SMTP id p6mr3824077ybm.274.1295825229292; Sun, 23 Jan 2011 15:27:09 -0800 (PST) Received: from localhost.localdomain (c-71-193-252-72.hsd1.wa.comcast.net [71.193.252.72]) by mx.google.com with ESMTPS id v7sm2380346ybe.3.2011.01.23.15.27.07 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sun, 23 Jan 2011 15:27:08 -0800 (PST) From: Ping Cheng To: linux-input@vger.kernel.org Cc: dmitry.torokhov@gmail.com, Ping Cheng , Ping Cheng Subject: [PATCH 2/2] input: wacom - Pass touch resolution to clients through input_absinfo Date: Sun, 23 Jan 2011 15:26:41 -0800 Message-Id: <1295825201-12567-1-git-send-email-pinglinux@gmail.com> X-Mailer: git-send-email 1.7.3.4 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.6 (demeter1.kernel.org [140.211.167.41]); Sun, 23 Jan 2011 23:27:51 +0000 (UTC) diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index f44c822..497d0ba 100644 --- a/drivers/input/tablet/wacom_wac.c +++ b/drivers/input/tablet/wacom_wac.c @@ -1105,7 +1105,7 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, struct wacom_wac *wacom_wac) { struct wacom_features *features = &wacom_wac->features; - int i; + int i, res; input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); @@ -1228,8 +1228,13 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, case TABLETPC: if (features->device_type == BTN_TOOL_DOUBLETAP || features->device_type == BTN_TOOL_TRIPLETAP) { - input_set_abs_params(input_dev, ABS_RX, 0, features->x_phy, 0, 0); - input_set_abs_params(input_dev, ABS_RY, 0, features->y_phy, 0, 0); + /* set touch resolution in points/mm */ + res = features->x_phy/100; + input_abs_set_res(input_dev, ABS_X, + features->x_max/res); + res = features->y_phy/100; + input_abs_set_res(input_dev, ABS_Y, + features->y_max/res); __set_bit(BTN_TOOL_DOUBLETAP, input_dev->keybit); } @@ -1272,6 +1277,13 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, features->pressure_max, features->pressure_fuzz, 0); + /* set touch resolution in points/mm */ + res = features->x_phy/100; + input_abs_set_res(input_dev, ABS_X, + features->x_max/res); + res = features->y_phy/100; + input_abs_set_res(input_dev, ABS_Y, + features->y_max/res); } else if (features->device_type == BTN_TOOL_PEN) { __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); __set_bit(BTN_TOOL_PEN, input_dev->keybit);