From patchwork Tue Jul 26 23:05:53 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yufeng Shen X-Patchwork-Id: 1009732 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p6QN6Yct004433 for ; Tue, 26 Jul 2011 23:06:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753591Ab1GZXGc (ORCPT ); Tue, 26 Jul 2011 19:06:32 -0400 Received: from smtp-out.google.com ([216.239.44.51]:20177 "EHLO smtp-out.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752159Ab1GZXGc (ORCPT ); Tue, 26 Jul 2011 19:06:32 -0400 Received: from kpbe14.cbf.corp.google.com (kpbe14.cbf.corp.google.com [172.25.105.78]) by smtp-out.google.com with ESMTP id p6QN6JXs002697; Tue, 26 Jul 2011 16:06:19 -0700 Received: from miletus1.wat.corp.google.com (miletus1.wat.corp.google.com [172.23.176.198]) by kpbe14.cbf.corp.google.com with ESMTP id p6QN6Gge024579; Tue, 26 Jul 2011 16:06:16 -0700 Received: by miletus1.wat.corp.google.com (Postfix, from userid 95428) id 05B0B16115C; Tue, 26 Jul 2011 19:06:15 -0400 (EDT) From: Yufeng Shen To: linux-input@vger.kernel.org Cc: Dmitry Torokhov , Henrik Rydberg , Iiro Valkonen , Joonyoung Shim , Chris Leech , linux-kernel@vger.kernel.org, Yufeng Shen Subject: [PATCH] Input: atmel_mxt_ts - Report pressure information from the driver Date: Tue, 26 Jul 2011 19:05:53 -0400 Message-Id: <1311721553-17241-1-git-send-email-miletus@chromium.org> X-Mailer: git-send-email 1.7.3.1 X-System-Of-Record: true 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 (demeter2.kernel.org [140.211.167.43]); Tue, 26 Jul 2011 23:06:34 +0000 (UTC) Atmel mxt1386 touch controller has the touch pressure information but the current driver atmel_mxt_ts does not expose it to the user space. This patch makes the driver report the touch pressure information to user space. Change-Id: Ie0e4683a3cd5ec79222f7682b0ddc24f909af543 --- drivers/input/touchscreen/atmel_mxt_ts.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index ae00604..7cedb06 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -244,6 +244,7 @@ struct mxt_finger { int x; int y; int area; + int pressure; }; /* Each client has this additional data */ @@ -536,6 +537,8 @@ static void mxt_input_report(struct mxt_data *data, int single_id) finger[id].x); input_report_abs(input_dev, ABS_MT_POSITION_Y, finger[id].y); + input_report_abs(input_dev, ABS_MT_PRESSURE, + finger[id].pressure); } else { finger[id].status = 0; } @@ -560,6 +563,7 @@ static void mxt_input_touchevent(struct mxt_data *data, int x; int y; int area; + int pressure; /* Check the touch is present on the screen */ if (!(status & MXT_DETECT)) { @@ -584,6 +588,7 @@ static void mxt_input_touchevent(struct mxt_data *data, y = y >> 2; area = message->message[4]; + pressure = message->message[5]; dev_dbg(dev, "[%d] %s x: %d, y: %d, area: %d\n", id, status & MXT_MOVE ? "moved" : "pressed", @@ -594,6 +599,7 @@ static void mxt_input_touchevent(struct mxt_data *data, finger[id].x = x; finger[id].y = y; finger[id].area = area; + finger[id].pressure = pressure; mxt_input_report(data, id); } @@ -1125,6 +1131,8 @@ static int __devinit mxt_probe(struct i2c_client *client, 0, data->max_x, 0, 0); input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, data->max_y, 0, 0); + input_set_abs_params(input_dev, ABS_MT_PRESSURE, + 0, 255, 0, 0); input_set_drvdata(input_dev, data); i2c_set_clientdata(client, data);