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

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
Input: wacom - switch mode upon system resume
Revert "Input: wacom - merge out and in prox events"
Input: matrix_keypad - allow platform to disable key autorepeat
Input: ALPS - add signature for HP Pavilion dm3 laptops
Input: i8042 - spelling fix
Input: sparse-keymap - implement safer freeing of the keymap
Input: update the status of the Multitouch X driver project
Input: clarify the no-finger event in multitouch protocol
Input: bcm5974 - retract efi-broken suspend_resume
Input: sparse-keymap - free the right keymap on error

+176 -93
+17 -6
Documentation/input/multi-touch-protocol.txt
··· 68 68 SYN_MT_REPORT 69 69 SYN_REPORT 70 70 71 + Here is the sequence after lifting one of the fingers: 72 + 73 + ABS_MT_POSITION_X 74 + ABS_MT_POSITION_Y 75 + SYN_MT_REPORT 76 + SYN_REPORT 77 + 78 + And here is the sequence after lifting the remaining finger: 79 + 80 + SYN_MT_REPORT 81 + SYN_REPORT 82 + 83 + If the driver reports one of BTN_TOUCH or ABS_PRESSURE in addition to the 84 + ABS_MT events, the last SYN_MT_REPORT event may be omitted. Otherwise, the 85 + last SYN_REPORT will be dropped by the input core, resulting in no 86 + zero-finger event reaching userland. 71 87 72 88 Event Semantics 73 89 --------------- ··· 233 217 difference between the contact position and the approaching tool position 234 218 could be used to derive tilt. 235 219 [2] The list can of course be extended. 236 - [3] The multi-touch X driver is currently in the prototyping stage. At the 237 - time of writing (April 2009), the MT protocol is not yet merged, and the 238 - prototype implements finger matching, basic mouse support and two-finger 239 - scrolling. The project aims at improving the quality of current multi-touch 240 - functionality available in the Synaptics X driver, and in addition 241 - implement more advanced gestures. 220 + [3] Multitouch X driver project: http://bitmath.org/code/multitouch/. 242 221 [4] See the section on event computation. 243 222 [5] See the section on finger tracking.
+8 -1
drivers/input/input.c
··· 660 660 int input_get_keycode(struct input_dev *dev, 661 661 unsigned int scancode, unsigned int *keycode) 662 662 { 663 - return dev->getkeycode(dev, scancode, keycode); 663 + unsigned long flags; 664 + int retval; 665 + 666 + spin_lock_irqsave(&dev->event_lock, flags); 667 + retval = dev->getkeycode(dev, scancode, keycode); 668 + spin_unlock_irqrestore(&dev->event_lock, flags); 669 + 670 + return retval; 664 671 } 665 672 EXPORT_SYMBOL(input_get_keycode); 666 673
+3 -1
drivers/input/keyboard/matrix_keypad.c
··· 374 374 input_dev->name = pdev->name; 375 375 input_dev->id.bustype = BUS_HOST; 376 376 input_dev->dev.parent = &pdev->dev; 377 - input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); 377 + input_dev->evbit[0] = BIT_MASK(EV_KEY); 378 + if (!pdata->no_autorepeat) 379 + input_dev->evbit[0] |= BIT_MASK(EV_REP); 378 380 input_dev->open = matrix_keypad_start; 379 381 input_dev->close = matrix_keypad_stop; 380 382
+1
drivers/input/mouse/alps.c
··· 64 64 { { 0x62, 0x02, 0x14 }, 0xcf, 0xcf, 65 65 ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, 66 66 { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FOUR_BUTTONS }, /* Dell Vostro 1400 */ 67 + { { 0x73, 0x02, 0x64 }, 0xf8, 0xf8, 0 }, /* HP Pavilion dm3 */ 67 68 { { 0x52, 0x01, 0x14 }, 0xff, 0xff, 68 69 ALPS_PASS | ALPS_DUALPOINT | ALPS_PS2_INTERLEAVED }, /* Toshiba Tecra A11-11L */ 69 70 };
-1
drivers/input/mouse/bcm5974.c
··· 803 803 .disconnect = bcm5974_disconnect, 804 804 .suspend = bcm5974_suspend, 805 805 .resume = bcm5974_resume, 806 - .reset_resume = bcm5974_resume, 807 806 .id_table = bcm5974_table, 808 807 .supports_autosuspend = 1, 809 808 };
+1 -1
drivers/input/serio/i8042.c
··· 39 39 40 40 static bool i8042_nomux; 41 41 module_param_named(nomux, i8042_nomux, bool, 0); 42 - MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing conrtoller is present."); 42 + MODULE_PARM_DESC(nomux, "Do not check whether an active multiplexing controller is present."); 43 43 44 44 static bool i8042_unlock; 45 45 module_param_named(unlock, i8042_unlock, bool, 0);
+33 -19
drivers/input/sparse-keymap.c
··· 68 68 unsigned int scancode, 69 69 unsigned int *keycode) 70 70 { 71 - const struct key_entry *key = 72 - sparse_keymap_entry_from_scancode(dev, scancode); 71 + const struct key_entry *key; 73 72 74 - if (key && key->type == KE_KEY) { 75 - *keycode = key->keycode; 76 - return 0; 73 + if (dev->keycode) { 74 + key = sparse_keymap_entry_from_scancode(dev, scancode); 75 + if (key && key->type == KE_KEY) { 76 + *keycode = key->keycode; 77 + return 0; 78 + } 77 79 } 78 80 79 81 return -EINVAL; ··· 88 86 struct key_entry *key; 89 87 int old_keycode; 90 88 91 - if (keycode < 0 || keycode > KEY_MAX) 92 - return -EINVAL; 93 - 94 - key = sparse_keymap_entry_from_scancode(dev, scancode); 95 - if (key && key->type == KE_KEY) { 96 - old_keycode = key->keycode; 97 - key->keycode = keycode; 98 - set_bit(keycode, dev->keybit); 99 - if (!sparse_keymap_entry_from_keycode(dev, old_keycode)) 100 - clear_bit(old_keycode, dev->keybit); 101 - return 0; 89 + if (dev->keycode) { 90 + key = sparse_keymap_entry_from_scancode(dev, scancode); 91 + if (key && key->type == KE_KEY) { 92 + old_keycode = key->keycode; 93 + key->keycode = keycode; 94 + set_bit(keycode, dev->keybit); 95 + if (!sparse_keymap_entry_from_keycode(dev, old_keycode)) 96 + clear_bit(old_keycode, dev->keybit); 97 + return 0; 98 + } 102 99 } 103 100 104 101 return -EINVAL; ··· 165 164 return 0; 166 165 167 166 err_out: 168 - kfree(keymap); 167 + kfree(map); 169 168 return error; 170 169 171 170 } ··· 177 176 * 178 177 * This function is used to free memory allocated by sparse keymap 179 178 * in an input device that was set up by sparse_keymap_setup(). 179 + * NOTE: It is safe to cal this function while input device is 180 + * still registered (however the drivers should care not to try to 181 + * use freed keymap and thus have to shut off interrups/polling 182 + * before freeing the keymap). 180 183 */ 181 184 void sparse_keymap_free(struct input_dev *dev) 182 185 { 186 + unsigned long flags; 187 + 188 + /* 189 + * Take event lock to prevent racing with input_get_keycode() 190 + * and input_set_keycode() if we are called while input device 191 + * is still registered. 192 + */ 193 + spin_lock_irqsave(&dev->event_lock, flags); 194 + 183 195 kfree(dev->keycode); 184 196 dev->keycode = NULL; 185 197 dev->keycodemax = 0; 186 - dev->getkeycode = NULL; 187 - dev->setkeycode = NULL; 198 + 199 + spin_unlock_irqrestore(&dev->event_lock, flags); 188 200 } 189 201 EXPORT_SYMBOL(sparse_keymap_free); 190 202
+7 -5
drivers/input/tablet/wacom_sys.c
··· 673 673 int rv; 674 674 675 675 mutex_lock(&wacom->lock); 676 - if (wacom->open) { 676 + 677 + /* switch to wacom mode first */ 678 + wacom_query_tablet_data(intf, features); 679 + 680 + if (wacom->open) 677 681 rv = usb_submit_urb(wacom->irq, GFP_NOIO); 678 - /* switch to wacom mode if needed */ 679 - if (!wacom_retrieve_hid_descriptor(intf, features)) 680 - wacom_query_tablet_data(intf, features); 681 - } else 682 + else 682 683 rv = 0; 684 + 683 685 mutex_unlock(&wacom->lock); 684 686 685 687 return rv;
+104 -59
drivers/input/tablet/wacom_wac.c
··· 155 155 { 156 156 struct wacom_features *features = &wacom->features; 157 157 unsigned char *data = wacom->data; 158 - int x, y, prox; 159 - int rw = 0; 160 - int retval = 0; 158 + int x, y, rw; 159 + static int penData = 0; 161 160 162 161 if (data[0] != WACOM_REPORT_PENABLED) { 163 162 dbg("wacom_graphire_irq: received unknown report #%d", data[0]); 164 - goto exit; 163 + return 0; 165 164 } 166 165 167 - prox = data[1] & 0x80; 168 - if (prox || wacom->id[0]) { 169 - if (prox) { 170 - switch ((data[1] >> 5) & 3) { 166 + if (data[1] & 0x80) { 167 + /* in prox and not a pad data */ 168 + penData = 1; 169 + 170 + switch ((data[1] >> 5) & 3) { 171 171 172 172 case 0: /* Pen */ 173 173 wacom->tool[0] = BTN_TOOL_PEN; ··· 181 181 182 182 case 2: /* Mouse with wheel */ 183 183 wacom_report_key(wcombo, BTN_MIDDLE, data[1] & 0x04); 184 + if (features->type == WACOM_G4 || features->type == WACOM_MO) { 185 + rw = data[7] & 0x04 ? (data[7] & 0x03)-4 : (data[7] & 0x03); 186 + wacom_report_rel(wcombo, REL_WHEEL, -rw); 187 + } else 188 + wacom_report_rel(wcombo, REL_WHEEL, -(signed char) data[6]); 184 189 /* fall through */ 185 190 186 191 case 3: /* Mouse without wheel */ 187 192 wacom->tool[0] = BTN_TOOL_MOUSE; 188 193 wacom->id[0] = CURSOR_DEVICE_ID; 194 + wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); 195 + wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); 196 + if (features->type == WACOM_G4 || features->type == WACOM_MO) 197 + wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f); 198 + else 199 + wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f); 189 200 break; 190 - } 191 201 } 192 202 x = wacom_le16_to_cpu(&data[2]); 193 203 y = wacom_le16_to_cpu(&data[4]); ··· 208 198 wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x01); 209 199 wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); 210 200 wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x04); 211 - } else { 212 - wacom_report_key(wcombo, BTN_LEFT, data[1] & 0x01); 213 - wacom_report_key(wcombo, BTN_RIGHT, data[1] & 0x02); 214 - if (features->type == WACOM_G4 || 215 - features->type == WACOM_MO) { 216 - wacom_report_abs(wcombo, ABS_DISTANCE, data[6] & 0x3f); 217 - rw = (signed)(data[7] & 0x04) - (data[7] & 0x03); 218 - } else { 219 - wacom_report_abs(wcombo, ABS_DISTANCE, data[7] & 0x3f); 220 - rw = -(signed)data[6]; 221 - } 222 - wacom_report_rel(wcombo, REL_WHEEL, rw); 223 201 } 224 - 225 - if (!prox) 226 - wacom->id[0] = 0; 227 202 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); /* report tool id */ 228 - wacom_report_key(wcombo, wacom->tool[0], prox); 229 - wacom_input_sync(wcombo); /* sync last event */ 203 + wacom_report_key(wcombo, wacom->tool[0], 1); 204 + } else if (wacom->id[0]) { 205 + wacom_report_abs(wcombo, ABS_X, 0); 206 + wacom_report_abs(wcombo, ABS_Y, 0); 207 + if (wacom->tool[0] == BTN_TOOL_MOUSE) { 208 + wacom_report_key(wcombo, BTN_LEFT, 0); 209 + wacom_report_key(wcombo, BTN_RIGHT, 0); 210 + wacom_report_abs(wcombo, ABS_DISTANCE, 0); 211 + } else { 212 + wacom_report_abs(wcombo, ABS_PRESSURE, 0); 213 + wacom_report_key(wcombo, BTN_TOUCH, 0); 214 + wacom_report_key(wcombo, BTN_STYLUS, 0); 215 + wacom_report_key(wcombo, BTN_STYLUS2, 0); 216 + } 217 + wacom->id[0] = 0; 218 + wacom_report_abs(wcombo, ABS_MISC, 0); /* reset tool id */ 219 + wacom_report_key(wcombo, wacom->tool[0], 0); 230 220 } 231 221 232 222 /* send pad data */ 233 223 switch (features->type) { 234 224 case WACOM_G4: 235 - prox = data[7] & 0xf8; 236 - if (prox || wacom->id[1]) { 225 + if (data[7] & 0xf8) { 226 + if (penData) { 227 + wacom_input_sync(wcombo); /* sync last event */ 228 + if (!wacom->id[0]) 229 + penData = 0; 230 + } 237 231 wacom->id[1] = PAD_DEVICE_ID; 238 232 wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); 239 233 wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); ··· 245 231 wacom_report_rel(wcombo, REL_WHEEL, rw); 246 232 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); 247 233 wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); 248 - if (!prox) 249 - wacom->id[1] = 0; 250 - wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); 234 + wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); 235 + } else if (wacom->id[1]) { 236 + if (penData) { 237 + wacom_input_sync(wcombo); /* sync last event */ 238 + if (!wacom->id[0]) 239 + penData = 0; 240 + } 241 + wacom->id[1] = 0; 242 + wacom_report_key(wcombo, BTN_0, (data[7] & 0x40)); 243 + wacom_report_key(wcombo, BTN_4, (data[7] & 0x80)); 244 + wacom_report_rel(wcombo, REL_WHEEL, 0); 245 + wacom_report_key(wcombo, BTN_TOOL_FINGER, 0); 246 + wacom_report_abs(wcombo, ABS_MISC, 0); 251 247 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); 252 248 } 253 - retval = 1; 254 249 break; 255 250 case WACOM_MO: 256 - prox = (data[7] & 0xf8) || data[8]; 257 - if (prox || wacom->id[1]) { 251 + if ((data[7] & 0xf8) || (data[8] & 0xff)) { 252 + if (penData) { 253 + wacom_input_sync(wcombo); /* sync last event */ 254 + if (!wacom->id[0]) 255 + penData = 0; 256 + } 258 257 wacom->id[1] = PAD_DEVICE_ID; 259 258 wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); 260 259 wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); ··· 275 248 wacom_report_key(wcombo, BTN_5, (data[7] & 0x40)); 276 249 wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f)); 277 250 wacom_report_key(wcombo, BTN_TOOL_FINGER, 0xf0); 278 - if (!prox) 279 - wacom->id[1] = 0; 280 251 wacom_report_abs(wcombo, ABS_MISC, wacom->id[1]); 281 252 wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); 253 + } else if (wacom->id[1]) { 254 + if (penData) { 255 + wacom_input_sync(wcombo); /* sync last event */ 256 + if (!wacom->id[0]) 257 + penData = 0; 258 + } 259 + wacom->id[1] = 0; 260 + wacom_report_key(wcombo, BTN_0, (data[7] & 0x08)); 261 + wacom_report_key(wcombo, BTN_1, (data[7] & 0x20)); 262 + wacom_report_key(wcombo, BTN_4, (data[7] & 0x10)); 263 + wacom_report_key(wcombo, BTN_5, (data[7] & 0x40)); 264 + wacom_report_abs(wcombo, ABS_WHEEL, (data[8] & 0x7f)); 265 + wacom_report_key(wcombo, BTN_TOOL_FINGER, 0); 266 + wacom_report_abs(wcombo, ABS_MISC, 0); 267 + wacom_input_event(wcombo, EV_MSC, MSC_SERIAL, 0xf0); 282 268 } 283 - retval = 1; 284 269 break; 285 270 } 286 - exit: 287 - return retval; 271 + return 1; 288 272 } 289 273 290 274 static int wacom_intuos_inout(struct wacom_wac *wacom, void *wcombo) ··· 636 598 static void wacom_tpc_finger_in(struct wacom_wac *wacom, void *wcombo, char *data, int idx) 637 599 { 638 600 wacom_report_abs(wcombo, ABS_X, 639 - data[2 + idx * 2] | ((data[3 + idx * 2] & 0x7f) << 8)); 601 + (data[2 + idx * 2] & 0xff) | ((data[3 + idx * 2] & 0x7f) << 8)); 640 602 wacom_report_abs(wcombo, ABS_Y, 641 - data[6 + idx * 2] | ((data[7 + idx * 2] & 0x7f) << 8)); 603 + (data[6 + idx * 2] & 0xff) | ((data[7 + idx * 2] & 0x7f) << 8)); 642 604 wacom_report_abs(wcombo, ABS_MISC, wacom->id[0]); 643 605 wacom_report_key(wcombo, wacom->tool[idx], 1); 644 606 if (idx) ··· 782 744 783 745 touchInProx = 0; 784 746 785 - if (!wacom->id[0]) { /* first in prox */ 786 - /* Going into proximity select tool */ 787 - wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; 788 - if (wacom->tool[0] == BTN_TOOL_PEN) 789 - wacom->id[0] = STYLUS_DEVICE_ID; 790 - else 791 - wacom->id[0] = ERASER_DEVICE_ID; 792 - } 793 - wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); 794 - wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10); 795 - wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); 796 - wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); 797 - pressure = ((data[7] & 0x01) << 8) | data[6]; 798 - if (pressure < 0) 799 - pressure = features->pressure_max + pressure + 1; 800 - wacom_report_abs(wcombo, ABS_PRESSURE, pressure); 801 - wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x05); 802 - if (!prox) { /* out-prox */ 747 + if (prox) { /* in prox */ 748 + if (!wacom->id[0]) { 749 + /* Going into proximity select tool */ 750 + wacom->tool[0] = (data[1] & 0x0c) ? BTN_TOOL_RUBBER : BTN_TOOL_PEN; 751 + if (wacom->tool[0] == BTN_TOOL_PEN) 752 + wacom->id[0] = STYLUS_DEVICE_ID; 753 + else 754 + wacom->id[0] = ERASER_DEVICE_ID; 755 + } 756 + wacom_report_key(wcombo, BTN_STYLUS, data[1] & 0x02); 757 + wacom_report_key(wcombo, BTN_STYLUS2, data[1] & 0x10); 758 + wacom_report_abs(wcombo, ABS_X, wacom_le16_to_cpu(&data[2])); 759 + wacom_report_abs(wcombo, ABS_Y, wacom_le16_to_cpu(&data[4])); 760 + pressure = ((data[7] & 0x01) << 8) | data[6]; 761 + if (pressure < 0) 762 + pressure = features->pressure_max + pressure + 1; 763 + wacom_report_abs(wcombo, ABS_PRESSURE, pressure); 764 + wacom_report_key(wcombo, BTN_TOUCH, data[1] & 0x05); 765 + } else { 766 + wacom_report_abs(wcombo, ABS_X, 0); 767 + wacom_report_abs(wcombo, ABS_Y, 0); 768 + wacom_report_abs(wcombo, ABS_PRESSURE, 0); 769 + wacom_report_key(wcombo, BTN_STYLUS, 0); 770 + wacom_report_key(wcombo, BTN_STYLUS2, 0); 771 + wacom_report_key(wcombo, BTN_TOUCH, 0); 803 772 wacom->id[0] = 0; 804 773 /* pen is out so touch can be enabled now */ 805 774 touchInProx = 1;
+2
include/linux/input/matrix_keypad.h
··· 44 44 * @active_low: gpio polarity 45 45 * @wakeup: controls whether the device should be set up as wakeup 46 46 * source 47 + * @no_autorepeat: disable key autorepeat 47 48 * 48 49 * This structure represents platform-specific data that use used by 49 50 * matrix_keypad driver to perform proper initialization. ··· 65 64 66 65 bool active_low; 67 66 bool wakeup; 67 + bool no_autorepeat; 68 68 }; 69 69 70 70 /**