diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-08-28 01:00:20 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-08-28 01:00:20 -0400 |
commit | 4b61bb575b1fb42ab1df228ae7812e5135f656da (patch) | |
tree | 03456466e6f678456ea462a7da4b352d1aa03aa3 /drivers/input | |
parent | 805423e84e900e56c834aadee61a020b0d5092c3 (diff) | |
parent | 326ba5010a5429a5a528b268b36a5900d4ab0eba (diff) |
Merge commit 'v2.6.31-rc8' into next
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/joydev.c | 68 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-main.c | 1 | ||||
-rw-r--r-- | drivers/input/joystick/iforce/iforce-usb.c | 1 | ||||
-rw-r--r-- | drivers/input/keyboard/matrix_keypad.c | 18 | ||||
-rw-r--r-- | drivers/input/misc/wistron_btns.c | 16 | ||||
-rw-r--r-- | drivers/input/serio/hp_sdc_mlc.c | 2 | ||||
-rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 8 | ||||
-rw-r--r-- | drivers/input/tablet/wacom_sys.c | 43 | ||||
-rw-r--r-- | drivers/input/touchscreen/ucb1400_ts.c | 17 |
9 files changed, 119 insertions, 55 deletions
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 4cfd084fa897..9a1d55b74d7a 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
@@ -456,8 +456,11 @@ static int joydev_ioctl_common(struct joydev *joydev, | |||
456 | unsigned int cmd, void __user *argp) | 456 | unsigned int cmd, void __user *argp) |
457 | { | 457 | { |
458 | struct input_dev *dev = joydev->handle.dev; | 458 | struct input_dev *dev = joydev->handle.dev; |
459 | size_t len; | ||
459 | int i, j; | 460 | int i, j; |
461 | const char *name; | ||
460 | 462 | ||
463 | /* Process fixed-sized commands. */ | ||
461 | switch (cmd) { | 464 | switch (cmd) { |
462 | 465 | ||
463 | case JS_SET_CAL: | 466 | case JS_SET_CAL: |
@@ -499,9 +502,22 @@ static int joydev_ioctl_common(struct joydev *joydev, | |||
499 | return copy_to_user(argp, joydev->corr, | 502 | return copy_to_user(argp, joydev->corr, |
500 | sizeof(joydev->corr[0]) * joydev->nabs) ? -EFAULT : 0; | 503 | sizeof(joydev->corr[0]) * joydev->nabs) ? -EFAULT : 0; |
501 | 504 | ||
502 | case JSIOCSAXMAP: | 505 | } |
503 | if (copy_from_user(joydev->abspam, argp, | 506 | |
504 | sizeof(__u8) * (ABS_MAX + 1))) | 507 | /* |
508 | * Process variable-sized commands (the axis and button map commands | ||
509 | * are considered variable-sized to decouple them from the values of | ||
510 | * ABS_MAX and KEY_MAX). | ||
511 | */ | ||
512 | switch (cmd & ~IOCSIZE_MASK) { | ||
513 | |||
514 | case (JSIOCSAXMAP & ~IOCSIZE_MASK): | ||
515 | len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->abspam)); | ||
516 | /* | ||
517 | * FIXME: we should not copy into our axis map before | ||
518 | * validating the data. | ||
519 | */ | ||
520 | if (copy_from_user(joydev->abspam, argp, len)) | ||
505 | return -EFAULT; | 521 | return -EFAULT; |
506 | 522 | ||
507 | for (i = 0; i < joydev->nabs; i++) { | 523 | for (i = 0; i < joydev->nabs; i++) { |
@@ -511,13 +527,17 @@ static int joydev_ioctl_common(struct joydev *joydev, | |||
511 | } | 527 | } |
512 | return 0; | 528 | return 0; |
513 | 529 | ||
514 | case JSIOCGAXMAP: | 530 | case (JSIOCGAXMAP & ~IOCSIZE_MASK): |
515 | return copy_to_user(argp, joydev->abspam, | 531 | len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->abspam)); |
516 | sizeof(__u8) * (ABS_MAX + 1)) ? -EFAULT : 0; | 532 | return copy_to_user(argp, joydev->abspam, len) ? -EFAULT : 0; |
517 | 533 | ||
518 | case JSIOCSBTNMAP: | 534 | case (JSIOCSBTNMAP & ~IOCSIZE_MASK): |
519 | if (copy_from_user(joydev->keypam, argp, | 535 | len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->keypam)); |
520 | sizeof(__u16) * (KEY_MAX - BTN_MISC + 1))) | 536 | /* |
537 | * FIXME: we should not copy into our keymap before | ||
538 | * validating the data. | ||
539 | */ | ||
540 | if (copy_from_user(joydev->keypam, argp, len)) | ||
521 | return -EFAULT; | 541 | return -EFAULT; |
522 | 542 | ||
523 | for (i = 0; i < joydev->nkey; i++) { | 543 | for (i = 0; i < joydev->nkey; i++) { |
@@ -529,25 +549,19 @@ static int joydev_ioctl_common(struct joydev *joydev, | |||
529 | 549 | ||
530 | return 0; | 550 | return 0; |
531 | 551 | ||
532 | case JSIOCGBTNMAP: | 552 | case (JSIOCGBTNMAP & ~IOCSIZE_MASK): |
533 | return copy_to_user(argp, joydev->keypam, | 553 | len = min_t(size_t, _IOC_SIZE(cmd), sizeof(joydev->keypam)); |
534 | sizeof(__u16) * (KEY_MAX - BTN_MISC + 1)) ? -EFAULT : 0; | 554 | return copy_to_user(argp, joydev->keypam, len) ? -EFAULT : 0; |
535 | 555 | ||
536 | default: | 556 | case JSIOCGNAME(0): |
537 | if ((cmd & ~IOCSIZE_MASK) == JSIOCGNAME(0)) { | 557 | name = dev->name; |
538 | int len; | 558 | if (!name) |
539 | const char *name = dev->name; | 559 | return 0; |
540 | 560 | ||
541 | if (!name) | 561 | len = min_t(size_t, _IOC_SIZE(cmd), strlen(name) + 1); |
542 | return 0; | 562 | return copy_to_user(argp, name, len) ? -EFAULT : len; |
543 | len = strlen(name) + 1; | ||
544 | if (len > _IOC_SIZE(cmd)) | ||
545 | len = _IOC_SIZE(cmd); | ||
546 | if (copy_to_user(argp, name, len)) | ||
547 | return -EFAULT; | ||
548 | return len; | ||
549 | } | ||
550 | } | 563 | } |
564 | |||
551 | return -EINVAL; | 565 | return -EINVAL; |
552 | } | 566 | } |
553 | 567 | ||
diff --git a/drivers/input/joystick/iforce/iforce-main.c b/drivers/input/joystick/iforce/iforce-main.c index baabf8302645..f6c688cae334 100644 --- a/drivers/input/joystick/iforce/iforce-main.c +++ b/drivers/input/joystick/iforce/iforce-main.c | |||
@@ -74,6 +74,7 @@ static struct iforce_device iforce_device[] = { | |||
74 | { 0x05ef, 0x8884, "AVB Mag Turbo Force", btn_avb_wheel, abs_wheel, ff_iforce }, | 74 | { 0x05ef, 0x8884, "AVB Mag Turbo Force", btn_avb_wheel, abs_wheel, ff_iforce }, |
75 | { 0x05ef, 0x8888, "AVB Top Shot Force Feedback Racing Wheel", btn_avb_tw, abs_wheel, ff_iforce }, //? | 75 | { 0x05ef, 0x8888, "AVB Top Shot Force Feedback Racing Wheel", btn_avb_tw, abs_wheel, ff_iforce }, //? |
76 | { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //? | 76 | { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //? |
77 | { 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, | ||
77 | { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //? | 78 | { 0x06f8, 0x0001, "Guillemot Race Leader Force Feedback", btn_wheel, abs_wheel, ff_iforce }, //? |
78 | { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? | 79 | { 0x06f8, 0x0004, "Guillemot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? |
79 | { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //? | 80 | { 0x06f8, 0x0004, "Gullemot Jet Leader 3D", btn_joystick, abs_joystick, ff_iforce }, //? |
diff --git a/drivers/input/joystick/iforce/iforce-usb.c b/drivers/input/joystick/iforce/iforce-usb.c index f83185aeb511..9f289d8f52c6 100644 --- a/drivers/input/joystick/iforce/iforce-usb.c +++ b/drivers/input/joystick/iforce/iforce-usb.c | |||
@@ -223,6 +223,7 @@ static struct usb_device_id iforce_usb_ids [] = { | |||
223 | { USB_DEVICE(0x05ef, 0x8884) }, /* AVB Mag Turbo Force */ | 223 | { USB_DEVICE(0x05ef, 0x8884) }, /* AVB Mag Turbo Force */ |
224 | { USB_DEVICE(0x05ef, 0x8888) }, /* AVB Top Shot FFB Racing Wheel */ | 224 | { USB_DEVICE(0x05ef, 0x8888) }, /* AVB Top Shot FFB Racing Wheel */ |
225 | { USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */ | 225 | { USB_DEVICE(0x061c, 0xc0a4) }, /* ACT LABS Force RS */ |
226 | { USB_DEVICE(0x061c, 0xc084) }, /* ACT LABS Force RS */ | ||
226 | { USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */ | 227 | { USB_DEVICE(0x06f8, 0x0001) }, /* Guillemot Race Leader Force Feedback */ |
227 | { USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */ | 228 | { USB_DEVICE(0x06f8, 0x0004) }, /* Guillemot Force Feedback Racing Wheel */ |
228 | { USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */ | 229 | { USB_DEVICE(0x06f8, 0xa302) }, /* Guillemot Jet Leader 3D */ |
diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index e9b2e7cb05be..541b981ff075 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c | |||
@@ -27,6 +27,7 @@ struct matrix_keypad { | |||
27 | const struct matrix_keypad_platform_data *pdata; | 27 | const struct matrix_keypad_platform_data *pdata; |
28 | struct input_dev *input_dev; | 28 | struct input_dev *input_dev; |
29 | unsigned short *keycodes; | 29 | unsigned short *keycodes; |
30 | unsigned int row_shift; | ||
30 | 31 | ||
31 | uint32_t last_key_state[MATRIX_MAX_COLS]; | 32 | uint32_t last_key_state[MATRIX_MAX_COLS]; |
32 | struct delayed_work work; | 33 | struct delayed_work work; |
@@ -136,7 +137,7 @@ static void matrix_keypad_scan(struct work_struct *work) | |||
136 | if ((bits_changed & (1 << row)) == 0) | 137 | if ((bits_changed & (1 << row)) == 0) |
137 | continue; | 138 | continue; |
138 | 139 | ||
139 | code = (row << 4) + col; | 140 | code = MATRIX_SCAN_CODE(row, col, keypad->row_shift); |
140 | input_event(input_dev, EV_MSC, MSC_SCAN, code); | 141 | input_event(input_dev, EV_MSC, MSC_SCAN, code); |
141 | input_report_key(input_dev, | 142 | input_report_key(input_dev, |
142 | keypad->keycodes[code], | 143 | keypad->keycodes[code], |
@@ -317,6 +318,7 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) | |||
317 | struct matrix_keypad *keypad; | 318 | struct matrix_keypad *keypad; |
318 | struct input_dev *input_dev; | 319 | struct input_dev *input_dev; |
319 | unsigned short *keycodes; | 320 | unsigned short *keycodes; |
321 | unsigned int row_shift; | ||
320 | int i; | 322 | int i; |
321 | int err; | 323 | int err; |
322 | 324 | ||
@@ -332,14 +334,11 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) | |||
332 | return -EINVAL; | 334 | return -EINVAL; |
333 | } | 335 | } |
334 | 336 | ||
335 | if (!keymap_data->max_keymap_size) { | 337 | row_shift = get_count_order(pdata->num_col_gpios); |
336 | dev_err(&pdev->dev, "invalid keymap data supplied\n"); | ||
337 | return -EINVAL; | ||
338 | } | ||
339 | 338 | ||
340 | keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); | 339 | keypad = kzalloc(sizeof(struct matrix_keypad), GFP_KERNEL); |
341 | keycodes = kzalloc(keymap_data->max_keymap_size * | 340 | keycodes = kzalloc((pdata->num_row_gpios << row_shift) * |
342 | sizeof(keypad->keycodes), | 341 | sizeof(*keycodes), |
343 | GFP_KERNEL); | 342 | GFP_KERNEL); |
344 | input_dev = input_allocate_device(); | 343 | input_dev = input_allocate_device(); |
345 | if (!keypad || !keycodes || !input_dev) { | 344 | if (!keypad || !keycodes || !input_dev) { |
@@ -350,6 +349,7 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) | |||
350 | keypad->input_dev = input_dev; | 349 | keypad->input_dev = input_dev; |
351 | keypad->pdata = pdata; | 350 | keypad->pdata = pdata; |
352 | keypad->keycodes = keycodes; | 351 | keypad->keycodes = keycodes; |
352 | keypad->row_shift = row_shift; | ||
353 | keypad->stopped = true; | 353 | keypad->stopped = true; |
354 | INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); | 354 | INIT_DELAYED_WORK(&keypad->work, matrix_keypad_scan); |
355 | spin_lock_init(&keypad->lock); | 355 | spin_lock_init(&keypad->lock); |
@@ -363,7 +363,7 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) | |||
363 | 363 | ||
364 | input_dev->keycode = keycodes; | 364 | input_dev->keycode = keycodes; |
365 | input_dev->keycodesize = sizeof(*keycodes); | 365 | input_dev->keycodesize = sizeof(*keycodes); |
366 | input_dev->keycodemax = keymap_data->max_keymap_size; | 366 | input_dev->keycodemax = pdata->num_row_gpios << keypad->row_shift; |
367 | 367 | ||
368 | for (i = 0; i < keymap_data->keymap_size; i++) { | 368 | for (i = 0; i < keymap_data->keymap_size; i++) { |
369 | unsigned int key = keymap_data->keymap[i]; | 369 | unsigned int key = keymap_data->keymap[i]; |
@@ -371,7 +371,7 @@ static int __devinit matrix_keypad_probe(struct platform_device *pdev) | |||
371 | unsigned int col = KEY_COL(key); | 371 | unsigned int col = KEY_COL(key); |
372 | unsigned short code = KEY_VAL(key); | 372 | unsigned short code = KEY_VAL(key); |
373 | 373 | ||
374 | keycodes[(row << 4) + col] = code; | 374 | keycodes[MATRIX_SCAN_CODE(row, col, row_shift)] = code; |
375 | __set_bit(code, input_dev->keybit); | 375 | __set_bit(code, input_dev->keybit); |
376 | } | 376 | } |
377 | __clear_bit(KEY_RESERVED, input_dev->keybit); | 377 | __clear_bit(KEY_RESERVED, input_dev->keybit); |
diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c index bc3116bebfe9..ebb08cfe2731 100644 --- a/drivers/input/misc/wistron_btns.c +++ b/drivers/input/misc/wistron_btns.c | |||
@@ -611,6 +611,20 @@ static struct key_entry keymap_wistron_generic[] __initdata = { | |||
611 | { KE_END, 0 } | 611 | { KE_END, 0 } |
612 | }; | 612 | }; |
613 | 613 | ||
614 | static struct key_entry keymap_prestigio[] __initdata = { | ||
615 | { KE_KEY, 0x11, {KEY_PROG1} }, | ||
616 | { KE_KEY, 0x12, {KEY_PROG2} }, | ||
617 | { KE_WIFI, 0x30 }, | ||
618 | { KE_KEY, 0x22, {KEY_REWIND} }, | ||
619 | { KE_KEY, 0x23, {KEY_FORWARD} }, | ||
620 | { KE_KEY, 0x24, {KEY_PLAYPAUSE} }, | ||
621 | { KE_KEY, 0x25, {KEY_STOPCD} }, | ||
622 | { KE_KEY, 0x31, {KEY_MAIL} }, | ||
623 | { KE_KEY, 0x36, {KEY_WWW} }, | ||
624 | { KE_END, 0 } | ||
625 | }; | ||
626 | |||
627 | |||
614 | /* | 628 | /* |
615 | * If your machine is not here (which is currently rather likely), please send | 629 | * If your machine is not here (which is currently rather likely), please send |
616 | * a list of buttons and their key codes (reported when loading this module | 630 | * a list of buttons and their key codes (reported when loading this module |
@@ -971,6 +985,8 @@ static int __init select_keymap(void) | |||
971 | if (keymap_name != NULL) { | 985 | if (keymap_name != NULL) { |
972 | if (strcmp (keymap_name, "1557/MS2141") == 0) | 986 | if (strcmp (keymap_name, "1557/MS2141") == 0) |
973 | keymap = keymap_wistron_ms2141; | 987 | keymap = keymap_wistron_ms2141; |
988 | else if (strcmp (keymap_name, "prestigio") == 0) | ||
989 | keymap = keymap_prestigio; | ||
974 | else if (strcmp (keymap_name, "generic") == 0) | 990 | else if (strcmp (keymap_name, "generic") == 0) |
975 | keymap = keymap_wistron_generic; | 991 | keymap = keymap_wistron_generic; |
976 | else { | 992 | else { |
diff --git a/drivers/input/serio/hp_sdc_mlc.c b/drivers/input/serio/hp_sdc_mlc.c index b587e2d576ac..820e51673b26 100644 --- a/drivers/input/serio/hp_sdc_mlc.c +++ b/drivers/input/serio/hp_sdc_mlc.c | |||
@@ -296,7 +296,7 @@ static void hp_sdc_mlc_out(hil_mlc *mlc) | |||
296 | priv->tseq[3] = 0; | 296 | priv->tseq[3] = 0; |
297 | if (mlc->opacket & HIL_CTRL_APE) { | 297 | if (mlc->opacket & HIL_CTRL_APE) { |
298 | priv->tseq[3] |= HP_SDC_LPC_APE_IPF; | 298 | priv->tseq[3] |= HP_SDC_LPC_APE_IPF; |
299 | down_trylock(&mlc->csem); | 299 | BUG_ON(down_trylock(&mlc->csem)); |
300 | } | 300 | } |
301 | enqueue: | 301 | enqueue: |
302 | hp_sdc_enqueue_transaction(&priv->trans); | 302 | hp_sdc_enqueue_transaction(&priv->trans); |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 924e8ed7f2cf..ae04d8a494e5 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -78,6 +78,14 @@ static struct dmi_system_id __initdata i8042_dmi_noloop_table[] = { | |||
78 | }, | 78 | }, |
79 | }, | 79 | }, |
80 | { | 80 | { |
81 | .ident = "ASUS G1S", | ||
82 | .matches = { | ||
83 | DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK Computer Inc."), | ||
84 | DMI_MATCH(DMI_BOARD_NAME, "G1S"), | ||
85 | DMI_MATCH(DMI_BOARD_VERSION, "1.0"), | ||
86 | }, | ||
87 | }, | ||
88 | { | ||
81 | /* AUX LOOP command does not raise AUX IRQ */ | 89 | /* AUX LOOP command does not raise AUX IRQ */ |
82 | .ident = "ASUS P65UP5", | 90 | .ident = "ASUS P65UP5", |
83 | .matches = { | 91 | .matches = { |
diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c index a9d5031b855e..ea30c983a33e 100644 --- a/drivers/input/tablet/wacom_sys.c +++ b/drivers/input/tablet/wacom_sys.c | |||
@@ -388,6 +388,32 @@ static int wacom_parse_hid(struct usb_interface *intf, struct hid_descriptor *hi | |||
388 | return result; | 388 | return result; |
389 | } | 389 | } |
390 | 390 | ||
391 | static int wacom_query_tablet_data(struct usb_interface *intf) | ||
392 | { | ||
393 | unsigned char *rep_data; | ||
394 | int limit = 0; | ||
395 | int error; | ||
396 | |||
397 | rep_data = kmalloc(2, GFP_KERNEL); | ||
398 | if (!rep_data) | ||
399 | return -ENOMEM; | ||
400 | |||
401 | do { | ||
402 | rep_data[0] = 2; | ||
403 | rep_data[1] = 2; | ||
404 | error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, | ||
405 | 2, rep_data, 2); | ||
406 | if (error >= 0) | ||
407 | error = usb_get_report(intf, | ||
408 | WAC_HID_FEATURE_REPORT, 2, | ||
409 | rep_data, 2); | ||
410 | } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); | ||
411 | |||
412 | kfree(rep_data); | ||
413 | |||
414 | return error < 0 ? error : 0; | ||
415 | } | ||
416 | |||
391 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) | 417 | static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *id) |
392 | { | 418 | { |
393 | struct usb_device *dev = interface_to_usbdev(intf); | 419 | struct usb_device *dev = interface_to_usbdev(intf); |
@@ -398,7 +424,6 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
398 | struct wacom_features *features; | 424 | struct wacom_features *features; |
399 | struct input_dev *input_dev; | 425 | struct input_dev *input_dev; |
400 | int error = -ENOMEM; | 426 | int error = -ENOMEM; |
401 | char rep_data[2], limit = 0; | ||
402 | struct hid_descriptor *hid_desc; | 427 | struct hid_descriptor *hid_desc; |
403 | 428 | ||
404 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); | 429 | wacom = kzalloc(sizeof(struct wacom), GFP_KERNEL); |
@@ -489,20 +514,10 @@ static int wacom_probe(struct usb_interface *intf, const struct usb_device_id *i | |||
489 | 514 | ||
490 | /* | 515 | /* |
491 | * Ask the tablet to report tablet data if it is not a Tablet PC. | 516 | * Ask the tablet to report tablet data if it is not a Tablet PC. |
492 | * Repeat until it succeeds | 517 | * Note that if query fails it is not a hard failure. |
493 | */ | 518 | */ |
494 | if (wacom_wac->features->type != TABLETPC) { | 519 | if (wacom_wac->features->type != TABLETPC) |
495 | do { | 520 | wacom_query_tablet_data(intf); |
496 | rep_data[0] = 2; | ||
497 | rep_data[1] = 2; | ||
498 | error = usb_set_report(intf, WAC_HID_FEATURE_REPORT, | ||
499 | 2, rep_data, 2); | ||
500 | if (error >= 0) | ||
501 | error = usb_get_report(intf, | ||
502 | WAC_HID_FEATURE_REPORT, 2, | ||
503 | rep_data, 2); | ||
504 | } while ((error < 0 || rep_data[1] != 2) && limit++ < 5); | ||
505 | } | ||
506 | 521 | ||
507 | usb_set_intfdata(intf, wacom); | 522 | usb_set_intfdata(intf, wacom); |
508 | return 0; | 523 | return 0; |
diff --git a/drivers/input/touchscreen/ucb1400_ts.c b/drivers/input/touchscreen/ucb1400_ts.c index e85483578bd4..095f84b1f56e 100644 --- a/drivers/input/touchscreen/ucb1400_ts.c +++ b/drivers/input/touchscreen/ucb1400_ts.c | |||
@@ -171,11 +171,11 @@ static void ucb1400_handle_pending_irq(struct ucb1400_ts *ucb) | |||
171 | ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, isr); | 171 | ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, isr); |
172 | ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, 0); | 172 | ucb1400_reg_write(ucb->ac97, UCB_IE_CLEAR, 0); |
173 | 173 | ||
174 | if (isr & UCB_IE_TSPX) { | 174 | if (isr & UCB_IE_TSPX) |
175 | ucb1400_ts_irq_disable(ucb->ac97); | 175 | ucb1400_ts_irq_disable(ucb->ac97); |
176 | enable_irq(ucb->irq); | 176 | else |
177 | } else | 177 | dev_dbg(&ucb->ts_idev->dev, "ucb1400: unexpected IE_STATUS = %#x\n", isr); |
178 | printk(KERN_ERR "ucb1400: unexpected IE_STATUS = %#x\n", isr); | 178 | enable_irq(ucb->irq); |
179 | } | 179 | } |
180 | 180 | ||
181 | static int ucb1400_ts_thread(void *_ucb) | 181 | static int ucb1400_ts_thread(void *_ucb) |
@@ -346,6 +346,7 @@ static int ucb1400_ts_detect_irq(struct ucb1400_ts *ucb) | |||
346 | static int ucb1400_ts_probe(struct platform_device *dev) | 346 | static int ucb1400_ts_probe(struct platform_device *dev) |
347 | { | 347 | { |
348 | int error, x_res, y_res; | 348 | int error, x_res, y_res; |
349 | u16 fcsr; | ||
349 | struct ucb1400_ts *ucb = dev->dev.platform_data; | 350 | struct ucb1400_ts *ucb = dev->dev.platform_data; |
350 | 351 | ||
351 | ucb->ts_idev = input_allocate_device(); | 352 | ucb->ts_idev = input_allocate_device(); |
@@ -383,6 +384,14 @@ static int ucb1400_ts_probe(struct platform_device *dev) | |||
383 | ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); | 384 | ucb->ts_idev->evbit[0] = BIT_MASK(EV_ABS) | BIT_MASK(EV_KEY); |
384 | ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); | 385 | ucb->ts_idev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); |
385 | 386 | ||
387 | /* | ||
388 | * Enable ADC filter to prevent horrible jitter on Colibri. | ||
389 | * This also further reduces jitter on boards where ADCSYNC | ||
390 | * pin is connected. | ||
391 | */ | ||
392 | fcsr = ucb1400_reg_read(ucb->ac97, UCB_FCSR); | ||
393 | ucb1400_reg_write(ucb->ac97, UCB_FCSR, fcsr | UCB_FCSR_AVE); | ||
394 | |||
386 | ucb1400_adc_enable(ucb->ac97); | 395 | ucb1400_adc_enable(ucb->ac97); |
387 | x_res = ucb1400_ts_read_xres(ucb); | 396 | x_res = ucb1400_ts_read_xres(ucb); |
388 | y_res = ucb1400_ts_read_yres(ucb); | 397 | y_res = ucb1400_ts_read_yres(ucb); |