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: elantech - touchpad driver miss-recognising logitech mice
Input: synaptics - ensure we reset the device on resume
Input: usbtouchscreen - fix eGalax HID ignoring
Input: ambakmi - fix timeout handling in amba_kmi_write()
Input: pxa930_trkball - fix write timeout handling
Input: struct device - replace bus_id with dev_name(), dev_set_name()
Input: bf54x-keys - fix debounce time validation
Input: spitzkbd - mark probe function as __devinit
Input: omap-keypad - mark probe function as __devinit
Input: corgi_ts - mark probe function as __devinit
Input: corgikbd - mark probe function as __devinit
Input: uvc - the button on the camera is KEY_CAMERA
Input: psmouse - make MOUSE_PS2_LIFEBOOK depend on X86
Input: atkbd - make forced_release_keys[] static
Input: usbtouchscreen - allow reporting calibrated data

+84 -49
+2 -2
drivers/input/keyboard/atkbd.c
··· 839 839 */ 840 840 static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd) 841 841 { 842 - const unsigned int forced_release_keys[] = { 842 + static const unsigned int forced_release_keys[] = { 843 843 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, 844 844 }; 845 845 int i; ··· 856 856 */ 857 857 static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) 858 858 { 859 - const unsigned int forced_release_keys[] = { 859 + static const unsigned int forced_release_keys[] = { 860 860 0x94, 861 861 }; 862 862 int i;
+2 -2
drivers/input/keyboard/bf54x-keys.c
··· 209 209 goto out; 210 210 } 211 211 212 - if (!pdata->debounce_time || !pdata->debounce_time > MAX_MULT || 213 - !pdata->coldrive_time || !pdata->coldrive_time > MAX_MULT) { 212 + if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT || 213 + !pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) { 214 214 printk(KERN_ERR DRV_NAME 215 215 ": Invalid Debounce/Columdrive Time from pdata\n"); 216 216 bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */
+4 -4
drivers/input/keyboard/corgikbd.c
··· 288 288 #define corgikbd_resume NULL 289 289 #endif 290 290 291 - static int __init corgikbd_probe(struct platform_device *pdev) 291 + static int __devinit corgikbd_probe(struct platform_device *pdev) 292 292 { 293 293 struct corgikbd *corgikbd; 294 294 struct input_dev *input_dev; ··· 368 368 return err; 369 369 } 370 370 371 - static int corgikbd_remove(struct platform_device *pdev) 371 + static int __devexit corgikbd_remove(struct platform_device *pdev) 372 372 { 373 373 int i; 374 374 struct corgikbd *corgikbd = platform_get_drvdata(pdev); ··· 388 388 389 389 static struct platform_driver corgikbd_driver = { 390 390 .probe = corgikbd_probe, 391 - .remove = corgikbd_remove, 391 + .remove = __devexit_p(corgikbd_remove), 392 392 .suspend = corgikbd_suspend, 393 393 .resume = corgikbd_resume, 394 394 .driver = { ··· 397 397 }, 398 398 }; 399 399 400 - static int __devinit corgikbd_init(void) 400 + static int __init corgikbd_init(void) 401 401 { 402 402 return platform_driver_register(&corgikbd_driver); 403 403 }
+4 -4
drivers/input/keyboard/omap-keypad.c
··· 279 279 #define omap_kp_resume NULL 280 280 #endif 281 281 282 - static int __init omap_kp_probe(struct platform_device *pdev) 282 + static int __devinit omap_kp_probe(struct platform_device *pdev) 283 283 { 284 284 struct omap_kp *omap_kp; 285 285 struct input_dev *input_dev; ··· 422 422 return -EINVAL; 423 423 } 424 424 425 - static int omap_kp_remove(struct platform_device *pdev) 425 + static int __devexit omap_kp_remove(struct platform_device *pdev) 426 426 { 427 427 struct omap_kp *omap_kp = platform_get_drvdata(pdev); 428 428 ··· 454 454 455 455 static struct platform_driver omap_kp_driver = { 456 456 .probe = omap_kp_probe, 457 - .remove = omap_kp_remove, 457 + .remove = __devexit_p(omap_kp_remove), 458 458 .suspend = omap_kp_suspend, 459 459 .resume = omap_kp_resume, 460 460 .driver = { ··· 463 463 }, 464 464 }; 465 465 466 - static int __devinit omap_kp_init(void) 466 + static int __init omap_kp_init(void) 467 467 { 468 468 printk(KERN_INFO "OMAP Keypad Driver\n"); 469 469 return platform_driver_register(&omap_kp_driver);
+4 -4
drivers/input/keyboard/spitzkbd.c
··· 343 343 #define spitzkbd_resume NULL 344 344 #endif 345 345 346 - static int __init spitzkbd_probe(struct platform_device *dev) 346 + static int __devinit spitzkbd_probe(struct platform_device *dev) 347 347 { 348 348 struct spitzkbd *spitzkbd; 349 349 struct input_dev *input_dev; ··· 444 444 return err; 445 445 } 446 446 447 - static int spitzkbd_remove(struct platform_device *dev) 447 + static int __devexit spitzkbd_remove(struct platform_device *dev) 448 448 { 449 449 int i; 450 450 struct spitzkbd *spitzkbd = platform_get_drvdata(dev); ··· 470 470 471 471 static struct platform_driver spitzkbd_driver = { 472 472 .probe = spitzkbd_probe, 473 - .remove = spitzkbd_remove, 473 + .remove = __devexit_p(spitzkbd_remove), 474 474 .suspend = spitzkbd_suspend, 475 475 .resume = spitzkbd_resume, 476 476 .driver = { ··· 479 479 }, 480 480 }; 481 481 482 - static int __devinit spitzkbd_init(void) 482 + static int __init spitzkbd_init(void) 483 483 { 484 484 return platform_driver_register(&spitzkbd_driver); 485 485 }
+1 -1
drivers/input/mouse/Kconfig
··· 70 70 config MOUSE_PS2_LIFEBOOK 71 71 bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED 72 72 default y 73 - depends on MOUSE_PS2 73 + depends on MOUSE_PS2 && X86 74 74 help 75 75 Say Y here if you have a Fujitsu B-series Lifebook PS/2 76 76 TouchScreen connected to your system.
+24 -8
drivers/input/mouse/elantech.c
··· 542 542 ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || 543 543 ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || 544 544 ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { 545 - pr_err("elantech.c: sending Elantech magic knock failed.\n"); 545 + pr_debug("elantech.c: sending Elantech magic knock failed.\n"); 546 546 return -1; 547 547 } 548 548 ··· 551 551 * set of magic numbers 552 552 */ 553 553 if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { 554 - pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", 555 - param[0], param[1], param[2]); 554 + pr_debug("elantech.c: " 555 + "unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", 556 + param[0], param[1], param[2]); 557 + return -1; 558 + } 559 + 560 + /* 561 + * Query touchpad's firmware version and see if it reports known 562 + * value to avoid mis-detection. Logitech mice are known to respond 563 + * to Elantech magic knock and there might be more. 564 + */ 565 + if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { 566 + pr_debug("elantech.c: failed to query firmware version.\n"); 567 + return -1; 568 + } 569 + 570 + pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", 571 + param[0], param[1], param[2]); 572 + 573 + if (param[0] == 0 || param[1] != 0) { 574 + pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); 556 575 return -1; 557 576 } 558 577 ··· 619 600 int i, error; 620 601 unsigned char param[3]; 621 602 622 - etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); 623 - psmouse->private = etd; 603 + psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); 624 604 if (!etd) 625 605 return -1; 626 606 ··· 628 610 etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; 629 611 630 612 /* 631 - * Find out what version hardware this is 613 + * Do the version query again so we can store the result 632 614 */ 633 615 if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { 634 616 pr_err("elantech.c: failed to query firmware version.\n"); 635 617 goto init_fail; 636 618 } 637 - pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", 638 - param[0], param[1], param[2]); 639 619 etd->fw_version_maj = param[0]; 640 620 etd->fw_version_min = param[2]; 641 621
+1 -1
drivers/input/mouse/pxa930_trkball.c
··· 83 83 84 84 __raw_writel(v, trkball->mmio_base + TBCR); 85 85 86 - while (i--) { 86 + while (--i) { 87 87 if (__raw_readl(trkball->mmio_base + TBCR) == v) 88 88 break; 89 89 msleep(1);
+4 -5
drivers/input/mouse/synaptics.c
··· 182 182 183 183 static int synaptics_query_hardware(struct psmouse *psmouse) 184 184 { 185 - int retries = 0; 186 - 187 - while ((retries++ < 3) && psmouse_reset(psmouse)) 188 - /* empty */; 189 - 190 185 if (synaptics_identify(psmouse)) 191 186 return -1; 192 187 if (synaptics_model_id(psmouse)) ··· 577 582 struct synaptics_data *priv = psmouse->private; 578 583 struct synaptics_data old_priv = *priv; 579 584 585 + psmouse_reset(psmouse); 586 + 580 587 if (synaptics_detect(psmouse, 0)) 581 588 return -1; 582 589 ··· 636 639 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); 637 640 if (!priv) 638 641 return -1; 642 + 643 + psmouse_reset(psmouse); 639 644 640 645 if (synaptics_query_hardware(psmouse)) { 641 646 printk(KERN_ERR "Unable to query Synaptics hardware.\n");
+3 -3
drivers/input/serio/ambakmi.c
··· 57 57 struct amba_kmi_port *kmi = io->port_data; 58 58 unsigned int timeleft = 10000; /* timeout in 100ms */ 59 59 60 - while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--) 60 + while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft) 61 61 udelay(10); 62 62 63 63 if (timeleft) ··· 129 129 io->write = amba_kmi_write; 130 130 io->open = amba_kmi_open; 131 131 io->close = amba_kmi_close; 132 - strlcpy(io->name, dev->dev.bus_id, sizeof(io->name)); 133 - strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys)); 132 + strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name)); 133 + strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys)); 134 134 io->port_data = kmi; 135 135 io->dev.parent = &dev->dev; 136 136
+1 -1
drivers/input/serio/gscps2.c
··· 359 359 360 360 snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s", 361 361 (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse"); 362 - strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); 362 + strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); 363 363 serio->id.type = SERIO_8042; 364 364 serio->write = gscps2_write; 365 365 serio->open = gscps2_open;
+2 -2
drivers/input/serio/sa1111ps2.c
··· 246 246 serio->write = ps2_write; 247 247 serio->open = ps2_open; 248 248 serio->close = ps2_close; 249 - strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name)); 250 - strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); 249 + strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name)); 250 + strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); 251 251 serio->port_data = ps2if; 252 252 serio->dev.parent = &dev->dev; 253 253 ps2if->io = serio;
+1 -1
drivers/input/touchscreen/atmel_tsadcc.c
··· 236 236 ts_dev->bufferedmeasure = 0; 237 237 238 238 snprintf(ts_dev->phys, sizeof(ts_dev->phys), 239 - "%s/input0", pdev->dev.bus_id); 239 + "%s/input0", dev_name(&pdev->dev)); 240 240 241 241 input_dev->name = "atmel touch screen controller"; 242 242 input_dev->phys = ts_dev->phys;
+5 -4
drivers/input/touchscreen/corgi_ts.c
··· 268 268 #define corgits_resume NULL 269 269 #endif 270 270 271 - static int __init corgits_probe(struct platform_device *pdev) 271 + static int __devinit corgits_probe(struct platform_device *pdev) 272 272 { 273 273 struct corgi_ts *corgi_ts; 274 274 struct input_dev *input_dev; ··· 343 343 return err; 344 344 } 345 345 346 - static int corgits_remove(struct platform_device *pdev) 346 + static int __devexit corgits_remove(struct platform_device *pdev) 347 347 { 348 348 struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); 349 349 ··· 352 352 corgi_ts->machinfo->put_hsync(); 353 353 input_unregister_device(corgi_ts->input); 354 354 kfree(corgi_ts); 355 + 355 356 return 0; 356 357 } 357 358 358 359 static struct platform_driver corgits_driver = { 359 360 .probe = corgits_probe, 360 - .remove = corgits_remove, 361 + .remove = __devexit_p(corgits_remove), 361 362 .suspend = corgits_suspend, 362 363 .resume = corgits_resume, 363 364 .driver = { ··· 367 366 }, 368 367 }; 369 368 370 - static int __devinit corgits_init(void) 369 + static int __init corgits_init(void) 371 370 { 372 371 return platform_driver_register(&corgits_driver); 373 372 }
+2 -1
drivers/input/touchscreen/tsc2007.c
··· 289 289 290 290 pdata->init_platform_hw(); 291 291 292 - snprintf(ts->phys, sizeof(ts->phys), "%s/input0", client->dev.bus_id); 292 + snprintf(ts->phys, sizeof(ts->phys), 293 + "%s/input0", dev_name(&client->dev)); 293 294 294 295 input_dev->name = "TSC2007 Touchscreen"; 295 296 input_dev->phys = ts->phys;
+18 -2
drivers/input/touchscreen/usbtouchscreen.c
··· 60 60 module_param(swap_xy, bool, 0644); 61 61 MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); 62 62 63 + static int hwcalib_xy; 64 + module_param(hwcalib_xy, bool, 0644); 65 + MODULE_PARM_DESC(hwcalib_xy, "If set hw-calibrated X/Y are used if available"); 66 + 63 67 /* device specifc data/functions */ 64 68 struct usbtouch_usb; 65 69 struct usbtouch_device_info { ··· 122 118 123 119 #define USB_DEVICE_HID_CLASS(vend, prod) \ 124 120 .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ 121 + | USB_DEVICE_ID_MATCH_INT_PROTOCOL \ 125 122 | USB_DEVICE_ID_MATCH_DEVICE, \ 126 123 .idVendor = (vend), \ 127 124 .idProduct = (prod), \ ··· 265 260 266 261 static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 267 262 { 268 - dev->x = (pkt[8] << 8) | pkt[7]; 269 - dev->y = (pkt[10] << 8) | pkt[9]; 263 + if (hwcalib_xy) { 264 + dev->x = (pkt[4] << 8) | pkt[3]; 265 + dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]); 266 + } else { 267 + dev->x = (pkt[8] << 8) | pkt[7]; 268 + dev->y = (pkt[10] << 8) | pkt[9]; 269 + } 270 270 dev->touch = (pkt[2] & 0x40) ? 1 : 0; 271 271 272 272 return 1; ··· 302 292 break; 303 293 if (ret != -EPIPE) 304 294 return ret; 295 + } 296 + 297 + /* Default min/max xy are the raw values, override if using hw-calib */ 298 + if (hwcalib_xy) { 299 + input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0); 300 + input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0); 305 301 } 306 302 307 303 return 0;
+6 -4
drivers/media/video/uvc/uvc_status.c
··· 46 46 usb_to_input_id(udev, &input->id); 47 47 input->dev.parent = &dev->intf->dev; 48 48 49 - set_bit(EV_KEY, input->evbit); 50 - set_bit(BTN_0, input->keybit); 49 + __set_bit(EV_KEY, input->evbit); 50 + __set_bit(KEY_CAMERA, input->keybit); 51 51 52 52 if ((ret = input_register_device(input)) < 0) 53 53 goto error; ··· 70 70 static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, 71 71 int value) 72 72 { 73 - if (dev->input) 73 + if (dev->input) { 74 74 input_report_key(dev->input, code, value); 75 + input_sync(dev->input); 76 + } 75 77 } 76 78 77 79 #else ··· 98 96 return; 99 97 uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", 100 98 data[1], data[3] ? "pressed" : "released", len); 101 - uvc_input_report_key(dev, BTN_0, data[3]); 99 + uvc_input_report_key(dev, KEY_CAMERA, data[3]); 102 100 } else { 103 101 uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " 104 102 "len %d.\n", data[1], data[2], data[3], len);