From patchwork Sat Jan 9 01:14:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 7991531 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.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3A30F9F6FA for ; Sat, 9 Jan 2016 01:15:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C365201C8 for ; Sat, 9 Jan 2016 01:15:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8DBC4201C7 for ; Sat, 9 Jan 2016 01:15:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754522AbcAIBPb (ORCPT ); Fri, 8 Jan 2016 20:15:31 -0500 Received: from mail-pa0-f68.google.com ([209.85.220.68]:35679 "EHLO mail-pa0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752593AbcAIBPS (ORCPT ); Fri, 8 Jan 2016 20:15:18 -0500 Received: by mail-pa0-f68.google.com with SMTP id gi1so29468090pac.2 for ; Fri, 08 Jan 2016 17:15:17 -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; bh=Gr2jnYG2wCxqCg4R62B+zEoCDYnNwAASz5J9Yp50+Uw=; b=GLPvo7WMVFyyQsIGW2HnAr65GcRuill0ZFXreKdA824nMzMXKjswj52U08vZMHarWR VFp43es7LQtHgTr/Z0iZIjeZqNIQZXp9sz4EDbRaCvf21aJnZBUU+nbUJ8dxHju/dH+0 UyByjqaWAYIQu4ajBmSCf62DC6Owd0fZxGP9t0gBZAp1s92BS5rRLpxa0PQSX+C6UQlW DB7qmKi9kuuEM3250GU8wxL+ZOgwwDSuQ2xplVR5xpc9joMBm8ql9IeQpUhf4SZC2JP8 wIqKQTdHRDK786/JuY2n56gfIVOpTnDyPyzLA/XuHJcEC7Br6KV0td0Qyj6tnXsPvC2B z7zw== X-Received: by 10.66.159.226 with SMTP id xf2mr163138664pab.23.1452302117281; Fri, 08 Jan 2016 17:15:17 -0800 (PST) Received: from wacom-XPS-8500.corp.onewacom.com ([67.51.163.2]) by smtp.gmail.com with ESMTPSA id cf6sm65799541pad.41.2016.01.08.17.15.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 08 Jan 2016 17:15:16 -0800 (PST) From: Ping Cheng X-Google-Original-From: Ping Cheng To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, killertofu@gmail.com, Ping Cheng Subject: [PATCH 1/4] HID: wacom - request tool info only when we get general events Date: Fri, 8 Jan 2016 17:14:54 -0800 Message-Id: <1452302094-5521-1-git-send-email-pingc@wacom.com> X-Mailer: git-send-email 1.9.1 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, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Move wacom_intuos_schedule_prox_event inside wacom_intuos_general so we don't call it when general event data isn't ready. Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index f706604..6449547 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -746,13 +746,6 @@ static int wacom_intuos_inout(struct wacom_wac *wacom) return 2; } - /* don't report other events if we don't know the ID */ - if (!wacom->id[idx]) { - /* but reschedule a read of the current tool */ - wacom_intuos_schedule_prox_event(wacom); - return 1; - } - return 0; } @@ -893,6 +886,13 @@ static int wacom_intuos_general(struct wacom_wac *wacom) data[0] != WACOM_REPORT_INTUOS_PEN) return 0; + /* don't report events if we don't know the tool ID */ + if (!wacom->id[idx]) { + /* but reschedule a read of the current tool */ + wacom_intuos_schedule_prox_event(wacom); + return 1; + } + x = (be16_to_cpup((__be16 *)&data[2]) << 1) | ((data[9] >> 1) & 1); y = (be16_to_cpup((__be16 *)&data[4]) << 1) | (data[9] & 1); distance = data[9] >> 2;