From patchwork Fri Mar 11 06:47:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joonyoung Shim X-Patchwork-Id: 627351 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 p2B6oZKu011100 for ; Fri, 11 Mar 2011 06:50:36 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751278Ab1CKGuf (ORCPT ); Fri, 11 Mar 2011 01:50:35 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:33340 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751595Ab1CKGuf (ORCPT ); Fri, 11 Mar 2011 01:50:35 -0500 Received: from epmmp1 (mailout3.samsung.com [203.254.224.33]) by mailout3.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LHV00269S7409F0@mailout3.samsung.com> for linux-input@vger.kernel.org; Fri, 11 Mar 2011 15:47:28 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LHV00B7PS74KV@mmp1.samsung.com> for linux-input@vger.kernel.org; Fri, 11 Mar 2011 15:47:28 +0900 (KST) Received: from localhost.localdomain ([165.213.219.123]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Fri, 11 Mar 2011 15:47:28 +0900 Date: Fri, 11 Mar 2011 15:47:26 +0900 From: Joonyoung Shim Subject: [PATCH v2 4/4] Input: atmel_mxt_ts - Convert to MT protocol B To: dmitry.torokhov@gmail.com Cc: linux-input@vger.kernel.org, iiro.valkonen@atmel.com, rydberg@euromail.se, kyungmin.park@samsung.com Message-id: <1299826046-20081-1-git-send-email-jy0922.shim@samsung.com> X-Mailer: git-send-email 1.7.0.4 Content-transfer-encoding: 7BIT X-OriginalArrivalTime: 11 Mar 2011 06:47:28.0056 (UTC) FILETIME=[2FE2CB80:01CBDFB8] 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]); Fri, 11 Mar 2011 06:50:36 +0000 (UTC) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index fd1fda5..7d485c2 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include @@ -504,19 +504,20 @@ static void mxt_input_report(struct mxt_data *data, int single_id) if (!finger[id].status) continue; - input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, - finger[id].status != MXT_RELEASE ? - finger[id].area : 0); - input_report_abs(input_dev, ABS_MT_POSITION_X, - finger[id].x); - input_report_abs(input_dev, ABS_MT_POSITION_Y, - finger[id].y); - input_mt_sync(input_dev); + input_mt_slot(input_dev, id); + input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, + finger[id].status != MXT_RELEASE); - if (finger[id].status == MXT_RELEASE) - finger[id].status = 0; - else + if (finger[id].status != MXT_RELEASE) { finger_num++; + input_report_abs(input_dev, ABS_MT_TOUCH_MAJOR, + finger[id].area); + input_report_abs(input_dev, ABS_MT_POSITION_X, + finger[id].x); + input_report_abs(input_dev, ABS_MT_POSITION_Y, + finger[id].y); + } else + finger[id].status = 0; } input_report_key(input_dev, BTN_TOUCH, finger_num > 0); @@ -1091,6 +1092,7 @@ static int __devinit mxt_probe(struct i2c_client *client, 0, data->y_size, 0, 0); /* For multi touch */ + input_mt_init_slots(input_dev, MXT_MAX_FINGER); input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, MXT_MAX_AREA, 0, 0); input_set_abs_params(input_dev, ABS_MT_POSITION_X,