From patchwork Mon Jan 30 23:40:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ping Cheng X-Patchwork-Id: 9546195 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 C542660415 for ; Mon, 30 Jan 2017 23:48:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BA226283ED for ; Mon, 30 Jan 2017 23:48:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ABE9528406; Mon, 30 Jan 2017 23:48:52 +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 2E9B6283ED for ; Mon, 30 Jan 2017 23:48:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753363AbdA3Xsv (ORCPT ); Mon, 30 Jan 2017 18:48:51 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35999 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753192AbdA3Xsu (ORCPT ); Mon, 30 Jan 2017 18:48:50 -0500 Received: by mail-pf0-f193.google.com with SMTP id 19so24651597pfo.3 for ; Mon, 30 Jan 2017 15:48:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=03739GQXzDLYjdtnImvJ+Hp0IR0MykM+sJN74AyTTcY=; b=SqOJgZr8DU4XqvCHPMargTxDITpd5CF1Chx2ECV4AKHVGjLQZHCLJPWNdJOvL9VfTX Dh/Zpw3Gy1XYQ2FG81HBgzWsj08+4BVmJlvSpybHXaPN4ZnplHNrafUFrhiNnIOa5Tjl SU+CAOp/tabqAjv0ZATxN0bmPjL94S/mQ6FmCRKqG8XKNto7DwEeUpgBi0FMQPReYUnR X/p/JM5JxzFrTayB8x44iR0mTweWoCKayZ7Ww3pkI8r/kcBkAAhxo53Fdpgy1mDgRUFl rhdskJCkRaD48hoKismIAw7wTuIkRDfqtk07YDP+u8+Nhw1GIalRIQ9AMVqSlNb2QDKs zq0g== 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=03739GQXzDLYjdtnImvJ+Hp0IR0MykM+sJN74AyTTcY=; b=QgB00++Fv3YSj5Wbp24mebS+sADdy+8TkOTN4o8ISf3tu64mYWET/NXoLZ/6yIH77i pxyEL6bBKc0LBJ4d+EVUv6FoOD4x0MtIw9aCU5LgG16QsCB5qXyljzm2ziUrvOMAcMW0 0i8O4Yg1vnA4bTrLXINQ9fcOsJgrLVT/YA3rJAlFQTtSVUP1Ph2QdXAIY1Vv6O+OAMh4 /ymCNzAwYIE1pW1Zsd4GFeWzd57t0nhcy9pMyvHag53diS0AlCZ7erHubDiJoI1cjo5A dLAutbEInKaVTUV8o3f9DIEA+lWzPO7ROv2I8LPscb2I/gWp+ymTCrWlhnQ5H9n+EG57 ZLPw== X-Gm-Message-State: AIkVDXKUvTQlxNtC7JU1Dr/gO5q9C3A6xW9trYVR530ILIFCmOq9P0VAFrXwAFzD/fnhUQ== X-Received: by 10.98.147.207 with SMTP id r76mr26105424pfk.111.1485819714032; Mon, 30 Jan 2017 15:41:54 -0800 (PST) Received: from wacom-XPS-8500.corp.onewacom.com ([50.225.60.4]) by smtp.gmail.com with ESMTPSA id o24sm35239328pfj.78.2017.01.30.15.41.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Jan 2017 15:41:53 -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 , Ping Cheng Subject: [PATCH] HID: wacom: don't apply generic settings to old devices Date: Mon, 30 Jan 2017 15:40:49 -0800 Message-Id: <1485819649-8057-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 Non-generic devices have numbered_buttons set for both pen and touch interfaces by default. The actual number of buttons on the interface is normally manually decided later, which is different from what those HID generic devices are processed, where number of buttons are directly retrieved from HID descriptors. This patch adds the missed HID_GENERIC check and moves the statement to wacom_setup_pad_input_capabilities since it's not a quirk anymore. Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke --- drivers/hid/wacom_wac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c index 0884dc9..6477fcd 100644 --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -2777,8 +2777,6 @@ void wacom_setup_device_quirks(struct wacom *wacom) struct wacom_features *features = &wacom->wacom_wac.features; /* The pen and pad share the same interface on most devices */ - if (features->numbered_buttons > 0) - features->device_type |= WACOM_DEVICETYPE_PAD; if (features->type == GRAPHIRE_BT || features->type == WACOM_G4 || features->type == DTUS || (features->type >= INTUOS3S && features->type <= WACOM_MO)) { @@ -3288,6 +3286,9 @@ int wacom_setup_pad_input_capabilities(struct input_dev *input_dev, { struct wacom_features *features = &wacom_wac->features; + if ((features->type == HID_GENERIC) && features->numbered_buttons > 0) + features->device_type |= WACOM_DEVICETYPE_PAD; + if (!(features->device_type & WACOM_DEVICETYPE_PAD)) return -ENODEV;