Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2566475pxb; Mon, 19 Apr 2021 08:34:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6KQmC4wyOKFJDR7LrhdJ7lCK2sXI70bC0/BmQ1XGfqmfHjIbEl6qFnQyLQALBdLWuEoQX X-Received: by 2002:aa7:cb89:: with SMTP id r9mr26666526edt.245.1618846448908; Mon, 19 Apr 2021 08:34:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618846448; cv=none; d=google.com; s=arc-20160816; b=osGBvyIB+HXI2WRgwwQDVKTLL5pMDKitwWqyaV/PHM2VdSZ+xKHMg5rbh8NsTaLgCm wqmObBrHIu4iWx48ZzU+gwyjAB01zJOw7NhLWytHJFB8R3Z0mwv/6A7Cn8ZFVUBCVu83 MXeAOD+Xxp20HeIvYPo6N4AFGgylMOfQSGaHCH+ZoYdkfv9G3daajyB+EoBeV09+nzPO dQS2gPbdh6K4Pqj5EyxD09qFq3t5iDiJT1MH9DAPMwTyMwtmgcYf5CnUQ8og/HQcG1Xx mvscg9lyIx/dKBCTcdQV9BjrpEep7Pf79INOIEjEkVm2Iu3FTjDL+kb2hqKCw2mjGtx7 kjVQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YATf5woIvVDa+WrfHjEpoN5csVbXVm5IY0uhTvxN2t4=; b=fRZQ9JlPOyDQm2OMRhLLzo84fzNTYpY+Gl3UYyj158CFas3kGMbxUWmWbfHItPERqF tqDkXbCzsOQYOpocAPOYQtf0wus9lPc2mrhiH8jS8joThwHiEABkl/2zFUKBEkzbTTWj lT1A4vMDZeRbBmho/ZPS3svY6Ks+GJXpPE7gd7XzL2a2EsXSS7+oFfgr0NHUbD2eAHka jpcGQu0Yg2TyssugP6P6cLHVUnlraY/ZCYTVvKis1l1i0kP7eDE5ylyWbkIL/oD9zJBD yDnknonGY0o1bcz9UADFciBY6ZyrVhRTagdlVpcA20764QFH24h3W6Y803JiSz4Sp4q3 FKng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zDopIpR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f15si13801935edm.87.2021.04.19.08.33.44; Mon, 19 Apr 2021 08:34:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zDopIpR5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242219AbhDSNZa (ORCPT + 99 others); Mon, 19 Apr 2021 09:25:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:56216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240966AbhDSNTi (ORCPT ); Mon, 19 Apr 2021 09:19:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 05CA1613F0; Mon, 19 Apr 2021 13:15:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618838116; bh=5x1SmBefa/kSnntTEvpcxavC7fKBCuwyfcpGWdvwOgU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zDopIpR5NE/pFUpCGu09FKch3DWDWupQT9FKlnyxIfqqQD845uDIPXjmh/0k6GfYn 99/aZ0cg+1U6mf5uEpv2L2wykfkKJQ+huSBKpG07cPJB4xOBAD5MQCeweCYhSnHtNf 8KoTnMBYSRVurqaPabXtfj/1D+HcXltH5XlrLuks= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ping Cheng , Jason Gerecke , Juan Garrido , Jiri Kosina Subject: [PATCH 5.10 049/103] HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices Date: Mon, 19 Apr 2021 15:06:00 +0200 Message-Id: <20210419130529.501905584@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210419130527.791982064@linuxfoundation.org> References: <20210419130527.791982064@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ping Cheng commit 276559d8d02c2709281578976ca2f53bc62063d4 upstream. Valid HID_GENERIC type of devices set EV_KEY and EV_ABS by wacom_map_usage. When *_input_capabilities are reached, those devices should already have their proper EV_* set. EV_KEY and EV_ABS only need to be set for non-HID_GENERIC type of devices in *_input_capabilities. Devices that don't support HID descitoprs will pass back to hid-input for registration without being accidentally rejected by the introduction of patch: "Input: refuse to register absolute devices without absinfo" Fixes: 6ecfe51b4082 ("Input: refuse to register absolute devices without absinfo") Signed-off-by: Ping Cheng Reviewed-by: Jason Gerecke Tested-by: Juan Garrido CC: stable@vger.kernel.org Signed-off-by: Jiri Kosina Signed-off-by: Greg Kroah-Hartman --- drivers/hid/wacom_wac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) --- a/drivers/hid/wacom_wac.c +++ b/drivers/hid/wacom_wac.c @@ -3574,8 +3574,6 @@ int wacom_setup_pen_input_capabilities(s { struct wacom_features *features = &wacom_wac->features; - input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); - if (!(features->device_type & WACOM_DEVICETYPE_PEN)) return -ENODEV; @@ -3590,6 +3588,7 @@ int wacom_setup_pen_input_capabilities(s return 0; } + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); __set_bit(BTN_TOUCH, input_dev->keybit); __set_bit(ABS_MISC, input_dev->absbit); @@ -3742,8 +3741,6 @@ int wacom_setup_touch_input_capabilities { struct wacom_features *features = &wacom_wac->features; - input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); - if (!(features->device_type & WACOM_DEVICETYPE_TOUCH)) return -ENODEV; @@ -3756,6 +3753,7 @@ int wacom_setup_touch_input_capabilities /* setup has already been done */ return 0; + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); __set_bit(BTN_TOUCH, input_dev->keybit); if (features->touch_max == 1) {