From patchwork Fri May 10 22:31:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Armstrong Skomra X-Patchwork-Id: 10939635 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 18B00912 for ; Fri, 10 May 2019 22:31:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0750B1FF29 for ; Fri, 10 May 2019 22:31:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ED9AA1FF1E; Fri, 10 May 2019 22:31:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CB0D1FF1E for ; Fri, 10 May 2019 22:31:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726866AbfEJWbx (ORCPT ); Fri, 10 May 2019 18:31:53 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:34379 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfEJWbx (ORCPT ); Fri, 10 May 2019 18:31:53 -0400 Received: by mail-pf1-f194.google.com with SMTP id n19so3938463pfa.1; Fri, 10 May 2019 15:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lFv1Iq80gvrOpz16EdFxXij3OTXcsreYnHEwj2xRAtA=; b=EE50nItZ66Nl0djP9SQezKGqpi+0x5zbIIja4ygYFlFyiLqBFRhHbYqgCgeY0pJ/BM u7wR2NR6q7P9OYcAnLZA16KKA5j0stsZz9ENWiqW6/+EvHiMKDzRZFt8bGKo/CJ6wWvk XAev27tGS6iHNh7knaIMJNC2klCEfbO+GJT/QNzfYcxhLAJFF7m5reYT2580AaThlnrp 0IWfsSg2K0Uaiph6p2IySqvACkiNK+oEr4/2wkp2LRN8tLKedeFEanh6AHtU5iAxFp8y rRzZzoEgxBtFI6RHyxUHS0jj6oOV+DglS9AbTh2sQ/OjqlYV0OkG1DEgK3ItIV9o/Jur N9Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lFv1Iq80gvrOpz16EdFxXij3OTXcsreYnHEwj2xRAtA=; b=Cy0pP00lCBBb/RZvCDPY9tZFerKK7q6vAZxtwp9Q0+/q1KaygugRIxEJd5kBeyyayA kShuENCxMJztK368f6o1OSqi+sd16YPMhksB4dtPAYR3PHglooR2pJtKOXl/HGvKyvXL JNt12/ohs9R1A3s5ImsukuLE8T/4PiB2PgwcoHDIV1uh3MNb6znhOIKmeAQkB95pdndI S+jEzG/h+XttEVyLtknsL+XWr5hPzMO7nJjkYb5H6musH94ycrdDCuvvp/VZCsb9mHO8 D8UIGNlXslc3fPaz/OtlQfDMT9UxagN+mjy3u3CHtaIV4WPjGtDnDD2TdG0mj57O7fH2 32bw== X-Gm-Message-State: APjAAAVdGaM1lYem6Dfg7l7KDG/gxNRaUakSD/5kzsxKcGtf3yPii2m2 Gp3DkYtx+oo7S5IZM/1xDCkGV5A0 X-Google-Smtp-Source: APXvYqzbEzmWUgHOseTNVtlwbhota1QVglvcChLF/yfewQqxYengQx1JuPpOE2BXtpQQPHvldgHWBA== X-Received: by 2002:a63:8242:: with SMTP id w63mr16486766pgd.169.1557527512546; Fri, 10 May 2019 15:31:52 -0700 (PDT) Received: from west.Home ([97.115.133.135]) by smtp.googlemail.com with ESMTPSA id i15sm14601205pfj.167.2019.05.10.15.31.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 15:31:51 -0700 (PDT) From: Aaron Armstrong Skomra X-Google-Original-From: Aaron Armstrong Skomra To: linux-input@vger.kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.com, pinglinux@gmail.com, jason.gerecke@wacom.com Cc: Aaron Armstrong Skomra , "# v4 . 11+" Subject: [PATCH 1/4] HID: wacom: generic: only switch the mode on devices with LEDs Date: Fri, 10 May 2019 15:31:16 -0700 Message-Id: <1557527479-9242-2-git-send-email-aaron.skomra@wacom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557527479-9242-1-git-send-email-aaron.skomra@wacom.com> References: <1557527479-9242-1-git-send-email-aaron.skomra@wacom.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Currently, the driver will attempt to set the mode on all devices with a center button, but some devices with a center button lack LEDs, and attempting to set the LEDs on devices without LEDs results in the kernel error message of the form: "leds input8::wacom-0.1: Setting an LED's brightness failed (-32)" This is because the generic codepath erroneously assumes that the BUTTON_CENTER usage indicates that the device has LEDs, the previously ignored TOUCH_RING_SETTING usage is a more accurate indication of the existence of LEDs on the device. Fixes: 10c55cacb8b2 ("HID: wacom: generic: support LEDs") Cc: # v4.11+ Signed-off-by: Aaron Armstrong Skomra Reviewed-by: Jason Gerecke --- drivers/hid/wacom_sys.c | 3 +++ drivers/hid/wacom_wac.c | 2 -- drivers/hid/wacom_wac.h | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c index a8633b1437b2..2e3e03df83da 100644 --- a/drivers/hid/wacom_sys.c +++ b/drivers/hid/wacom_sys.c @@ -307,6 +307,9 @@ static void wacom_feature_mapping(struct hid_device *hdev, wacom_hid_usage_quirk(hdev, field, usage); switch (equivalent_usage) { + case WACOM_HID_WD_TOUCH_RING_SETTING: + wacom->generic_has_leds = true; + break; case HID_DG_CONTACTMAX: /* leave touch_max as is if predefined */ if (!features->touch_max) { diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 09b8e4aac82f..10cce2ca6301 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1930,8 +1930,6 @@ static void wacom_wac_pad_usage_mapping(struct hid_device *hdev, features->device_type |= WACOM_DEVICETYPE_PAD; break; case WACOM_HID_WD_BUTTONCENTER: - wacom->generic_has_leds = true; - /* fall through */ case WACOM_HID_WD_BUTTONHOME: case WACOM_HID_WD_BUTTONUP: case WACOM_HID_WD_BUTTONDOWN: diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index 295fd3718caa..f67d871841c0 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -145,6 +145,7 @@ #define WACOM_HID_WD_OFFSETBOTTOM (WACOM_HID_UP_WACOMDIGITIZER | 0x0d33) #define WACOM_HID_WD_DATAMODE (WACOM_HID_UP_WACOMDIGITIZER | 0x1002) #define WACOM_HID_WD_DIGITIZERINFO (WACOM_HID_UP_WACOMDIGITIZER | 0x1013) +#define WACOM_HID_WD_TOUCH_RING_SETTING (WACOM_HID_UP_WACOMDIGITIZER | 0x1032) #define WACOM_HID_UP_G9 0xff090000 #define WACOM_HID_G9_PEN (WACOM_HID_UP_G9 | 0x02) #define WACOM_HID_G9_TOUCHSCREEN (WACOM_HID_UP_G9 | 0x11) From patchwork Fri May 10 22:34:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Armstrong Skomra X-Patchwork-Id: 10939645 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CCEA0912 for ; Fri, 10 May 2019 22:34:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B17A61FF1E for ; Fri, 10 May 2019 22:34:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A2F3F1FF2D; Fri, 10 May 2019 22:34:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 40B811FF1E for ; Fri, 10 May 2019 22:34:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726974AbfEJWem (ORCPT ); Fri, 10 May 2019 18:34:42 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:41910 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfEJWem (ORCPT ); Fri, 10 May 2019 18:34:42 -0400 Received: by mail-pg1-f194.google.com with SMTP id z3so3651182pgp.8; Fri, 10 May 2019 15:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=X50fW+pml6XSlMG3iikOcC6HOpNkii6b+z99gmbRhAE=; b=qHmuXMJQQdoguUqvvtNjrrco7bQ5bopKljNjE1muh96iIJHeNWKoV2RrPSRbxm9VE2 2PihJ/QuTxgnlPs5RQjV9Qkh8zEhCWVb9OKxHKmbcMUhyB+sQ3mzIp0VM3gJ9yqi53mG QQj36yxPTAJydryJnL3M8ghlpVtIhx7wL9146R1J3yWwPq+Vm2B5R1O6q1WjUTPniKZj iPUWGtyq8+hf4xFcn0q8zxGK6di/k6T/k9ebZP+h3IxtPuDQOd208y7zoqWXXgzSetN3 aWYSY82OPXoigusGJPU/GIm89jA5r7r1hWBg3Uevpj4fkZimECa6yerrfCu6yW2Z9bbM 7nzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X50fW+pml6XSlMG3iikOcC6HOpNkii6b+z99gmbRhAE=; b=Ob15wfU/wi+QKZSJA9mTjvJbQRwdV3J1menn+qc2cfH18bf1LvSgeAEn0awyAz33ha YoL0eslu544J2Ht42yoqjXrSL0jROhB05K/TzAvNE6KxGdBVnWH/fSz4GbB5cHOBU4Di Uh2HQyuAK12wvwjt4zlknvMmsOJxJhSZEUabZCB7si2UFQXu179UkcgzEwDKQ884u71L GfEnDY/nzd24/dvN84hT8wtkRz7n58Oey3dpQMzg5BJu/3IGPPBM73ssGKVY78StX+pi 01Zp++a7opZ3ylKOSz7ulTrAp5Z7d0eA5n4+r+mipWntx+Fn7bE3qecLD2YXDEGSwy4b QrKA== X-Gm-Message-State: APjAAAUk4OG0G5js+5BZHWKaSz2suDGDrlf9HRKDpXCUygnYN8W4WaVL 3xt4bwCMk54fEopukQCAJ/Ho3/yA X-Google-Smtp-Source: APXvYqzJFLtS2Z8Qs88TKDShDkYrCKQs/vTaYwaKAuO0+3n6GBDKKmsR/xGCw8AvPHXb4E6UcodN1g== X-Received: by 2002:aa7:9ab0:: with SMTP id x16mr10175594pfi.201.1557527680928; Fri, 10 May 2019 15:34:40 -0700 (PDT) Received: from west.Home ([97.115.133.135]) by smtp.googlemail.com with ESMTPSA id n13sm7192405pgh.6.2019.05.10.15.34.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 15:34:39 -0700 (PDT) From: Aaron Armstrong Skomra X-Google-Original-From: Aaron Armstrong Skomra To: linux-input@vger.kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.com, pinglinux@gmail.com, jason.gerecke@wacom.com Cc: Aaron Armstrong Skomra , "# v4 . 17+" Subject: [PATCH 2/4] HID: wacom: generic: Correct pad syncing Date: Fri, 10 May 2019 15:34:17 -0700 Message-Id: <1557527659-9417-1-git-send-email-aaron.skomra@wacom.com> X-Mailer: git-send-email 2.7.4 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Only sync the pad once per report, not once per collection. Also avoid syncing the pad on battery reports. Fixes: f8b6a74719b5 ("HID: wacom: generic: Support multiple tools per report") Cc: # v4.17+ Signed-off-by: Aaron Armstrong Skomra --- drivers/hid/wacom_wac.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 10cce2ca6301..e172c7dda68c 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2121,14 +2121,12 @@ static void wacom_wac_pad_report(struct hid_device *hdev, bool active = wacom_wac->hid_data.inrange_state != 0; /* report prox for expresskey events */ - if ((wacom_equivalent_usage(field->physical) == HID_DG_TABLETFUNCTIONKEY) && - wacom_wac->hid_data.pad_input_event_flag) { + if (wacom_wac->hid_data.pad_input_event_flag) { input_event(input, EV_ABS, ABS_MISC, active ? PAD_DEVICE_ID : 0); input_sync(input); if (!active) wacom_wac->hid_data.pad_input_event_flag = false; } - } static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, @@ -2704,9 +2702,7 @@ static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *repo if (report->type != HID_INPUT_REPORT) return -1; - if (WACOM_PAD_FIELD(field) && wacom->wacom_wac.pad_input) - wacom_wac_pad_report(hdev, report, field); - else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) + if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) wacom_wac_pen_report(hdev, report); else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input) wacom_wac_finger_report(hdev, report); @@ -2720,7 +2716,7 @@ void wacom_wac_report(struct hid_device *hdev, struct hid_report *report) struct wacom_wac *wacom_wac = &wacom->wacom_wac; struct hid_field *field; bool pad_in_hid_field = false, pen_in_hid_field = false, - finger_in_hid_field = false; + finger_in_hid_field = false, true_pad = false; int r; int prev_collection = -1; @@ -2736,6 +2732,8 @@ void wacom_wac_report(struct hid_device *hdev, struct hid_report *report) pen_in_hid_field = true; if (WACOM_FINGER_FIELD(field)) finger_in_hid_field = true; + if (wacom_equivalent_usage(field->physical) == HID_DG_TABLETFUNCTIONKEY) + true_pad = true; } wacom_wac_battery_pre_report(hdev, report); @@ -2759,6 +2757,9 @@ void wacom_wac_report(struct hid_device *hdev, struct hid_report *report) } wacom_wac_battery_report(hdev, report); + + if (true_pad && wacom->wacom_wac.pad_input) + wacom_wac_pad_report(hdev, report, field); } static int wacom_bpt_touch(struct wacom_wac *wacom) From patchwork Fri May 10 22:34:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Armstrong Skomra X-Patchwork-Id: 10939647 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CEDD4912 for ; Fri, 10 May 2019 22:34:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE8781FF1E for ; Fri, 10 May 2019 22:34:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B24001FF2D; Fri, 10 May 2019 22:34:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5A65C1FF1E for ; Fri, 10 May 2019 22:34:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727680AbfEJWeu (ORCPT ); Fri, 10 May 2019 18:34:50 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43724 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfEJWet (ORCPT ); Fri, 10 May 2019 18:34:49 -0400 Received: by mail-pg1-f194.google.com with SMTP id t22so3645256pgi.10; Fri, 10 May 2019 15:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=AfhCRsPrLO5ktBE/rlETYfGiAlxX8pGLDs/MHAUg5rk=; b=fCNC4W/cjYlgMJzEGkGLXK6D78Xo2g/Jig5kiGmVD3weaWs/+hwoggT9NO4Km20yq3 oolVVCvUNiq3Lkivuy60B1i6AOP09D99pW6XFa18sfpAs4e/Ds9+7wr5jkwt/xGPXa8o eYxbheEJ49AvX/qyJnM3JqY0AuLQcb3H59lhUOVfc+fXdgWFiG3yYPKVG0yWmneKT9K6 r0NwptthbKNIhxmCU5UbVNNfKem6FUdsU0Z5sW/xQMOW1lMRPrnamAl8wuYWAybmeBIj UqAFgX2RadfedGInVXiPZUaao7DzJYQmSa2pJwSci6Tjv3fTOP4gsHZtOlvtnvo3eKGi MhrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=AfhCRsPrLO5ktBE/rlETYfGiAlxX8pGLDs/MHAUg5rk=; b=tNkrkKSR6eBNpYNsBclRT+LKtKwk6rzjenOE1hhaHa0lvuOjp6fQM+AOWfxZWwdxDG 9anDbyuj5LiLdmu28i74vT0wDTe+wX4fmkDERp6d6wuQHFCydQMiH1FEhVSjD8KM4r/2 sne8CbmoHMiYQmbBtkRaaAqW2KhcvhBrDSf6/dbQA/Dd55ea4It/kSofxhHOrdnSsABW dIivEbcbI8gViMlxonr36hrX7qlQ/OHE3JEqysR7oRuCBt237feStTvbXszYXze76ljR H8/eZG+vI0oPHEay0lC+GS/Xm/SU6ncdatPahQ9Yi3RcSFgWWWcMxMQhj45Va7GE1HAX ijww== X-Gm-Message-State: APjAAAVQtmZA+fHs9eXuNXPLJNQMIOicku3ytaWlnv+DXlZ2QNi+mG1u ieyBBGCwQF1Wsa9DJgsuS4Cs0wKz X-Google-Smtp-Source: APXvYqzLHFSfSP02G7Z9v+xP60bPLlrp7WB9g68k3xFF+6oRPP/9XVwg9I2cPzgZC6qiFN6KsY+DZg== X-Received: by 2002:aa7:96ec:: with SMTP id i12mr4891467pfq.82.1557527688660; Fri, 10 May 2019 15:34:48 -0700 (PDT) Received: from west.Home ([97.115.133.135]) by smtp.googlemail.com with ESMTPSA id n13sm7192405pgh.6.2019.05.10.15.34.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 15:34:47 -0700 (PDT) From: Aaron Armstrong Skomra X-Google-Original-From: Aaron Armstrong Skomra To: linux-input@vger.kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.com, pinglinux@gmail.com, jason.gerecke@wacom.com Cc: Aaron Armstrong Skomra , "# v4 . 11+" Subject: [PATCH 3/4] HID: wacom: correct touch resolution x/y typo Date: Fri, 10 May 2019 15:34:18 -0700 Message-Id: <1557527659-9417-2-git-send-email-aaron.skomra@wacom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557527659-9417-1-git-send-email-aaron.skomra@wacom.com> References: <1557527659-9417-1-git-send-email-aaron.skomra@wacom.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This affects the 2nd-gen Intuos Pro Medium and Large when using their Bluetooth connection. Fixes: 4922cd26f03c ("HID: wacom: Support 2nd-gen Intuos Pro's Bluetooth classic interface") Cc: # v4.11+ Signed-off-by: Aaron Armstrong Skomra Reviewed-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index e172c7dda68c..447394cc4222 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -3716,7 +3716,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, 0, 5920, 4, 0); } input_abs_set_res(input_dev, ABS_MT_POSITION_X, 40); - input_abs_set_res(input_dev, ABS_MT_POSITION_X, 40); + input_abs_set_res(input_dev, ABS_MT_POSITION_Y, 40); /* fall through */ From patchwork Fri May 10 22:34:19 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Armstrong Skomra X-Patchwork-Id: 10939649 X-Patchwork-Delegate: jikos@jikos.cz Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D036E912 for ; Fri, 10 May 2019 22:34:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C03561FE84 for ; Fri, 10 May 2019 22:34:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B1BE61FF2D; Fri, 10 May 2019 22:34:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2CBA71FF29 for ; Fri, 10 May 2019 22:34:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbfEJWe4 (ORCPT ); Fri, 10 May 2019 18:34:56 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:42556 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726839AbfEJWe4 (ORCPT ); Fri, 10 May 2019 18:34:56 -0400 Received: by mail-pg1-f193.google.com with SMTP id 145so3649082pgg.9 for ; Fri, 10 May 2019 15:34:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=1cQ1cQO4SPEv1RsQR3GwyI/hiE3blJZLusjhMvS5drI=; b=sPTGm/VCnJ5t9DyIEOahE0/7IoDB869NRD/VSvJXn68RjQHW+k5HsXiO3qhmB5VeTL +qQc05o73JZpLnmpQfSftoJ1L+dvJI+s6punwfbkxluJT7BollonNgXFACKfFEbLZLEl 07wrBzOGpohIGOkuvq8Ec2cPJPQ+GcfThaQkmwyMa7H7k9hR2u7patAyLXWr0Ym5brZW 4ISrJa9UI23t/Zu+5JHR4+CallfNum/aueIP2NRtLu4XNGxGYW/7S3mJmBL08sLRqHKE rqOWSvEEmig31KppEJmgVjvxXpMp5Ip0GB6ZJ3FBlVQaNYA6JVqZ8vlTB1LSMfIHOtCO AkBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=1cQ1cQO4SPEv1RsQR3GwyI/hiE3blJZLusjhMvS5drI=; b=eAJyqAigyjLNMVY+JRNE6PK5k11m2TZ6C5pC0tBw/DzZpsl7UMjlKSSGHTemd7MNom GNEhGjPO4cpZEKoHAgXQcu2sVEY9kE7aKHek6/kWrJKv7OEXqXAiwwqimBn8tV4ki5VN OFV+zmWaWjEdw73Q3MzIz3dndZ02UxqTp4sqWCInJf0L0oog1DEdfW/B8g0JWPZktcfn A1iAYE5oHxvA4eOX+ZykYzcWzTXag3OK4++ZwoOYwZeQDEfH/dlFD5f0Guyj27VRAGz5 EiX3OzIM1QHKGhrK0fIXYGCdhGYPxfDzOANJ2aYl7+AagsjFOG8pt5phVe91K5wf4H9O xAxw== X-Gm-Message-State: APjAAAUbfXlkoBF++VpsXwmUmtpmTY5GTClv5jYEkPLGVUzYKsby7B9V RcgD9gVRCiew+GEHoCXwV2oLbNsc X-Google-Smtp-Source: APXvYqzXlOAy8Lv22m3EkCVh9A+Y8h9qGfCJNhNh6/Nz4VizAKH664f5TU2tDtUEb/qkOUDjpzcQIg== X-Received: by 2002:a63:c94a:: with SMTP id y10mr16466295pgg.168.1557527695267; Fri, 10 May 2019 15:34:55 -0700 (PDT) Received: from west.Home ([97.115.133.135]) by smtp.googlemail.com with ESMTPSA id n13sm7192405pgh.6.2019.05.10.15.34.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 10 May 2019 15:34:54 -0700 (PDT) From: Aaron Armstrong Skomra X-Google-Original-From: Aaron Armstrong Skomra To: linux-input@vger.kernel.org, jikos@kernel.org, benjamin.tissoires@redhat.com, pinglinux@gmail.com, jason.gerecke@wacom.com Cc: Aaron Armstrong Skomra Subject: [PATCH 4/4] HID: wacom: Add 2nd gen Intuos Pro Small support Date: Fri, 10 May 2019 15:34:19 -0700 Message-Id: <1557527659-9417-3-git-send-email-aaron.skomra@wacom.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1557527659-9417-1-git-send-email-aaron.skomra@wacom.com> References: <1557527659-9417-1-git-send-email-aaron.skomra@wacom.com> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The existing INTUOSP2_BT device class supports LEDs and this device does not. A new device class enum entry, "INTUOSP2S_BT", is created to avoid the INTUOSP2_BT LED code. Signed-off-by: Aaron Armstrong Skomra Reviewed-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 30 +++++++++++++++++++++++++----- drivers/hid/wacom_wac.h | 1 + 2 files changed, 26 insertions(+), 5 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 447394cc4222..da0dc2620086 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1220,7 +1220,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) unsigned char *data = wacom->data; int i; - if (wacom->features.type == INTUOSP2_BT) { + if (wacom->features.type == INTUOSP2_BT || + wacom->features.type == INTUOSP2S_BT) { wacom->serial[0] = get_unaligned_le64(&data[99]); wacom->id[0] = get_unaligned_le16(&data[107]); pen_frame_len = 14; @@ -1272,7 +1273,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) input_report_abs(pen_input, ABS_X, get_unaligned_le16(&frame[1])); input_report_abs(pen_input, ABS_Y, get_unaligned_le16(&frame[3])); - if (wacom->features.type == INTUOSP2_BT) { + if (wacom->features.type == INTUOSP2_BT || + wacom->features.type == INTUOSP2S_BT) { /* Fix rotation alignment: userspace expects zero at left */ int16_t rotation = (int16_t)get_unaligned_le16(&frame[9]); @@ -1293,7 +1295,8 @@ static void wacom_intuos_pro2_bt_pen(struct wacom_wac *wacom) if (wacom->tool[0]) { input_report_abs(pen_input, ABS_PRESSURE, get_unaligned_le16(&frame[5])); - if (wacom->features.type == INTUOSP2_BT) { + if (wacom->features.type == INTUOSP2_BT || + wacom->features.type == INTUOSP2S_BT) { input_report_abs(pen_input, ABS_DISTANCE, range ? frame[13] : wacom->features.distance_max); } else { @@ -1460,7 +1463,8 @@ static int wacom_intuos_pro2_bt_irq(struct wacom_wac *wacom, size_t len) } wacom_intuos_pro2_bt_pen(wacom); - if (wacom->features.type == INTUOSP2_BT) { + if (wacom->features.type == INTUOSP2_BT || + wacom->features.type == INTUOSP2S_BT) { wacom_intuos_pro2_bt_touch(wacom); wacom_intuos_pro2_bt_pad(wacom); wacom_intuos_pro2_bt_battery(wacom); @@ -3228,6 +3232,7 @@ void wacom_wac_irq(struct wacom_wac *wacom_wac, size_t len) break; case INTUOSP2_BT: + case INTUOSP2S_BT: case INTUOSHT3_BT: sync = wacom_intuos_pro2_bt_irq(wacom_wac, len); break; @@ -3408,7 +3413,8 @@ void wacom_setup_device_quirks(struct wacom *wacom) if (features->type == REMOTE) features->device_type = WACOM_DEVICETYPE_PAD; - if (features->type == INTUOSP2_BT) { + if (features->type == INTUOSP2_BT || + features->type == INTUOSP2S_BT) { features->device_type |= WACOM_DEVICETYPE_PEN | WACOM_DEVICETYPE_PAD | WACOM_DEVICETYPE_TOUCH; @@ -3589,6 +3595,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, case INTUOS5S: case INTUOSPS: case INTUOSP2_BT: + case INTUOSP2S_BT: input_set_abs_params(input_dev, ABS_DISTANCE, 0, features->distance_max, features->distance_fuzz, 0); @@ -3700,6 +3707,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, switch (features->type) { case INTUOSP2_BT: + case INTUOSP2S_BT: input_dev->evbit[0] |= BIT_MASK(EV_SW); __set_bit(SW_MUTE_DEVICE, input_dev->swbit); @@ -3715,6 +3723,12 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, 5920, 4, 0); } + else if (wacom_wac->shared->touch->product == 0x393) { + input_set_abs_params(input_dev, ABS_MT_POSITION_X, + 0, 6400, 4, 0); + input_set_abs_params(input_dev, ABS_MT_POSITION_Y, + 0, 4000, 4, 0); + } input_abs_set_res(input_dev, ABS_MT_POSITION_X, 40); input_abs_set_res(input_dev, ABS_MT_POSITION_Y, 40); @@ -4024,6 +4038,7 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, case INTUOS5S: case INTUOSPS: case INTUOSP2_BT: + case INTUOSP2S_BT: input_set_abs_params(input_dev, ABS_WHEEL, 0, 71, 0, 0); break; @@ -4601,6 +4616,10 @@ static const struct wacom_features wacom_features_0x37A = static const struct wacom_features wacom_features_0x37B = { "Wacom One by Wacom M", 21600, 13500, 2047, 63, BAMBOO_PEN, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; +static const struct wacom_features wacom_features_0x393 = + { "Wacom Intuos Pro S", 31920, 19950, 8191, 63, + INTUOSP2S_BT, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 7, + .touch_max = 10 }; static const struct wacom_features wacom_features_HID_ANY_ID = { "Wacom HID", .type = HID_GENERIC, .oVid = HID_ANY_ID, .oPid = HID_ANY_ID }; @@ -4773,6 +4792,7 @@ const struct hid_device_id wacom_ids[] = { { BT_DEVICE_WACOM(0x379) }, { USB_DEVICE_WACOM(0x37A) }, { USB_DEVICE_WACOM(0x37B) }, + { BT_DEVICE_WACOM(0x393) }, { USB_DEVICE_WACOM(0x4001) }, { USB_DEVICE_WACOM(0x4004) }, { USB_DEVICE_WACOM(0x5000) }, diff --git a/drivers/hid/wacom_wac.h b/drivers/hid/wacom_wac.h index f67d871841c0..48f08f8a556d 100644 --- a/drivers/hid/wacom_wac.h +++ b/drivers/hid/wacom_wac.h @@ -215,6 +215,7 @@ enum { INTUOSPM, INTUOSPL, INTUOSP2_BT, + INTUOSP2S_BT, INTUOSHT3_BT, WACOM_21UX2, WACOM_22HD,