From patchwork Thu Jul 7 21:04:58 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 954262 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 p67L5YjL005142 for ; Thu, 7 Jul 2011 21:05:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932Ab1GGVFe (ORCPT ); Thu, 7 Jul 2011 17:05:34 -0400 Received: from mail-pv0-f174.google.com ([74.125.83.174]:65059 "EHLO mail-pv0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751916Ab1GGVFd (ORCPT ); Thu, 7 Jul 2011 17:05:33 -0400 Received: by mail-pv0-f174.google.com with SMTP id 12so722510pvg.19 for ; Thu, 07 Jul 2011 14:05:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=cnoc+piJ4XzsjFS3cobSABOI+C8a7pdPDqzGxodMF/M=; b=vgL/jce3vddVbje+RubmqjPR29Sj+cMngg4O5mZ/m6ts5KNcabKzonJnZYB8zapcwX WTGvxvQabrOeP3B8O3TMxZie7fmMwhhn5/HZQA+Sl+bY/p1dx9gDyVUI0/xK5XhfBnAs pthVJ5c2bNs2eeL6ZHidzsHNIxcv2YOjReQ3Y= Received: by 10.68.47.102 with SMTP id c6mr1822335pbn.441.1310072733545; Thu, 07 Jul 2011 14:05:33 -0700 (PDT) Received: from localhost.localdomain ([204.119.25.44]) by mx.google.com with ESMTPS id i9sm5811414pbk.4.2011.07.07.14.05.31 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jul 2011 14:05:32 -0700 (PDT) From: Jason Gerecke To: Dmitry Torokhov Cc: Linux Input , Ping Cheng , Jason Gerecke , Dima Zavin , Jason Gerecke Subject: [PATCH 2/4] Use MT (in addition to single-touch) protocol for all events Date: Thu, 7 Jul 2011 14:04:58 -0700 Message-Id: <1310072700-2829-2-git-send-email-killertofu@gmail.com> X-Mailer: git-send-email 1.7.5.2 In-Reply-To: <1310072700-2829-1-git-send-email-killertofu@gmail.com> References: <1310072700-2829-1-git-send-email-killertofu@gmail.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.6 (demeter2.kernel.org [140.211.167.43]); Thu, 07 Jul 2011 21:05:35 +0000 (UTC) Android (begining with Gingerbread) ignores all single-touch events from multi-touch capable devices. This patch augments the pen and single-touch handlers to emit MT events for Android's consumption. Signed-off-by: Jason Gerecke --- Now being sent upstream to LKML at the behest of Google. drivers/input/touchscreen/wacom_w8001.c | 14 ++++++++++++++ 1 files changed, 14 insertions(+), 0 deletions(-) diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c index 7630806..e94a21a 100644 --- a/drivers/input/touchscreen/wacom_w8001.c +++ b/drivers/input/touchscreen/wacom_w8001.c @@ -278,6 +278,13 @@ static void report_pen_events(struct w8001 *w8001, struct w8001_coord *coord) input_report_key(dev, BTN_TOUCH, coord->tsw); input_report_key(dev, BTN_STYLUS, coord->f1); input_report_key(dev, w8001->type, coord->rdy); + + input_report_abs(dev, ABS_MT_POSITION_X, coord->x); + input_report_abs(dev, ABS_MT_POSITION_Y, coord->y); + input_report_abs(dev, ABS_MT_PRESSURE, coord->pen_pressure); + input_report_abs(dev, ABS_MT_TOOL_TYPE, MT_TOOL_PEN); + + input_mt_sync(dev); input_sync(dev); if (!coord->rdy) @@ -298,6 +305,11 @@ static void report_single_touch(struct w8001 *w8001, struct w8001_coord *coord) input_report_key(dev, BTN_TOUCH, coord->tsw); input_report_key(dev, BTN_TOOL_FINGER, coord->tsw); + input_report_abs(dev, ABS_MT_POSITION_X, x); + input_report_abs(dev, ABS_MT_POSITION_Y, y); + input_report_abs(dev, ABS_MT_TOOL_TYPE, MT_TOOL_FINGER); + + input_mt_sync(dev); input_sync(dev); w8001->type = coord->tsw ? BTN_TOOL_FINGER : KEY_RESERVED; @@ -485,6 +497,8 @@ static int w8001_setup(struct w8001 *w8001) 0, touch.y, 0, 0); input_set_abs_params(dev, ABS_MT_TOOL_TYPE, 0, MT_TOOL_MAX, 0, 0); + input_set_abs_params(dev, ABS_MT_PRESSURE, + 0, coord.pen_pressure, 0, 0); strlcat(w8001->name, " 2FG", sizeof(w8001->name)); if (w8001->max_pen_x && w8001->max_pen_y)