aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/tablet')
-rw-r--r--drivers/input/tablet/wacom_sys.c14
-rw-r--r--drivers/input/tablet/wacom_wac.c52
2 files changed, 37 insertions, 29 deletions
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index d27c9d91630..958b4eb6369 100644
--- a/drivers/input/tablet/wacom_sys.c
+++ b/drivers/input/tablet/wacom_sys.c
@@ -229,13 +229,6 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
229 get_unaligned_le16(&report[i + 3]); 229 get_unaligned_le16(&report[i + 3]);
230 i += 4; 230 i += 4;
231 } 231 }
232 } else if (usage == WCM_DIGITIZER) {
233 /* max pressure isn't reported
234 features->pressure_max = (unsigned short)
235 (report[i+4] << 8 | report[i + 3]);
236 */
237 features->pressure_max = 255;
238 i += 4;
239 } 232 }
240 break; 233 break;
241 234
@@ -291,13 +284,6 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi
291 pen = 1; 284 pen = 1;
292 i++; 285 i++;
293 break; 286 break;
294
295 case HID_USAGE_UNDEFINED:
296 if (usage == WCM_DESKTOP && finger) /* capacity */
297 features->pressure_max =
298 get_unaligned_le16(&report[i + 3]);
299 i += 4;
300 break;
301 } 287 }
302 break; 288 break;
303 289
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index c1c2f7b28d8..9dea71849f4 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -800,25 +800,26 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
800 int i; 800 int i;
801 801
802 for (i = 0; i < 2; i++) { 802 for (i = 0; i < 2; i++) {
803 int p = data[9 * i + 2]; 803 int offset = (data[1] & 0x80) ? (8 * i) : (9 * i);
804 bool touch = p && !wacom->shared->stylus_in_proximity; 804 bool touch = data[offset + 3] & 0x80;
805 805
806 input_mt_slot(input, i);
807 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
808 /* 806 /*
809 * Touch events need to be disabled while stylus is 807 * Touch events need to be disabled while stylus is
810 * in proximity because user's hand is resting on touchpad 808 * in proximity because user's hand is resting on touchpad
811 * and sending unwanted events. User expects tablet buttons 809 * and sending unwanted events. User expects tablet buttons
812 * to continue working though. 810 * to continue working though.
813 */ 811 */
812 touch = touch && !wacom->shared->stylus_in_proximity;
813
814 input_mt_slot(input, i);
815 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
814 if (touch) { 816 if (touch) {
815 int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; 817 int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff;
816 int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; 818 int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff;
817 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { 819 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
818 x <<= 5; 820 x <<= 5;
819 y <<= 5; 821 y <<= 5;
820 } 822 }
821 input_report_abs(input, ABS_MT_PRESSURE, p);
822 input_report_abs(input, ABS_MT_POSITION_X, x); 823 input_report_abs(input, ABS_MT_POSITION_X, x);
823 input_report_abs(input, ABS_MT_POSITION_Y, y); 824 input_report_abs(input, ABS_MT_POSITION_Y, y);
824 } 825 }
@@ -1056,10 +1057,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1056 features->x_fuzz, 0); 1057 features->x_fuzz, 0);
1057 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 1058 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,
1058 features->y_fuzz, 0); 1059 features->y_fuzz, 0);
1059 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
1060 features->pressure_fuzz, 0);
1061 1060
1062 if (features->device_type == BTN_TOOL_PEN) { 1061 if (features->device_type == BTN_TOOL_PEN) {
1062 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
1063 features->pressure_fuzz, 0);
1064
1063 /* penabled devices have fixed resolution for each model */ 1065 /* penabled devices have fixed resolution for each model */
1064 input_abs_set_res(input_dev, ABS_X, features->x_resolution); 1066 input_abs_set_res(input_dev, ABS_X, features->x_resolution);
1065 input_abs_set_res(input_dev, ABS_Y, features->y_resolution); 1067 input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
@@ -1098,6 +1100,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1098 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); 1100 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
1099 __set_bit(BTN_STYLUS, input_dev->keybit); 1101 __set_bit(BTN_STYLUS, input_dev->keybit);
1100 __set_bit(BTN_STYLUS2, input_dev->keybit); 1102 __set_bit(BTN_STYLUS2, input_dev->keybit);
1103
1104 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1101 break; 1105 break;
1102 1106
1103 case WACOM_21UX2: 1107 case WACOM_21UX2:
@@ -1120,12 +1124,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1120 for (i = 0; i < 8; i++) 1124 for (i = 0; i < 8; i++)
1121 __set_bit(BTN_0 + i, input_dev->keybit); 1125 __set_bit(BTN_0 + i, input_dev->keybit);
1122 1126
1123 if (wacom_wac->features.type != WACOM_21UX2) { 1127 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1124 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 1128 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1125 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1126 }
1127
1128 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1129 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1130
1131 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1132
1129 wacom_setup_cintiq(wacom_wac); 1133 wacom_setup_cintiq(wacom_wac);
1130 break; 1134 break;
1131 1135
@@ -1150,6 +1154,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1150 /* fall through */ 1154 /* fall through */
1151 1155
1152 case INTUOS: 1156 case INTUOS:
1157 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1158
1153 wacom_setup_intuos(wacom_wac); 1159 wacom_setup_intuos(wacom_wac);
1154 break; 1160 break;
1155 1161
@@ -1165,6 +1171,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1165 1171
1166 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1172 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1167 wacom_setup_intuos(wacom_wac); 1173 wacom_setup_intuos(wacom_wac);
1174
1175 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1168 break; 1176 break;
1169 1177
1170 case TABLETPC2FG: 1178 case TABLETPC2FG:
@@ -1183,26 +1191,40 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1183 case TABLETPC: 1191 case TABLETPC:
1184 __clear_bit(ABS_MISC, input_dev->absbit); 1192 __clear_bit(ABS_MISC, input_dev->absbit);
1185 1193
1194 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1195
1186 if (features->device_type != BTN_TOOL_PEN) 1196 if (features->device_type != BTN_TOOL_PEN)
1187 break; /* no need to process stylus stuff */ 1197 break; /* no need to process stylus stuff */
1188 1198
1189 /* fall through */ 1199 /* fall through */
1190 1200
1191 case PL: 1201 case PL:
1192 case PTU:
1193 case DTU: 1202 case DTU:
1194 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1203 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1204 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1195 __set_bit(BTN_STYLUS, input_dev->keybit); 1205 __set_bit(BTN_STYLUS, input_dev->keybit);
1196 __set_bit(BTN_STYLUS2, input_dev->keybit); 1206 __set_bit(BTN_STYLUS2, input_dev->keybit);
1207
1208 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1209 break;
1210
1211 case PTU:
1212 __set_bit(BTN_STYLUS2, input_dev->keybit);
1197 /* fall through */ 1213 /* fall through */
1198 1214
1199 case PENPARTNER: 1215 case PENPARTNER:
1216 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1200 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1217 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1218 __set_bit(BTN_STYLUS, input_dev->keybit);
1219
1220 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1201 break; 1221 break;
1202 1222
1203 case BAMBOO_PT: 1223 case BAMBOO_PT:
1204 __clear_bit(ABS_MISC, input_dev->absbit); 1224 __clear_bit(ABS_MISC, input_dev->absbit);
1205 1225
1226 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1227
1206 if (features->device_type == BTN_TOOL_DOUBLETAP) { 1228 if (features->device_type == BTN_TOOL_DOUBLETAP) {
1207 __set_bit(BTN_LEFT, input_dev->keybit); 1229 __set_bit(BTN_LEFT, input_dev->keybit);
1208 __set_bit(BTN_FORWARD, input_dev->keybit); 1230 __set_bit(BTN_FORWARD, input_dev->keybit);