diff options
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r-- | drivers/input/tablet/wacom_wac.c | 49 |
1 files changed, 39 insertions, 10 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c index 03ebcc8b24b5..0dc97ec15c28 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: |
@@ -1126,6 +1130,9 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1126 | } | 1130 | } |
1127 | 1131 | ||
1128 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 1132 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
1133 | |||
1134 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
1135 | |||
1129 | wacom_setup_cintiq(wacom_wac); | 1136 | wacom_setup_cintiq(wacom_wac); |
1130 | break; | 1137 | break; |
1131 | 1138 | ||
@@ -1150,6 +1157,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1150 | /* fall through */ | 1157 | /* fall through */ |
1151 | 1158 | ||
1152 | case INTUOS: | 1159 | case INTUOS: |
1160 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
1161 | |||
1153 | wacom_setup_intuos(wacom_wac); | 1162 | wacom_setup_intuos(wacom_wac); |
1154 | break; | 1163 | break; |
1155 | 1164 | ||
@@ -1165,6 +1174,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1165 | 1174 | ||
1166 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); | 1175 | input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); |
1167 | wacom_setup_intuos(wacom_wac); | 1176 | wacom_setup_intuos(wacom_wac); |
1177 | |||
1178 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
1168 | break; | 1179 | break; |
1169 | 1180 | ||
1170 | case TABLETPC2FG: | 1181 | case TABLETPC2FG: |
@@ -1183,26 +1194,40 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev, | |||
1183 | case TABLETPC: | 1194 | case TABLETPC: |
1184 | __clear_bit(ABS_MISC, input_dev->absbit); | 1195 | __clear_bit(ABS_MISC, input_dev->absbit); |
1185 | 1196 | ||
1197 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
1198 | |||
1186 | if (features->device_type != BTN_TOOL_PEN) | 1199 | if (features->device_type != BTN_TOOL_PEN) |
1187 | break; /* no need to process stylus stuff */ | 1200 | break; /* no need to process stylus stuff */ |
1188 | 1201 | ||
1189 | /* fall through */ | 1202 | /* fall through */ |
1190 | 1203 | ||
1191 | case PL: | 1204 | case PL: |
1192 | case PTU: | ||
1193 | case DTU: | 1205 | case DTU: |
1194 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); | 1206 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); |
1207 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); | ||
1195 | __set_bit(BTN_STYLUS, input_dev->keybit); | 1208 | __set_bit(BTN_STYLUS, input_dev->keybit); |
1196 | __set_bit(BTN_STYLUS2, input_dev->keybit); | 1209 | __set_bit(BTN_STYLUS2, input_dev->keybit); |
1210 | |||
1211 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
1212 | break; | ||
1213 | |||
1214 | case PTU: | ||
1215 | __set_bit(BTN_STYLUS2, input_dev->keybit); | ||
1197 | /* fall through */ | 1216 | /* fall through */ |
1198 | 1217 | ||
1199 | case PENPARTNER: | 1218 | case PENPARTNER: |
1219 | __set_bit(BTN_TOOL_PEN, input_dev->keybit); | ||
1200 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); | 1220 | __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); |
1221 | __set_bit(BTN_STYLUS, input_dev->keybit); | ||
1222 | |||
1223 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
1201 | break; | 1224 | break; |
1202 | 1225 | ||
1203 | case BAMBOO_PT: | 1226 | case BAMBOO_PT: |
1204 | __clear_bit(ABS_MISC, input_dev->absbit); | 1227 | __clear_bit(ABS_MISC, input_dev->absbit); |
1205 | 1228 | ||
1229 | __set_bit(INPUT_PROP_POINTER, input_dev->propbit); | ||
1230 | |||
1206 | if (features->device_type == BTN_TOOL_DOUBLETAP) { | 1231 | if (features->device_type == BTN_TOOL_DOUBLETAP) { |
1207 | __set_bit(BTN_LEFT, input_dev->keybit); | 1232 | __set_bit(BTN_LEFT, input_dev->keybit); |
1208 | __set_bit(BTN_FORWARD, input_dev->keybit); | 1233 | __set_bit(BTN_FORWARD, input_dev->keybit); |
@@ -1460,6 +1485,9 @@ static const struct wacom_features wacom_features_0xD3 = | |||
1460 | static const struct wacom_features wacom_features_0xD4 = | 1485 | static const struct wacom_features wacom_features_0xD4 = |
1461 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1486 | { "Wacom Bamboo Pen", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1462 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1487 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
1488 | static const struct wacom_features wacom_features_0xD5 = | ||
1489 | { "Wacom Bamboo Pen 6x8", WACOM_PKGLEN_BBFUN, 21648, 13530, 1023, | ||
1490 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | ||
1463 | static const struct wacom_features wacom_features_0xD6 = | 1491 | static const struct wacom_features wacom_features_0xD6 = |
1464 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, | 1492 | { "Wacom BambooPT 2FG 4x5", WACOM_PKGLEN_BBFUN, 14720, 9200, 1023, |
1465 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; | 1493 | 63, BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; |
@@ -1564,6 +1592,7 @@ const struct usb_device_id wacom_ids[] = { | |||
1564 | { USB_DEVICE_WACOM(0xD2) }, | 1592 | { USB_DEVICE_WACOM(0xD2) }, |
1565 | { USB_DEVICE_WACOM(0xD3) }, | 1593 | { USB_DEVICE_WACOM(0xD3) }, |
1566 | { USB_DEVICE_WACOM(0xD4) }, | 1594 | { USB_DEVICE_WACOM(0xD4) }, |
1595 | { USB_DEVICE_WACOM(0xD5) }, | ||
1567 | { USB_DEVICE_WACOM(0xD6) }, | 1596 | { USB_DEVICE_WACOM(0xD6) }, |
1568 | { USB_DEVICE_WACOM(0xD7) }, | 1597 | { USB_DEVICE_WACOM(0xD7) }, |
1569 | { USB_DEVICE_WACOM(0xD8) }, | 1598 | { USB_DEVICE_WACOM(0xD8) }, |