Skip to content

Commit 276559d

Browse files
PinglinuxJiri Kosina
authored andcommitted
HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices
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: 6ecfe51 ("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 Signed-off-by: Jiri Kosina <jkosina@suse.cz>
1 parent 25615e4 commit 276559d

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/hid/wacom_wac.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3574,8 +3574,6 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
35743574
{
35753575
struct wacom_features *features = &wacom_wac->features;
35763576

3577-
input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
3578-
35793577
if (!(features->device_type & WACOM_DEVICETYPE_PEN))
35803578
return -ENODEV;
35813579

@@ -3590,6 +3588,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev,
35903588
return 0;
35913589
}
35923590

3591+
input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
35933592
__set_bit(BTN_TOUCH, input_dev->keybit);
35943593
__set_bit(ABS_MISC, input_dev->absbit);
35953594

@@ -3742,8 +3741,6 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
37423741
{
37433742
struct wacom_features *features = &wacom_wac->features;
37443743

3745-
input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
3746-
37473744
if (!(features->device_type & WACOM_DEVICETYPE_TOUCH))
37483745
return -ENODEV;
37493746

@@ -3756,6 +3753,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev,
37563753
/* setup has already been done */
37573754
return 0;
37583755

3756+
input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
37593757
__set_bit(BTN_TOUCH, input_dev->keybit);
37603758

37613759
if (features->touch_max == 1) {

0 commit comments

Comments
 (0)