aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/tablet/wacom_wac.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2011-11-29 04:51:07 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2011-11-29 04:51:07 -0500
commit0d2cd91bf7b1a7cc1d638296111fcc2bcf5c0bb4 (patch)
treed2ca69347816c27f9dc352581f5d0fe76811cd49 /drivers/input/tablet/wacom_wac.c
parent3d95fd6ad8d3cf582a70ed65660017114b6e4065 (diff)
parentcaca6a03d365883564885f2c1da3e88dcf65d139 (diff)
Merge commit 'v3.2-rc3' into next
Diffstat (limited to 'drivers/input/tablet/wacom_wac.c')
-rw-r--r--drivers/input/tablet/wacom_wac.c52
1 files changed, 37 insertions, 15 deletions
diff --git a/drivers/input/tablet/wacom_wac.c b/drivers/input/tablet/wacom_wac.c
index 6b9adc7bec6e..ecfcbc8144dc 100644
--- a/drivers/input/tablet/wacom_wac.c
+++ b/drivers/input/tablet/wacom_wac.c
@@ -803,25 +803,26 @@ static int wacom_bpt_touch(struct wacom_wac *wacom)
803 return 0; 803 return 0;
804 804
805 for (i = 0; i < 2; i++) { 805 for (i = 0; i < 2; i++) {
806 int p = data[9 * i + 2]; 806 int offset = (data[1] & 0x80) ? (8 * i) : (9 * i);
807 bool touch = p && !wacom->shared->stylus_in_proximity; 807 bool touch = data[offset + 3] & 0x80;
808 808
809 input_mt_slot(input, i);
810 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
811 /* 809 /*
812 * Touch events need to be disabled while stylus is 810 * Touch events need to be disabled while stylus is
813 * in proximity because user's hand is resting on touchpad 811 * in proximity because user's hand is resting on touchpad
814 * and sending unwanted events. User expects tablet buttons 812 * and sending unwanted events. User expects tablet buttons
815 * to continue working though. 813 * to continue working though.
816 */ 814 */
815 touch = touch && !wacom->shared->stylus_in_proximity;
816
817 input_mt_slot(input, i);
818 input_mt_report_slot_state(input, MT_TOOL_FINGER, touch);
817 if (touch) { 819 if (touch) {
818 int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; 820 int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff;
819 int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; 821 int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff;
820 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { 822 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) {
821 x <<= 5; 823 x <<= 5;
822 y <<= 5; 824 y <<= 5;
823 } 825 }
824 input_report_abs(input, ABS_MT_PRESSURE, p);
825 input_report_abs(input, ABS_MT_POSITION_X, x); 826 input_report_abs(input, ABS_MT_POSITION_X, x);
826 input_report_abs(input, ABS_MT_POSITION_Y, y); 827 input_report_abs(input, ABS_MT_POSITION_Y, y);
827 } 828 }
@@ -1126,10 +1127,11 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1126 features->x_fuzz, 0); 1127 features->x_fuzz, 0);
1127 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 1128 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max,
1128 features->y_fuzz, 0); 1129 features->y_fuzz, 0);
1129 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
1130 features->pressure_fuzz, 0);
1131 1130
1132 if (features->device_type == BTN_TOOL_PEN) { 1131 if (features->device_type == BTN_TOOL_PEN) {
1132 input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max,
1133 features->pressure_fuzz, 0);
1134
1133 /* penabled devices have fixed resolution for each model */ 1135 /* penabled devices have fixed resolution for each model */
1134 input_abs_set_res(input_dev, ABS_X, features->x_resolution); 1136 input_abs_set_res(input_dev, ABS_X, features->x_resolution);
1135 input_abs_set_res(input_dev, ABS_Y, features->y_resolution); 1137 input_abs_set_res(input_dev, ABS_Y, features->y_resolution);
@@ -1168,6 +1170,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1168 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); 1170 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit);
1169 __set_bit(BTN_STYLUS, input_dev->keybit); 1171 __set_bit(BTN_STYLUS, input_dev->keybit);
1170 __set_bit(BTN_STYLUS2, input_dev->keybit); 1172 __set_bit(BTN_STYLUS2, input_dev->keybit);
1173
1174 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1171 break; 1175 break;
1172 1176
1173 case WACOM_21UX2: 1177 case WACOM_21UX2:
@@ -1190,12 +1194,12 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1190 for (i = 0; i < 8; i++) 1194 for (i = 0; i < 8; i++)
1191 __set_bit(BTN_0 + i, input_dev->keybit); 1195 __set_bit(BTN_0 + i, input_dev->keybit);
1192 1196
1193 if (wacom_wac->features.type != WACOM_21UX2) { 1197 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0);
1194 input_set_abs_params(input_dev, ABS_RX, 0, 4096, 0, 0); 1198 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1195 input_set_abs_params(input_dev, ABS_RY, 0, 4096, 0, 0);
1196 }
1197
1198 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1199 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1200
1201 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1202
1199 wacom_setup_cintiq(wacom_wac); 1203 wacom_setup_cintiq(wacom_wac);
1200 break; 1204 break;
1201 1205
@@ -1220,6 +1224,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1220 /* fall through */ 1224 /* fall through */
1221 1225
1222 case INTUOS: 1226 case INTUOS:
1227 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1228
1223 wacom_setup_intuos(wacom_wac); 1229 wacom_setup_intuos(wacom_wac);
1224 break; 1230 break;
1225 1231
@@ -1235,6 +1241,8 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1235 1241
1236 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1242 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0);
1237 wacom_setup_intuos(wacom_wac); 1243 wacom_setup_intuos(wacom_wac);
1244
1245 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1238 break; 1246 break;
1239 1247
1240 case TABLETPC2FG: 1248 case TABLETPC2FG:
@@ -1253,26 +1261,40 @@ void wacom_setup_input_capabilities(struct input_dev *input_dev,
1253 case TABLETPC: 1261 case TABLETPC:
1254 __clear_bit(ABS_MISC, input_dev->absbit); 1262 __clear_bit(ABS_MISC, input_dev->absbit);
1255 1263
1264 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1265
1256 if (features->device_type != BTN_TOOL_PEN) 1266 if (features->device_type != BTN_TOOL_PEN)
1257 break; /* no need to process stylus stuff */ 1267 break; /* no need to process stylus stuff */
1258 1268
1259 /* fall through */ 1269 /* fall through */
1260 1270
1261 case PL: 1271 case PL:
1262 case PTU:
1263 case DTU: 1272 case DTU:
1264 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1273 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1274 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1265 __set_bit(BTN_STYLUS, input_dev->keybit); 1275 __set_bit(BTN_STYLUS, input_dev->keybit);
1266 __set_bit(BTN_STYLUS2, input_dev->keybit); 1276 __set_bit(BTN_STYLUS2, input_dev->keybit);
1277
1278 __set_bit(INPUT_PROP_DIRECT, input_dev->propbit);
1279 break;
1280
1281 case PTU:
1282 __set_bit(BTN_STYLUS2, input_dev->keybit);
1267 /* fall through */ 1283 /* fall through */
1268 1284
1269 case PENPARTNER: 1285 case PENPARTNER:
1286 __set_bit(BTN_TOOL_PEN, input_dev->keybit);
1270 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1287 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit);
1288 __set_bit(BTN_STYLUS, input_dev->keybit);
1289
1290 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1271 break; 1291 break;
1272 1292
1273 case BAMBOO_PT: 1293 case BAMBOO_PT:
1274 __clear_bit(ABS_MISC, input_dev->absbit); 1294 __clear_bit(ABS_MISC, input_dev->absbit);
1275 1295
1296 __set_bit(INPUT_PROP_POINTER, input_dev->propbit);
1297
1276 if (features->device_type == BTN_TOOL_DOUBLETAP) { 1298 if (features->device_type == BTN_TOOL_DOUBLETAP) {
1277 __set_bit(BTN_LEFT, input_dev->keybit); 1299 __set_bit(BTN_LEFT, input_dev->keybit);
1278 __set_bit(BTN_FORWARD, input_dev->keybit); 1300 __set_bit(BTN_FORWARD, input_dev->keybit);