From patchwork Mon Nov 24 23:32:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 5370941 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 60EEC9F39D for ; Mon, 24 Nov 2014 23:32:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C3232015A for ; Mon, 24 Nov 2014 23:32:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87BCB2014A for ; Mon, 24 Nov 2014 23:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751240AbaKXXc3 (ORCPT ); Mon, 24 Nov 2014 18:32:29 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:35421 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751139AbaKXXc2 (ORCPT ); Mon, 24 Nov 2014 18:32:28 -0500 Received: by mail-pd0-f170.google.com with SMTP id fp1so10730838pdb.29 for ; Mon, 24 Nov 2014 15:32:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lPXQ99YydDlIjh6E2d0iOAER6JgJ2JxbkeUKA1VrqxI=; b=m6eG57G6T2k/truwTNMJMFJwGLbNbx7mLeebOeqBg8THZZI8ZkIn6NHy3k1dsB8q1K FGfc/ZFz3WAubGnG3cjKGYry0XphAkvqqWJyfTvhBo2NN2p/Nw+rfGOxtv7sEoe8H5oF 8b9p9UBWuFwLFy80x2FzKDl3GNwsnT6GL+xh1RIFK8CxObHtDq7fwydhxP7xGDaXPpuL rfK3ECuUO7+TIKJjCw3mQ8ezmq2SPDLj0J0bUhPoOvbFJJtjtcF0crBhvQkPi7UbTEhm cN1E8kBQ3CI8qMiXpRhl4NjrOvPQOLgm4ivw9C1ZkWuzL5QtAw3LVeRis5Eikm3NhczK L8Ag== X-Received: by 10.66.66.42 with SMTP id c10mr25036305pat.4.1416871948155; Mon, 24 Nov 2014 15:32:28 -0800 (PST) Received: from wacom-arch2.localdomain ([67.51.163.2]) by mx.google.com with ESMTPSA id pc10sm13383820pbb.21.2014.11.24.15.32.26 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Nov 2014 15:32:26 -0800 (PST) From: Jason Gerecke To: jkosina@suse.cz Cc: linux-input@vger.kernel.org, benjamin.tissoires@gmail.com, pinglinux@gmail.com, Jason Gerecke Subject: [PATCH 2/3] HID: wacom: Manually declare ABS_{X, Y} for pointer emulation Date: Mon, 24 Nov 2014 15:32:13 -0800 Message-Id: <1416871934-14133-3-git-send-email-killertofu@gmail.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1416871934-14133-1-git-send-email-killertofu@gmail.com> References: <1416871934-14133-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-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If a HID descriptor places HID_DG_CONTACTID before HID_DG_X and HID_DG_Y then the ABS_X and ABS_Y will not be automatically initialized by the call to input_mt_init_slots. Here we move the setup of those axes outside of the 'if' statement so that they're always present if the associated HID field is. Signed-off-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 1468f00..a55e0ed 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1382,16 +1382,14 @@ static void wacom_wac_finger_usage_mapping(struct hid_device *hdev, switch (usage->hid) { case HID_GD_X: - if (touch_max == 1) - wacom_map_usage(wacom, usage, field, EV_ABS, ABS_X, 4); - else + wacom_map_usage(wacom, usage, field, EV_ABS, ABS_X, 4); + if (touch_max > 1) wacom_map_usage(wacom, usage, field, EV_ABS, ABS_MT_POSITION_X, 4); break; case HID_GD_Y: - if (touch_max == 1) - wacom_map_usage(wacom, usage, field, EV_ABS, ABS_Y, 4); - else + wacom_map_usage(wacom, usage, field, EV_ABS, ABS_Y, 4); + if (touch_max > 1) wacom_map_usage(wacom, usage, field, EV_ABS, ABS_MT_POSITION_Y, 4); break;