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://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: ads7846 - SPI_CPHA mode bugfix
Input: ads7846 - document that it handles tsc2046 too
Input: input-polldev - add module info
Input: ucb1x00-ts - remove commented out code
Input: ucb1400_ts - use sched_setscheduler()
Input: ALPS - force stream mode
Input: iforce - minor clean-ups
Input: iforce - fix force feedback not working
Input: adbhid - do not access input_dev->private directly
Input: logips2pp - add type 72 (PS/2 TrackMan Marble)

+66 -59
+1 -3
drivers/input/joystick/iforce/iforce-main.c
··· 370 370 371 371 /* 372 372 * Disable spring, enable force feedback. 373 - * FIXME: We should use iforce_set_autocenter() et al here. 374 373 */ 375 - 376 - iforce_send_packet(iforce, FF_CMD_AUTOCENTER, "\004\000"); 374 + iforce_set_autocenter(input_dev, 0); 377 375 378 376 /* 379 377 * Find appropriate device entry
+8 -2
drivers/input/joystick/iforce/iforce-packets.c
··· 246 246 247 247 int iforce_get_id_packet(struct iforce *iforce, char *packet) 248 248 { 249 + int status; 250 + 249 251 switch (iforce->bus) { 250 252 251 253 case IFORCE_USB: ··· 256 254 iforce->cr.bRequest = packet[0]; 257 255 iforce->ctrl->dev = iforce->usbdev; 258 256 259 - if (usb_submit_urb(iforce->ctrl, GFP_ATOMIC)) 257 + status = usb_submit_urb(iforce->ctrl, GFP_ATOMIC); 258 + if (status) { 259 + err("usb_submit_urb failed %d", status); 260 260 return -1; 261 + } 261 262 262 263 wait_event_interruptible_timeout(iforce->wait, 263 264 iforce->ctrl->status != -EINPROGRESS, HZ); 264 265 265 266 if (iforce->ctrl->status) { 267 + dbg("iforce->ctrl->status = %d", iforce->ctrl->status); 266 268 usb_unlink_urb(iforce->ctrl); 267 269 return -1; 268 270 } 269 271 #else 270 - err("iforce_get_id_packet: iforce->bus = USB!"); 272 + dbg("iforce_get_id_packet: iforce->bus = USB!"); 271 273 #endif 272 274 break; 273 275
+3 -2
drivers/input/joystick/iforce/iforce-usb.c
··· 65 65 XMIT_INC(iforce->xmit.tail, n); 66 66 67 67 if ( (n=usb_submit_urb(iforce->out, GFP_ATOMIC)) ) { 68 + clear_bit(IFORCE_XMIT_RUNNING, iforce->xmit_flags); 68 69 warn("usb_submit_urb failed %d\n", n); 69 70 } 70 71 ··· 164 163 usb_fill_int_urb(iforce->irq, dev, usb_rcvintpipe(dev, epirq->bEndpointAddress), 165 164 iforce->data, 16, iforce_usb_irq, iforce, epirq->bInterval); 166 165 167 - usb_fill_bulk_urb(iforce->out, dev, usb_sndbulkpipe(dev, epout->bEndpointAddress), 168 - iforce + 1, 32, iforce_usb_out, iforce); 166 + usb_fill_int_urb(iforce->out, dev, usb_sndintpipe(dev, epout->bEndpointAddress), 167 + iforce + 1, 32, iforce_usb_out, iforce, epout->bInterval); 169 168 170 169 usb_fill_control_urb(iforce->ctrl, dev, usb_rcvctrlpipe(dev, 0), 171 170 (void*) &iforce->cr, iforce->edata, 16, iforce_usb_ctrl, iforce);
+5
drivers/input/misc/input-polldev.c
··· 12 12 #include <linux/mutex.h> 13 13 #include <linux/input-polldev.h> 14 14 15 + MODULE_AUTHOR("Dmitry Torokhov <dtor@mail.ru>"); 16 + MODULE_DESCRIPTION("Generic implementation of a polled input device"); 17 + MODULE_LICENSE("GPL v2"); 18 + MODULE_VERSION("0.1"); 19 + 15 20 static DEFINE_MUTEX(polldev_mutex); 16 21 static int polldev_users; 17 22 static struct workqueue_struct *polldev_wq;
+31 -27
drivers/input/mouse/alps.c
··· 251 251 252 252 dbg("E7 report: %2.2x %2.2x %2.2x", param[0], param[1], param[2]); 253 253 254 - for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++); 255 - *version = (param[0] << 8) | (param[1] << 4) | i; 254 + if (version) { 255 + for (i = 0; i < ARRAY_SIZE(rates) && param[2] != rates[i]; i++) 256 + /* empty */; 257 + *version = (param[0] << 8) | (param[1] << 4) | i; 258 + } 256 259 257 260 for (i = 0; i < ARRAY_SIZE(alps_model_data); i++) 258 - if (!memcmp(param, alps_model_data[i].signature, sizeof(alps_model_data[i].signature))) 261 + if (!memcmp(param, alps_model_data[i].signature, 262 + sizeof(alps_model_data[i].signature))) 259 263 return alps_model_data + i; 260 264 261 265 return NULL; ··· 384 380 return 0; 385 381 } 386 382 387 - static int alps_reconnect(struct psmouse *psmouse) 383 + static int alps_hw_init(struct psmouse *psmouse, int *version) 388 384 { 389 385 struct alps_data *priv = psmouse->private; 390 - int version; 391 386 392 - psmouse_reset(psmouse); 393 - 394 - if (!(priv->i = alps_get_model(psmouse, &version))) 387 + priv->i = alps_get_model(psmouse, version); 388 + if (!priv->i) 395 389 return -1; 396 390 397 391 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1)) 398 392 return -1; 399 393 400 394 if (alps_tap_mode(psmouse, 1)) { 401 - printk(KERN_WARNING "alps.c: Failed to reenable hardware tapping\n"); 395 + printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n"); 402 396 return -1; 403 397 } 404 398 405 399 if (alps_absolute_mode(psmouse)) { 406 - printk(KERN_ERR "alps.c: Failed to reenable absolute mode\n"); 400 + printk(KERN_ERR "alps.c: Failed to enable absolute mode\n"); 407 401 return -1; 408 402 } 409 403 410 404 if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0)) 405 + return -1; 406 + 407 + /* ALPS needs stream mode, otherwise it won't report any data */ 408 + if (ps2_command(&psmouse->ps2dev, NULL, PSMOUSE_CMD_SETSTREAM)) { 409 + printk(KERN_ERR "alps.c: Failed to enable stream mode\n"); 410 + return -1; 411 + } 412 + 413 + return 0; 414 + } 415 + 416 + static int alps_reconnect(struct psmouse *psmouse) 417 + { 418 + psmouse_reset(psmouse); 419 + 420 + if (alps_hw_init(psmouse, NULL)) 411 421 return -1; 412 422 413 423 return 0; ··· 448 430 goto init_fail; 449 431 450 432 priv->dev2 = dev2; 433 + psmouse->private = priv; 451 434 452 - priv->i = alps_get_model(psmouse, &version); 453 - if (!priv->i) 454 - goto init_fail; 455 - 456 - if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 1)) 457 - goto init_fail; 458 - 459 - if (alps_tap_mode(psmouse, 1)) 460 - printk(KERN_WARNING "alps.c: Failed to enable hardware tapping\n"); 461 - 462 - if (alps_absolute_mode(psmouse)) { 463 - printk(KERN_ERR "alps.c: Failed to enable absolute mode\n"); 464 - goto init_fail; 465 - } 466 - 467 - if ((priv->i->flags & ALPS_PASS) && alps_passthrough_mode(psmouse, 0)) 435 + if (alps_hw_init(psmouse, &version)) 468 436 goto init_fail; 469 437 470 438 dev1->evbit[LONG(EV_KEY)] |= BIT(EV_KEY); ··· 497 493 /* We are having trouble resyncing ALPS touchpads so disable it for now */ 498 494 psmouse->resync_time = 0; 499 495 500 - psmouse->private = priv; 501 496 return 0; 502 497 503 498 init_fail: 504 499 psmouse_reset(psmouse); 505 500 input_free_device(dev2); 506 501 kfree(priv); 502 + psmouse->private = NULL; 507 503 return -1; 508 504 } 509 505
+1
drivers/input/mouse/logips2pp.c
··· 221 221 { 66, PS2PP_KIND_MX, /* MX3100 reciver */ 222 222 PS2PP_WHEEL | PS2PP_SIDE_BTN | PS2PP_TASK_BTN | 223 223 PS2PP_EXTRA_BTN | PS2PP_NAV_BTN | PS2PP_HWHEEL }, 224 + { 72, PS2PP_KIND_TRACKMAN, 0 }, /* T-CH11: TrackMan Marble */ 224 225 { 73, 0, PS2PP_SIDE_BTN }, 225 226 { 75, PS2PP_KIND_WHEEL, PS2PP_WHEEL }, 226 227 { 76, PS2PP_KIND_WHEEL, PS2PP_WHEEL },
+4 -4
drivers/input/touchscreen/Kconfig
··· 12 12 if INPUT_TOUCHSCREEN 13 13 14 14 config TOUCHSCREEN_ADS7846 15 - tristate "ADS 7846/7843 based touchscreens" 15 + tristate "ADS7846/TSC2046 and ADS7843 based touchscreens" 16 16 depends on SPI_MASTER 17 17 depends on HWMON = n || HWMON 18 18 help 19 19 Say Y here if you have a touchscreen interface using the 20 - ADS7846 or ADS7843 controller, and your board-specific setup 21 - code includes that in its table of SPI devices. 20 + ADS7846/TSC2046 or ADS7843 controller, and your board-specific 21 + setup code includes that in its table of SPI devices. 22 22 23 23 If HWMON is selected, and the driver is told the reference voltage 24 24 on your board, you will also get hwmon interfaces for the voltage 25 - (and on ads7846, temperature) sensors of this chip. 25 + (and on ads7846/tsc2046, temperature) sensors of this chip. 26 26 27 27 If unsure, say N (but it's safe to say "Y"). 28 28
+2 -1
drivers/input/touchscreen/ads7846.c
··· 39 39 /* 40 40 * This code has been heavily tested on a Nokia 770, and lightly 41 41 * tested on other ads7846 devices (OSK/Mistral, Lubbock). 42 + * TSC2046 is just newer ads7846 silicon. 42 43 * Support for ads7843 tested on Atmel at91sam926x-EK. 43 44 * Support for ads7845 has only been stubbed in. 44 45 * ··· 848 847 * may not. So we stick to very-portable 8 bit words, both RX and TX. 849 848 */ 850 849 spi->bits_per_word = 8; 851 - spi->mode = SPI_MODE_1; 850 + spi->mode = SPI_MODE_0; 852 851 err = spi_setup(spi); 853 852 if (err < 0) 854 853 return err;
+2 -2
drivers/input/touchscreen/ucb1400_ts.c
··· 288 288 struct ucb1400 *ucb = _ucb; 289 289 struct task_struct *tsk = current; 290 290 int valid = 0; 291 + struct sched_param param = { .sched_priority = 1 }; 291 292 292 - tsk->policy = SCHED_FIFO; 293 - tsk->rt_priority = 1; 293 + sched_setscheduler(tsk, SCHED_FIFO, &param); 294 294 295 295 while (!kthread_should_stop()) { 296 296 unsigned int x, y, p;
+8 -8
drivers/macintosh/adbhid.c
··· 628 628 */ 629 629 static int adbhid_kbd_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) 630 630 { 631 - struct adbhid *adbhid = dev->private; 631 + struct adbhid *adbhid = input_get_drvdata(dev); 632 632 unsigned char leds; 633 633 634 634 switch (type) { 635 635 case EV_LED: 636 - leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) 637 - | (test_bit(LED_NUML, dev->led) ? 1 : 0) 638 - | (test_bit(LED_CAPSL, dev->led) ? 2 : 0); 639 - real_leds(leds, adbhid->id); 640 - return 0; 636 + leds = (test_bit(LED_SCROLLL, dev->led) ? 4 : 0) | 637 + (test_bit(LED_NUML, dev->led) ? 1 : 0) | 638 + (test_bit(LED_CAPSL, dev->led) ? 2 : 0); 639 + real_leds(leds, adbhid->id); 640 + return 0; 641 641 } 642 642 643 643 return -1; ··· 649 649 switch (code) { 650 650 case ADB_MSG_PRE_RESET: 651 651 case ADB_MSG_POWERDOWN: 652 - /* Stop the repeat timer. Autopoll is already off at this point */ 652 + /* Stop the repeat timer. Autopoll is already off at this point */ 653 653 { 654 654 int i; 655 655 for (i = 1; i < 16; i++) { ··· 699 699 hid->current_handler_id = current_handler_id; 700 700 hid->mouse_kind = mouse_kind; 701 701 hid->flags = 0; 702 - input_dev->private = hid; 702 + input_set_drvdata(input_dev, hid); 703 703 input_dev->name = hid->name; 704 704 input_dev->phys = hid->phys; 705 705 input_dev->id.bustype = BUS_ADB;
+1 -10
drivers/mfd/ucb1x00-ts.c
··· 207 207 struct ucb1x00_ts *ts = _ts; 208 208 struct task_struct *tsk = current; 209 209 DECLARE_WAITQUEUE(wait, tsk); 210 - int valid; 211 - 212 - /* 213 - * We could run as a real-time thread. However, thus far 214 - * this doesn't seem to be necessary. 215 - */ 216 - // tsk->policy = SCHED_FIFO; 217 - // tsk->rt_priority = 1; 218 - 219 - valid = 0; 210 + int valid = 0; 220 211 221 212 add_wait_queue(&ts->irq_wait, &wait); 222 213 while (!kthread_should_stop()) {