aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-09-16 17:09:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-09-16 17:09:19 -0400
commit279b1e0fd90ef63c7acb34a5ca573f065a6fefb4 (patch)
tree25dfe9e76c375c2357096fc4ec334c5b00790ce0 /drivers/input
parentabbe0d3c26c545930492981cbd64be340ff41e05 (diff)
parent8f9068609e8a5b4cbac9e0cf8332b5dcabf05422 (diff)
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
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/keyboard/adp5588-keys.c1
-rw-r--r--drivers/input/misc/cm109.c2
-rw-r--r--drivers/input/mouse/bcm5974.c20
-rw-r--r--drivers/input/tablet/wacom_sys.c14
-rw-r--r--drivers/input/tablet/wacom_wac.c45
-rw-r--r--drivers/input/touchscreen/wacom_w8001.c2
6 files changed, 58 insertions, 26 deletions
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index 7b404e5443ed..e34eeb8ae371 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -668,4 +668,3 @@ module_exit(adp5588_exit);
668MODULE_LICENSE("GPL"); 668MODULE_LICENSE("GPL");
669MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>"); 669MODULE_AUTHOR("Michael Hennerich <hennerich@blackfin.uclinux.org>");
670MODULE_DESCRIPTION("ADP5588/87 Keypad driver"); 670MODULE_DESCRIPTION("ADP5588/87 Keypad driver");
671MODULE_ALIAS("platform:adp5588-keys");
diff --git a/drivers/input/misc/cm109.c b/drivers/input/misc/cm109.c
index b09c7d127219..ab860511f016 100644
--- a/drivers/input/misc/cm109.c
+++ b/drivers/input/misc/cm109.c
@@ -475,7 +475,7 @@ static void cm109_toggle_buzzer_sync(struct cm109_dev *dev, int on)
475 le16_to_cpu(dev->ctl_req->wIndex), 475 le16_to_cpu(dev->ctl_req->wIndex),
476 dev->ctl_data, 476 dev->ctl_data,
477 USB_PKT_LEN, USB_CTRL_SET_TIMEOUT); 477 USB_PKT_LEN, USB_CTRL_SET_TIMEOUT);
478 if (error && error != EINTR) 478 if (error < 0 && error != -EINTR)
479 err("%s: usb_control_msg() failed %d", __func__, error); 479 err("%s: usb_control_msg() failed %d", __func__, error);
480} 480}
481 481
diff --git a/drivers/input/mouse/bcm5974.c b/drivers/input/mouse/bcm5974.c
index da280189ef07..5ec617e28f7e 100644
--- a/drivers/input/mouse/bcm5974.c
+++ b/drivers/input/mouse/bcm5974.c
@@ -67,6 +67,10 @@
67#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245 67#define USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI 0x0245
68#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246 68#define USB_DEVICE_ID_APPLE_WELLSPRING5_ISO 0x0246
69#define USB_DEVICE_ID_APPLE_WELLSPRING5_JIS 0x0247 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/* MacbookAir4,2 (unibody, July 2011) */ 74/* MacbookAir4,2 (unibody, July 2011) */
71#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c 75#define USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI 0x024c
72#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d 76#define USB_DEVICE_ID_APPLE_WELLSPRING6_ISO 0x024d
@@ -112,6 +116,10 @@ static const struct usb_device_id bcm5974_table[] = {
112 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI), 116 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ANSI),
113 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO), 117 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_ISO),
114 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS), 118 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING5_JIS),
119 /* MacbookAir4,1 */
120 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI),
121 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO),
122 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS),
115 /* MacbookAir4,2 */ 123 /* MacbookAir4,2 */
116 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI), 124 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ANSI),
117 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ISO), 125 BCM5974_DEVICE(USB_DEVICE_ID_APPLE_WELLSPRING6_ISO),
@@ -334,6 +342,18 @@ static const struct bcm5974_config bcm5974_config_table[] = {
334 { DIM_X, DIM_X / SN_COORD, -4750, 5280 }, 342 { DIM_X, DIM_X / SN_COORD, -4750, 5280 },
335 { DIM_Y, DIM_Y / SN_COORD, -150, 6730 } 343 { DIM_Y, DIM_Y / SN_COORD, -150, 6730 }
336 }, 344 },
345 {
346 USB_DEVICE_ID_APPLE_WELLSPRING6A_ANSI,
347 USB_DEVICE_ID_APPLE_WELLSPRING6A_ISO,
348 USB_DEVICE_ID_APPLE_WELLSPRING6A_JIS,
349 HAS_INTEGRATED_BUTTON,
350 0x84, sizeof(struct bt_data),
351 0x81, TYPE2, FINGER_TYPE2, FINGER_TYPE2 + SIZEOF_ALL_FINGERS,
352 { DIM_PRESSURE, DIM_PRESSURE / SN_PRESSURE, 0, 300 },
353 { DIM_WIDTH, DIM_WIDTH / SN_WIDTH, 0, 2048 },
354 { DIM_X, DIM_X / SN_COORD, -4620, 5140 },
355 { DIM_Y, DIM_Y / SN_COORD, -150, 6600 }
356 },
337 {} 357 {}
338}; 358};
339 359
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
index d27c9d91630b..958b4eb6369d 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 c1c2f7b28d89..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);
diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c
index c14412ef4648..9941d39df43d 100644
--- a/drivers/input/touchscreen/wacom_w8001.c
+++ b/drivers/input/touchscreen/wacom_w8001.c
@@ -383,6 +383,8 @@ static int w8001_setup(struct w8001 *w8001)
383 dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); 383 dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS);
384 strlcat(w8001->name, "Wacom Serial", sizeof(w8001->name)); 384 strlcat(w8001->name, "Wacom Serial", sizeof(w8001->name));
385 385
386 __set_bit(INPUT_PROP_DIRECT, dev->propbit);
387
386 /* penabled? */ 388 /* penabled? */
387 error = w8001_command(w8001, W8001_CMD_QUERY, true); 389 error = w8001_command(w8001, W8001_CMD_QUERY, true);
388 if (!error) { 390 if (!error) {