stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices
@ 2021-03-11 19:30 Ping Cheng
  2021-03-16 14:41 ` Jiri Kosina
  0 siblings, 1 reply; 2+ messages in thread
From: Ping Cheng @ 2021-03-11 19:30 UTC (permalink / raw)
  To: linux-input; +Cc: jkosina, Juan.Garrido, Jason.Gerecke, Ping Cheng, stable

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 <ping.cheng@wacom.com>
Reviewed-by: Jason Gerecke <Jason.Gerecke@wacom.com>
Tested-by: Juan Garrido <Juan.Garrido@wacom.com>
CC: stable@vger.kernel.org
---
 drivers/hid/wacom_wac.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 5e6e4db..8906b79 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -3578,8 +3578,6 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
 {
 	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;
 
@@ -3594,6 +3592,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
 		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);
 
@@ -3746,8 +3745,6 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
 {
 	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;
 
@@ -3760,6 +3757,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
 		/* 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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices
  2021-03-11 19:30 [PATCH] HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices Ping Cheng
@ 2021-03-16 14:41 ` Jiri Kosina
  0 siblings, 0 replies; 2+ messages in thread
From: Jiri Kosina @ 2021-03-16 14:41 UTC (permalink / raw)
  To: Ping Cheng; +Cc: linux-input, Juan.Garrido, Jason.Gerecke, Ping Cheng, stable

On Thu, 11 Mar 2021, Ping Cheng wrote:

> 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 <ping.cheng@wacom.com>
> Reviewed-by: Jason Gerecke <Jason.Gerecke@wacom.com>
> Tested-by: Juan Garrido <Juan.Garrido@wacom.com>
> CC: stable@vger.kernel.org

Applied, thanks Ping.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-16 14:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 19:30 [PATCH] HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices Ping Cheng
2021-03-16 14:41 ` Jiri Kosina

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).