From patchwork Wed Mar 15 00:08:16 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9624649 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AA95360424 for ; Wed, 15 Mar 2017 00:09:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 944A7285E2 for ; Wed, 15 Mar 2017 00:09:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8688E285EA; Wed, 15 Mar 2017 00:09:58 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 7B683285E2 for ; Wed, 15 Mar 2017 00:09:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750820AbdCOAJ5 (ORCPT ); Tue, 14 Mar 2017 20:09:57 -0400 Received: from mail-pg0-f65.google.com ([74.125.83.65]:35388 "EHLO mail-pg0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750815AbdCOAJ4 (ORCPT ); Tue, 14 Mar 2017 20:09:56 -0400 Received: by mail-pg0-f65.google.com with SMTP id g2so207353pge.2 for ; Tue, 14 Mar 2017 17:09: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; bh=4RlDSAnt1XgDu0J2yTWXCSK86Q+QJ6OGbQ/ZDIeERaU=; b=oeGuPAP57HDV4f44/sxyvzVnZ447tPLa5xvzbVe62FHP7ZYup0D30twapI3Pn28msz bPkeOGhxjrHljmfn0OPPrj98q2jTwFGQlEASvucxfTXk4ebLSijkEQrsL6DdDbU023yi Wen2sy9oI3P/82PLVKD/LxYa9fr9Frkgntmz6K83zIatcCQnQmus8lfUBhn/PRg/1oq4 tgzcftqFTO/Gz686sl4RMqqAcJMD6gH0btdLkBmmi6s99OlJYo6sn7DGqs0gGl98Z2FS AnYO/vmdtNIwLfqZx4ar/ioMN18DApFTroEBhF3+okS0ZnSgzy17NphMHLEzmbuuuZTY jNWQ== 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=4RlDSAnt1XgDu0J2yTWXCSK86Q+QJ6OGbQ/ZDIeERaU=; b=OTaTL57X1Emow3yZkD4G7ljhd9U+YllZtwQXTbnP+EGiuwbwMkM9gfjFKZw3lfjXQe l4fj90viyIegZZe0WePwU8DlIraAgRMQjcITug3Gvw1k2GNc+MyinKODoci6sAnDudB/ lsfwArV2IgIwwGsRUTRJJ5oNpeIwVNGAvJyJyGvXKLpHAMc0IftOO1jSZpqOUay1andc bL3rKYKQscOMHSwEvn3B9sQ9So/jQpXYn/RtlbynKivPg7N/5uFT+gosGjQpsO+fLfNS qkru7KSGIZllIQ6XwnFUqO/ojS6ZX0fES4YRYqRddqyWgYxVyK22aT40shJcbdY6CDP4 ZC5g== X-Gm-Message-State: AFeK/H32HH1qfY565KA+3fFfFXPRXKXzkHzjd26MfmaSbuG0iFAieqXS9oZbDybNigjnwQ== X-Received: by 10.99.36.5 with SMTP id k5mr386821pgk.201.1489536595591; Tue, 14 Mar 2017 17:09:55 -0700 (PDT) Received: from wacom-XPS-8500.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id 74sm190399pge.14.2017.03.14.17.09.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 14 Mar 2017 17:09:55 -0700 (PDT) From: Ping Cheng X-Google-Original-From: Ping Cheng To: linux-input@vger.kernel.org Cc: jkosina@suse.cz, killertofu@gmail.com, Ping Cheng , Ping Cheng Subject: [PATCH v2] HID: wacom: generic: Wacom mouse is only provided for opaque tablets Date: Tue, 14 Mar 2017 17:08:16 -0700 Message-Id: <1489536496-29253-1-git-send-email-pingc@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 Commit f85c9dc ("Support tool ID and additional tool types") introduced mouse and lens cursor tools to generic codepath, which covers both display (direct) and opaque tablets (indirect devices). However, mouse and lens cursor tools are only provided for opaque tablets. This patch ignores mouse and lens cursor tools if the device is a display tablet. Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke --- v2: updated commit comments as requested by Jiri. --- drivers/hid/wacom_wac.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index d51daf5..b51aa27 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -1952,8 +1952,10 @@ static void wacom_wac_pen_usage_mapping(struct hid_device *hdev, input_set_capability(input, EV_KEY, BTN_TOOL_BRUSH); input_set_capability(input, EV_KEY, BTN_TOOL_PENCIL); input_set_capability(input, EV_KEY, BTN_TOOL_AIRBRUSH); - input_set_capability(input, EV_KEY, BTN_TOOL_MOUSE); - input_set_capability(input, EV_KEY, BTN_TOOL_LENS); + if (!(features->device_type & WACOM_DEVICETYPE_DIRECT)) { + input_set_capability(input, EV_KEY, BTN_TOOL_MOUSE); + input_set_capability(input, EV_KEY, BTN_TOOL_LENS); + } break; case WACOM_HID_WD_FINGERWHEEL: wacom_map_usage(input, usage, field, EV_ABS, ABS_WHEEL, 0);