Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://github.com/dtor/input

* 'for-linus' of git://github.com/dtor/input:
Input: wacom - fix touch parsing on newer Bamboos
Input: bcm5974 - add MacBookAir4,1 trackpad support
Input: wacom - add POINTER and DIRECT device properties
Input: adp5588-keys - remove incorrect modalias
Input: cm109 - fix checking return value of usb_control_msg
Input: wacom - advertise BTN_TOOL_PEN and BTN_STYLUS for PenPartner
Input: wacom - remove pressure for touch devices

+60 -26
+2
drivers/hid/hid-wacom.c
··· 373 373 hidinput = list_entry(hdev->inputs.next, struct hid_input, list); 374 374 input = hidinput->input; 375 375 376 + __set_bit(INPUT_PROP_POINTER, input->propbit); 377 + 376 378 /* Basics */ 377 379 input->evbit[0] |= BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_REL); 378 380
-1
drivers/input/keyboard/adp5588-keys.c
··· 668 668 MODULE_LICENSE("GPL"); 669 669 MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 670 670 MODULE_DESCRIPTION("ADP5588/87 Keypad driver"); 671 - MODULE_ALIAS("platform:adp5588-keys");
+1 -1
drivers/input/misc/cm109.c
··· 475 475 le16_to_cpu(dev->ctl_req->wIndex), 476 476 dev->ctl_data, 477 477 USB_PKT_LEN, USB_CTRL_SET_TIMEOUT); 478 - if (error && error != EINTR) 478 + if (error < 0 && error != -EINTR) 479 479 err("%s: usb_control_msg() failed %d", __func__, error); 480 480 } 481 481
+20
drivers/input/mouse/bcm5974.c
··· 67 67 #define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245 68 68 #define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246 69 69 #define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 70 + /* MacbookAir4,1 (unibody, July 2011) */ 71 + #define USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI 0x0249 72 + #define USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO 0x024a 73 + #define USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS 0x024b 70 74 /* MacbookAir4,2 (unibody, July 2011) */ 71 75 #define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c 72 76 #define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d ··· 116 112 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI), 117 113 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO), 118 114 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS), 115 + /* MacbookAir4,1 */ 116 + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI), 117 + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO), 118 + BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS), 119 119 /* MacbookAir4,2 */ 120 120 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI), 121 121 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ISO), ··· 341 333 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 342 334 { DIM_X, DIM_X / SN_COORD, -4750, 5280 }, 343 335 { DIM_Y, DIM_Y / SN_COORD, -150, 6730 } 336 + }, 337 + { 338 + USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI, 339 + USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO, 340 + USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS, 341 + HAS_INTEGRATED_BUTTON, 342 + 0x84, sizeof(struct bt_data), 343 + 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS, 344 + { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 }, 345 + { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 }, 346 + { DIM_X, DIM_X / SN_COORD, -4620, 5140 }, 347 + { DIM_Y, DIM_Y / SN_COORD, -150, 6600 } 344 348 }, 345 349 {} 346 350 };
-14
drivers/input/tablet/wacom_sys.c
··· 229 229 get_unaligned_le16(&report[i + 3]); 230 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 233 break; 241 234 ··· 283 290 case HID_USAGE_STYLUS: 284 291 pen = 1; 285 292 i++; 286 - break; 287 - 288 - case HID_USAGE_UNDEFINED: 289 - if (usage == WCM_DESKTOP && finger) /* capacity */ 290 - features->pressure_max = 291 - get_unaligned_le16(&report[i + 3]); 292 - i += 4; 293 293 break; 294 294 } 295 295 break;
+35 -10
drivers/input/tablet/wacom_wac.c
··· 800 800 int i; 801 801 802 802 for (i = 0; i < 2; i++) { 803 - int p = data[9 * i + 2]; 804 - bool touch = p && !wacom->shared->stylus_in_proximity; 803 + int offset = (data[1] & 0x80) ? (8 * i) : (9 * i); 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 807 * Touch events need to be disabled while stylus is 810 808 * in proximity because user's hand is resting on touchpad 811 809 * and sending unwanted events. User expects tablet buttons 812 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 816 if (touch) { 815 - int x = get_unaligned_be16(&data[9 * i + 3]) & 0x7ff; 816 - int y = get_unaligned_be16(&data[9 * i + 5]) & 0x7ff; 817 + int x = get_unaligned_be16(&data[offset + 3]) & 0x7ff; 818 + int y = get_unaligned_be16(&data[offset + 5]) & 0x7ff; 817 819 if (features->quirks & WACOM_QUIRK_BBTOUCH_LOWRES) { 818 820 x <<= 5; 819 821 y <<= 5; 820 822 } 821 - input_report_abs(input, ABS_MT_PRESSURE, p); 822 823 input_report_abs(input, ABS_MT_POSITION_X, x); 823 824 input_report_abs(input, ABS_MT_POSITION_Y, y); 824 825 } ··· 1057 1056 features->x_fuzz, 0); 1058 1057 input_set_abs_params(input_dev, ABS_Y, 0, features->y_max, 1059 1058 features->y_fuzz, 0); 1060 - input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 1061 - features->pressure_fuzz, 0); 1062 1059 1063 1060 if (features->device_type == BTN_TOOL_PEN) { 1061 + input_set_abs_params(input_dev, ABS_PRESSURE, 0, features->pressure_max, 1062 + features->pressure_fuzz, 0); 1063 + 1064 1064 /* penabled devices have fixed resolution for each model */ 1065 1065 input_abs_set_res(input_dev, ABS_X, features->x_resolution); 1066 1066 input_abs_set_res(input_dev, ABS_Y, features->y_resolution); ··· 1100 1098 __set_bit(BTN_TOOL_MOUSE, input_dev->keybit); 1101 1099 __set_bit(BTN_STYLUS, input_dev->keybit); 1102 1100 __set_bit(BTN_STYLUS2, input_dev->keybit); 1101 + 1102 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1103 1103 break; 1104 1104 1105 1105 case WACOM_21UX2: ··· 1130 1126 } 1131 1127 1132 1128 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1129 + 1130 + __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1131 + 1133 1132 wacom_setup_cintiq(wacom_wac); 1134 1133 break; 1135 1134 ··· 1157 1150 /* fall through */ 1158 1151 1159 1152 case INTUOS: 1153 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1154 + 1160 1155 wacom_setup_intuos(wacom_wac); 1161 1156 break; 1162 1157 ··· 1174 1165 1175 1166 input_set_abs_params(input_dev, ABS_Z, -900, 899, 0, 0); 1176 1167 wacom_setup_intuos(wacom_wac); 1168 + 1169 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1177 1170 break; 1178 1171 1179 1172 case TABLETPC2FG: ··· 1194 1183 case TABLETPC: 1195 1184 __clear_bit(ABS_MISC, input_dev->absbit); 1196 1185 1186 + __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1187 + 1197 1188 if (features->device_type != BTN_TOOL_PEN) 1198 1189 break; /* no need to process stylus stuff */ 1199 1190 1200 1191 /* fall through */ 1201 1192 1202 1193 case PL: 1203 - case PTU: 1204 1194 case DTU: 1205 1195 __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1196 + __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1206 1197 __set_bit(BTN_STYLUS, input_dev->keybit); 1198 + __set_bit(BTN_STYLUS2, input_dev->keybit); 1199 + 1200 + __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); 1201 + break; 1202 + 1203 + case PTU: 1207 1204 __set_bit(BTN_STYLUS2, input_dev->keybit); 1208 1205 /* fall through */ 1209 1206 1210 1207 case PENPARTNER: 1208 + __set_bit(BTN_TOOL_PEN, input_dev->keybit); 1211 1209 __set_bit(BTN_TOOL_RUBBER, input_dev->keybit); 1210 + __set_bit(BTN_STYLUS, input_dev->keybit); 1211 + 1212 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1212 1213 break; 1213 1214 1214 1215 case BAMBOO_PT: 1215 1216 __clear_bit(ABS_MISC, input_dev->absbit); 1217 + 1218 + __set_bit(INPUT_PROP_POINTER, input_dev->propbit); 1216 1219 1217 1220 if (features->device_type == BTN_TOOL_DOUBLETAP) { 1218 1221 __set_bit(BTN_LEFT, input_dev->keybit);
+2
drivers/input/touchscreen/wacom_w8001.c
··· 383 383 dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 384 384 strlcat(w8001->name, "Wacom Serial", sizeof(w8001->name)); 385 385 386 + __set_bit(INPUT_PROP_DIRECT, dev->propbit); 387 + 386 388 /* penabled? */ 387 389 error = w8001_command(w8001, W8001_CMD_QUERY, true); 388 390 if (!error) {