Skip to content

Commit a2f71c6

Browse files
PinglinuxJiri Kosina
authored andcommitted
HID: wacom: consolidate input capability settings for pen and touch
After PAD moved to its own interface, there were duplicated statements in wacom_setup_pentouch_input_capabilities. Merge them together to reduce future maintenance effort. Signed-off-by: Ping Cheng <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 9b61aa8 commit a2f71c6

File tree

1 file changed

+10
-57
lines changed

1 file changed

+10
-57
lines changed

drivers/hid/wacom_wac.c

Lines changed: 10 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -2089,32 +2089,17 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
20892089
wacom_abs_set_axis(input_dev, wacom_wac);
20902090

20912091
switch (features->type) {
2092-
case WACOM_MO:
2093-
case WACOM_G4:
2094-
/* fall through */
2095-
2096-
case GRAPHIRE:
2097-
input_set_capability(input_dev, EV_REL, REL_WHEEL);
2098-
2099-
__set_bit(BTN_LEFT, input_dev->keybit);
2100-
__set_bit(BTN_RIGHT, input_dev->keybit);
2101-
__set_bit(BTN_MIDDLE, input_dev->keybit);
2102-
2103-
__set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
2104-
__set_bit(BTN_TOOL_PEN, input_dev->keybit);
2105-
__set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
2106-
__set_bit(BTN_STYLUS, input_dev->keybit);
2107-
__set_bit(BTN_STYLUS2, input_dev->keybit);
2108-
2109-
__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
2110-
break;
2111-
21122092
case GRAPHIRE_BT:
21132093
__clear_bit(ABS_MISC, input_dev->absbit);
2094+
2095+
case WACOM_MO:
2096+
case WACOM_G4:
21142097
input_set_abs_params(input_dev, ABS_DISTANCE, 0,
21152098
features->distance_max,
21162099
0, 0);
2100+
/* fall through */
21172101

2102+
case GRAPHIRE:
21182103
input_set_capability(input_dev, EV_REL, REL_WHEEL);
21192104

21202105
__set_bit(BTN_LEFT, input_dev->keybit);
@@ -2131,30 +2116,13 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
21312116
break;
21322117

21332118
case WACOM_24HD:
2134-
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2135-
input_abs_set_res(input_dev, ABS_Z, 287);
2136-
input_set_abs_params(input_dev, ABS_THROTTLE, 0, 71, 0, 0);
2137-
/* fall through */
2138-
21392119
case DTK:
2140-
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
2141-
2142-
wacom_setup_cintiq(wacom_wac);
2143-
break;
2144-
21452120
case WACOM_22HD:
21462121
case WACOM_21UX2:
21472122
case WACOM_BEE:
21482123
case CINTIQ:
2149-
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2150-
input_abs_set_res(input_dev, ABS_Z, 287);
2151-
2152-
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
2153-
2154-
wacom_setup_cintiq(wacom_wac);
2155-
break;
2156-
21572124
case WACOM_13HD:
2125+
case CINTIQ_HYBRID:
21582126
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
21592127
input_abs_set_res(input_dev, ABS_Z, 287);
21602128
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
@@ -2164,6 +2132,10 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
21642132
case INTUOS3:
21652133
case INTUOS3L:
21662134
case INTUOS3S:
2135+
case INTUOS4:
2136+
case INTUOS4WL:
2137+
case INTUOS4L:
2138+
case INTUOS4S:
21672139
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
21682140
input_abs_set_res(input_dev, ABS_Z, 287);
21692141
/* fall through */
@@ -2202,17 +2174,6 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
22022174
}
22032175
break;
22042176

2205-
case INTUOS4:
2206-
case INTUOS4WL:
2207-
case INTUOS4L:
2208-
case INTUOS4S:
2209-
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2210-
input_abs_set_res(input_dev, ABS_Z, 287);
2211-
wacom_setup_intuos(wacom_wac);
2212-
2213-
__set_bit(INPUT_PROP_POINTER, input_dev->propbit);
2214-
break;
2215-
22162177
case WACOM_24HDT:
22172178
if (features->device_type == BTN_TOOL_FINGER) {
22182179
input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, features->x_max, 0, 0);
@@ -2308,14 +2269,6 @@ int wacom_setup_pentouch_input_capabilities(struct input_dev *input_dev,
23082269
0, 0);
23092270
}
23102271
break;
2311-
2312-
case CINTIQ_HYBRID:
2313-
input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
2314-
input_abs_set_res(input_dev, ABS_Z, 287);
2315-
__set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
2316-
2317-
wacom_setup_cintiq(wacom_wac);
2318-
break;
23192272
}
23202273
return 0;
23212274
}

0 commit comments

Comments
 (0)