From patchwork Wed Jan 6 21:25:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gerecke, Jason" X-Patchwork-Id: 7971291 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BCCFABEEE5 for ; Wed, 6 Jan 2016 21:26:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D975D20149 for ; Wed, 6 Jan 2016 21:26:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D1E332013D for ; Wed, 6 Jan 2016 21:26:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752041AbcAFV0F (ORCPT ); Wed, 6 Jan 2016 16:26:05 -0500 Received: from mail-pa0-f53.google.com ([209.85.220.53]:33205 "EHLO mail-pa0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752010AbcAFV0E (ORCPT ); Wed, 6 Jan 2016 16:26:04 -0500 Received: by mail-pa0-f53.google.com with SMTP id cy9so240346020pac.0 for ; Wed, 06 Jan 2016 13:26:04 -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=vLt7XWYtNijwPRpyM/b+tPUVuSY8//SlsBApJKryJsA=; b=tqhJKfSobtnIULAplYD2GMNNPlAIwRQ1UCs6jaNOy3YEquRBQfiz7K4etlp2nuKe3n 6UoHfE8ignjLYCSKLSF8iYPhOUYqos46GjRSDWMPOQXLF23R0aPArsBQvuxvdWzvb06l /0mE8IekPi+5MSItrbULEdS7+ANn2qU7k47LdRtmajAsmMXboWBHbUKeERVrzHeEwbIJ 3cvMsqk+D9RHJ8kukWzug5QY8L1DV0WlFlsqa4lG0L0oIESB22ssU/bzXOEJiKhCbEkH cmo/u1JL7GjbLcT5b4Ly+xiJPIR3UdxKdsP6yOcT+MXL+sTHWvJAFIk9m4DRBdKx01Km XrXw== X-Received: by 10.66.232.170 with SMTP id tp10mr145353585pac.38.1452115564203; Wed, 06 Jan 2016 13:26:04 -0800 (PST) Received: from wacom-arch2.corp.onewacom.com ([67.51.163.2]) by smtp.gmail.com with ESMTPSA id xz6sm143199475pab.42.2016.01.06.13.26.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 06 Jan 2016 13:26:03 -0800 (PST) From: Jason Gerecke To: linux-input@vger.kernel.org Cc: Jiri Kosina , Ping Cheng , Aaron Skomra , Benjamin Tissoires , Jason Gerecke , Jason Gerecke Subject: [PATCH] HID: wacom: Use correct report to query pen ID from INTUOSHT2 devices Date: Wed, 6 Jan 2016 13:25:53 -0800 Message-Id: <1452115553-3129-1-git-send-email-killertofu@gmail.com> X-Mailer: git-send-email 2.6.3 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 Unlike other tablets which are compatible with the wacom_intuos_irq handler, INTUOSHT2 devices provide pen ID with report ID 8 instead of 5. To ensure wacom_intuos_schedule_prox_event works as intended for these tablets, we must be sure it uses the correct report ID in this case. Signed-off-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 6 +++++- drivers/hid/wacom_wac.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index f706604..3aeddc2 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -439,11 +439,15 @@ exit: static void wacom_intuos_schedule_prox_event(struct wacom_wac *wacom_wac) { struct wacom *wacom = container_of(wacom_wac, struct wacom, wacom_wac); + struct wacom_features *features = &wacom_wac->features; struct hid_report *r; struct hid_report_enum *re; re = &(wacom->hdev->report_enum[HID_FEATURE_REPORT]); - r = re->report_id_hash[WACOM_REPORT_INTUOS_ID1]; + if (features->type == INTUOSHT2) + r = re->report_id_hash[WACOM_REPORT_INTUOSHT2_ID]; + else + r = re->report_id_hash[WACOM_REPORT_INTUOS_ID1]; if (r) { hid_hw_request(wacom->hdev, r, HID_REQ_GET_REPORT); } diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 3f60192..25baa7f 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -70,6 +70,7 @@ #define WACOM_REPORT_DEVICE_LIST 16 #define WACOM_REPORT_INTUOS_PEN 16 #define WACOM_REPORT_REMOTE 17 +#define WACOM_REPORT_INTUOSHT2_ID 8 /* device quirks */ #define WACOM_QUIRK_BBTOUCH_LOWRES 0x0001