diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-04-16 11:51:52 -0400 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2009-04-16 11:51:52 -0400 |
commit | 0c387ec88abf4f1ddfe8c3be10ea981bc447b406 (patch) | |
tree | 7510842a16aa54e3fec96aed2b3126109cda8d85 /drivers/input | |
parent | ba28f22e7cf16cb310bb491cbb3f7d0d5d1f5c5d (diff) | |
parent | 3f3e7c6e139f704e2f48ea3b45ff7724a8d46456 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/gameport/gameport.c | 14 | ||||
-rw-r--r-- | drivers/input/input.c | 1 | ||||
-rw-r--r-- | drivers/input/keyboard/atkbd.c | 20 | ||||
-rw-r--r-- | drivers/input/keyboard/bf54x-keys.c | 2 | ||||
-rw-r--r-- | drivers/input/misc/Kconfig | 2 | ||||
-rw-r--r-- | drivers/input/mouse/pc110pad.c | 1 | ||||
-rw-r--r-- | drivers/input/serio/i8042-x86ia64io.h | 28 | ||||
-rw-r--r-- | drivers/input/serio/i8042.c | 37 | ||||
-rw-r--r-- | drivers/input/touchscreen/ad7877.c | 4 | ||||
-rw-r--r-- | drivers/input/touchscreen/ad7879.c | 3 | ||||
-rw-r--r-- | drivers/input/touchscreen/ads7846.c | 12 | ||||
-rw-r--r-- | drivers/input/touchscreen/da9034-ts.c | 29 | ||||
-rw-r--r-- | drivers/input/touchscreen/mainstone-wm97xx.c | 7 | ||||
-rw-r--r-- | drivers/input/touchscreen/wm97xx-core.c | 3 |
14 files changed, 120 insertions, 43 deletions
diff --git a/drivers/input/gameport/gameport.c b/drivers/input/gameport/gameport.c index ebf4be5b7c4e..2d175b5928ff 100644 --- a/drivers/input/gameport/gameport.c +++ b/drivers/input/gameport/gameport.c | |||
@@ -50,9 +50,8 @@ static LIST_HEAD(gameport_list); | |||
50 | 50 | ||
51 | static struct bus_type gameport_bus; | 51 | static struct bus_type gameport_bus; |
52 | 52 | ||
53 | static void gameport_add_driver(struct gameport_driver *drv); | ||
54 | static void gameport_add_port(struct gameport *gameport); | 53 | static void gameport_add_port(struct gameport *gameport); |
55 | static void gameport_destroy_port(struct gameport *gameport); | 54 | static void gameport_attach_driver(struct gameport_driver *drv); |
56 | static void gameport_reconnect_port(struct gameport *gameport); | 55 | static void gameport_reconnect_port(struct gameport *gameport); |
57 | static void gameport_disconnect_port(struct gameport *gameport); | 56 | static void gameport_disconnect_port(struct gameport *gameport); |
58 | 57 | ||
@@ -230,7 +229,6 @@ static void gameport_find_driver(struct gameport *gameport) | |||
230 | 229 | ||
231 | enum gameport_event_type { | 230 | enum gameport_event_type { |
232 | GAMEPORT_REGISTER_PORT, | 231 | GAMEPORT_REGISTER_PORT, |
233 | GAMEPORT_REGISTER_DRIVER, | ||
234 | GAMEPORT_ATTACH_DRIVER, | 232 | GAMEPORT_ATTACH_DRIVER, |
235 | }; | 233 | }; |
236 | 234 | ||
@@ -374,8 +372,8 @@ static void gameport_handle_event(void) | |||
374 | gameport_add_port(event->object); | 372 | gameport_add_port(event->object); |
375 | break; | 373 | break; |
376 | 374 | ||
377 | case GAMEPORT_REGISTER_DRIVER: | 375 | case GAMEPORT_ATTACH_DRIVER: |
378 | gameport_add_driver(event->object); | 376 | gameport_attach_driver(event->object); |
379 | break; | 377 | break; |
380 | 378 | ||
381 | default: | 379 | default: |
@@ -706,14 +704,14 @@ static int gameport_driver_remove(struct device *dev) | |||
706 | return 0; | 704 | return 0; |
707 | } | 705 | } |
708 | 706 | ||
709 | static void gameport_add_driver(struct gameport_driver *drv) | 707 | static void gameport_attach_driver(struct gameport_driver *drv) |
710 | { | 708 | { |
711 | int error; | 709 | int error; |
712 | 710 | ||
713 | error = driver_register(&drv->driver); | 711 | error = driver_attach(&drv->driver); |
714 | if (error) | 712 | if (error) |
715 | printk(KERN_ERR | 713 | printk(KERN_ERR |
716 | "gameport: driver_register() failed for %s, error: %d\n", | 714 | "gameport: driver_attach() failed for %s, error: %d\n", |
717 | drv->driver.name, error); | 715 | drv->driver.name, error); |
718 | } | 716 | } |
719 | 717 | ||
diff --git a/drivers/input/input.c b/drivers/input/input.c index d44065d2e662..935a1835de2d 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c | |||
@@ -1549,7 +1549,6 @@ int input_register_handle(struct input_handle *handle) | |||
1549 | return error; | 1549 | return error; |
1550 | list_add_tail_rcu(&handle->d_node, &dev->h_list); | 1550 | list_add_tail_rcu(&handle->d_node, &dev->h_list); |
1551 | mutex_unlock(&dev->mutex); | 1551 | mutex_unlock(&dev->mutex); |
1552 | synchronize_rcu(); | ||
1553 | 1552 | ||
1554 | /* | 1553 | /* |
1555 | * Since we are supposed to be called from ->connect() | 1554 | * Since we are supposed to be called from ->connect() |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index f999dc60c3b8..444dec07e5d8 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -880,7 +880,7 @@ static unsigned int atkbd_hp_zv6100_forced_release_keys[] = { | |||
880 | }; | 880 | }; |
881 | 881 | ||
882 | /* | 882 | /* |
883 | * Samsung NC10 with Fn+F? key release not working | 883 | * Samsung NC10,NC20 with Fn+F? key release not working |
884 | */ | 884 | */ |
885 | static unsigned int atkbd_samsung_forced_release_keys[] = { | 885 | static unsigned int atkbd_samsung_forced_release_keys[] = { |
886 | 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9, -1U | 886 | 0x82, 0x83, 0x84, 0x86, 0x88, 0x89, 0xb3, 0xf7, 0xf9, -1U |
@@ -1534,6 +1534,24 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1534 | .driver_data = atkbd_samsung_forced_release_keys, | 1534 | .driver_data = atkbd_samsung_forced_release_keys, |
1535 | }, | 1535 | }, |
1536 | { | 1536 | { |
1537 | .ident = "Samsung NC20", | ||
1538 | .matches = { | ||
1539 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
1540 | DMI_MATCH(DMI_PRODUCT_NAME, "NC20"), | ||
1541 | }, | ||
1542 | .callback = atkbd_setup_forced_release, | ||
1543 | .driver_data = atkbd_samsung_forced_release_keys, | ||
1544 | }, | ||
1545 | { | ||
1546 | .ident = "Samsung SQ45S70S", | ||
1547 | .matches = { | ||
1548 | DMI_MATCH(DMI_SYS_VENDOR, "SAMSUNG ELECTRONICS CO., LTD."), | ||
1549 | DMI_MATCH(DMI_PRODUCT_NAME, "SQ45S70S"), | ||
1550 | }, | ||
1551 | .callback = atkbd_setup_forced_release, | ||
1552 | .driver_data = atkbd_samsung_forced_release_keys, | ||
1553 | }, | ||
1554 | { | ||
1537 | .ident = "Fujitsu Amilo PA 1510", | 1555 | .ident = "Fujitsu Amilo PA 1510", |
1538 | .matches = { | 1556 | .matches = { |
1539 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | 1557 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), |
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index e94b7d735aca..d427f322e207 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c | |||
@@ -252,7 +252,7 @@ static int __devinit bfin_kpad_probe(struct platform_device *pdev) | |||
252 | } | 252 | } |
253 | 253 | ||
254 | error = request_irq(bf54x_kpad->irq, bfin_kpad_isr, | 254 | error = request_irq(bf54x_kpad->irq, bfin_kpad_isr, |
255 | IRQF_SAMPLE_RANDOM, DRV_NAME, pdev); | 255 | 0, DRV_NAME, pdev); |
256 | if (error) { | 256 | if (error) { |
257 | printk(KERN_ERR DRV_NAME | 257 | printk(KERN_ERR DRV_NAME |
258 | ": unable to claim irq %d; error %d\n", | 258 | ": unable to claim irq %d; error %d\n", |
diff --git a/drivers/input/misc/Kconfig b/drivers/input/misc/Kconfig index 203abac1e23e..5c0a631d1455 100644 --- a/drivers/input/misc/Kconfig +++ b/drivers/input/misc/Kconfig | |||
@@ -214,7 +214,7 @@ config INPUT_SGI_BTNS | |||
214 | 214 | ||
215 | config HP_SDC_RTC | 215 | config HP_SDC_RTC |
216 | tristate "HP SDC Real Time Clock" | 216 | tristate "HP SDC Real Time Clock" |
217 | depends on GSC || HP300 | 217 | depends on (GSC || HP300) && SERIO |
218 | select HP_SDC | 218 | select HP_SDC |
219 | help | 219 | help |
220 | Say Y here if you want to support the built-in real time clock | 220 | Say Y here if you want to support the built-in real time clock |
diff --git a/drivers/input/mouse/pc110pad.c b/drivers/input/mouse/pc110pad.c index f63995f854ff..3941f97cfa60 100644 --- a/drivers/input/mouse/pc110pad.c +++ b/drivers/input/mouse/pc110pad.c | |||
@@ -108,7 +108,6 @@ static int pc110pad_open(struct input_dev *dev) | |||
108 | */ | 108 | */ |
109 | static int __init pc110pad_init(void) | 109 | static int __init pc110pad_init(void) |
110 | { | 110 | { |
111 | struct pci_dev *dev; | ||
112 | int err; | 111 | int err; |
113 | 112 | ||
114 | if (!no_pci_devices()) | 113 | if (!no_pci_devices()) |
diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h index 83ed2d56b924..fb8a3cd3ffd0 100644 --- a/drivers/input/serio/i8042-x86ia64io.h +++ b/drivers/input/serio/i8042-x86ia64io.h | |||
@@ -377,6 +377,24 @@ static struct dmi_system_id __initdata i8042_dmi_nomux_table[] = { | |||
377 | { } | 377 | { } |
378 | }; | 378 | }; |
379 | 379 | ||
380 | static struct dmi_system_id __initdata i8042_dmi_reset_table[] = { | ||
381 | { | ||
382 | .ident = "MSI Wind U-100", | ||
383 | .matches = { | ||
384 | DMI_MATCH(DMI_BOARD_NAME, "U-100"), | ||
385 | DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), | ||
386 | }, | ||
387 | }, | ||
388 | { | ||
389 | .ident = "LG Electronics X110", | ||
390 | .matches = { | ||
391 | DMI_MATCH(DMI_BOARD_NAME, "X110"), | ||
392 | DMI_MATCH(DMI_BOARD_VENDOR, "LG Electronics Inc."), | ||
393 | }, | ||
394 | }, | ||
395 | { } | ||
396 | }; | ||
397 | |||
380 | #ifdef CONFIG_PNP | 398 | #ifdef CONFIG_PNP |
381 | static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = { | 399 | static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = { |
382 | { | 400 | { |
@@ -386,6 +404,13 @@ static struct dmi_system_id __initdata i8042_dmi_nopnp_table[] = { | |||
386 | DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), | 404 | DMI_MATCH(DMI_BOARD_VENDOR, "Intel Corporation"), |
387 | }, | 405 | }, |
388 | }, | 406 | }, |
407 | { | ||
408 | .ident = "MSI Wind U-100", | ||
409 | .matches = { | ||
410 | DMI_MATCH(DMI_BOARD_NAME, "U-100"), | ||
411 | DMI_MATCH(DMI_BOARD_VENDOR, "MICRO-STAR INTERNATIONAL CO., LTD"), | ||
412 | }, | ||
413 | }, | ||
389 | { } | 414 | { } |
390 | }; | 415 | }; |
391 | #endif | 416 | #endif |
@@ -698,6 +723,9 @@ static int __init i8042_platform_init(void) | |||
698 | #endif | 723 | #endif |
699 | 724 | ||
700 | #ifdef CONFIG_X86 | 725 | #ifdef CONFIG_X86 |
726 | if (dmi_check_system(i8042_dmi_reset_table)) | ||
727 | i8042_reset = 1; | ||
728 | |||
701 | if (dmi_check_system(i8042_dmi_noloop_table)) | 729 | if (dmi_check_system(i8042_dmi_noloop_table)) |
702 | i8042_noloop = 1; | 730 | i8042_noloop = 1; |
703 | 731 | ||
diff --git a/drivers/input/serio/i8042.c b/drivers/input/serio/i8042.c index 170f71ee5772..3cffb704e374 100644 --- a/drivers/input/serio/i8042.c +++ b/drivers/input/serio/i8042.c | |||
@@ -712,22 +712,43 @@ static int i8042_controller_check(void) | |||
712 | static int i8042_controller_selftest(void) | 712 | static int i8042_controller_selftest(void) |
713 | { | 713 | { |
714 | unsigned char param; | 714 | unsigned char param; |
715 | int i = 0; | ||
715 | 716 | ||
716 | if (!i8042_reset) | 717 | if (!i8042_reset) |
717 | return 0; | 718 | return 0; |
718 | 719 | ||
719 | if (i8042_command(¶m, I8042_CMD_CTL_TEST)) { | 720 | /* |
720 | printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n"); | 721 | * We try this 5 times; on some really fragile systems this does not |
721 | return -ENODEV; | 722 | * take the first time... |
722 | } | 723 | */ |
724 | do { | ||
725 | |||
726 | if (i8042_command(¶m, I8042_CMD_CTL_TEST)) { | ||
727 | printk(KERN_ERR "i8042.c: i8042 controller self test timeout.\n"); | ||
728 | return -ENODEV; | ||
729 | } | ||
730 | |||
731 | if (param == I8042_RET_CTL_TEST) | ||
732 | return 0; | ||
723 | 733 | ||
724 | if (param != I8042_RET_CTL_TEST) { | ||
725 | printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n", | 734 | printk(KERN_ERR "i8042.c: i8042 controller selftest failed. (%#x != %#x)\n", |
726 | param, I8042_RET_CTL_TEST); | 735 | param, I8042_RET_CTL_TEST); |
727 | return -EIO; | 736 | msleep(50); |
728 | } | 737 | } while (i++ < 5); |
729 | 738 | ||
739 | #ifdef CONFIG_X86 | ||
740 | /* | ||
741 | * On x86, we don't fail entire i8042 initialization if controller | ||
742 | * reset fails in hopes that keyboard port will still be functional | ||
743 | * and user will still get a working keyboard. This is especially | ||
744 | * important on netbooks. On other arches we trust hardware more. | ||
745 | */ | ||
746 | printk(KERN_INFO | ||
747 | "i8042: giving up on controller selftest, continuing anyway...\n"); | ||
730 | return 0; | 748 | return 0; |
749 | #else | ||
750 | return -EIO; | ||
751 | #endif | ||
731 | } | 752 | } |
732 | 753 | ||
733 | /* | 754 | /* |
diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index e4728a28f492..ecaeb7e8e75e 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c | |||
@@ -736,8 +736,8 @@ static int __devinit ad7877_probe(struct spi_device *spi) | |||
736 | 736 | ||
737 | /* Request AD7877 /DAV GPIO interrupt */ | 737 | /* Request AD7877 /DAV GPIO interrupt */ |
738 | 738 | ||
739 | err = request_irq(spi->irq, ad7877_irq, IRQF_TRIGGER_FALLING | | 739 | err = request_irq(spi->irq, ad7877_irq, IRQF_TRIGGER_FALLING, |
740 | IRQF_SAMPLE_RANDOM, spi->dev.driver->name, ts); | 740 | spi->dev.driver->name, ts); |
741 | if (err) { | 741 | if (err) { |
742 | dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); | 742 | dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq); |
743 | goto err_free_mem; | 743 | goto err_free_mem; |
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index ea4c61d68683..5d8a70398807 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
@@ -448,8 +448,7 @@ static int __devinit ad7879_construct(bus_device *bus, struct ad7879 *ts) | |||
448 | ad7879_setup(ts); | 448 | ad7879_setup(ts); |
449 | 449 | ||
450 | err = request_irq(bus->irq, ad7879_irq, | 450 | err = request_irq(bus->irq, ad7879_irq, |
451 | IRQF_TRIGGER_FALLING | IRQF_SAMPLE_RANDOM, | 451 | IRQF_TRIGGER_FALLING, bus->dev.driver->name, ts); |
452 | bus->dev.driver->name, ts); | ||
453 | 452 | ||
454 | if (err) { | 453 | if (err) { |
455 | dev_err(&bus->dev, "irq %d busy?\n", bus->irq); | 454 | dev_err(&bus->dev, "irq %d busy?\n", bus->irq); |
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 056ac77e2cf0..2b01e56568f8 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c | |||
@@ -127,6 +127,8 @@ struct ads7846 { | |||
127 | void (*filter_cleanup)(void *data); | 127 | void (*filter_cleanup)(void *data); |
128 | int (*get_pendown_state)(void); | 128 | int (*get_pendown_state)(void); |
129 | int gpio_pendown; | 129 | int gpio_pendown; |
130 | |||
131 | void (*wait_for_sync)(void); | ||
130 | }; | 132 | }; |
131 | 133 | ||
132 | /* leave chip selected when we're done, for quicker re-select? */ | 134 | /* leave chip selected when we're done, for quicker re-select? */ |
@@ -511,6 +513,10 @@ static int get_pendown_state(struct ads7846 *ts) | |||
511 | return !gpio_get_value(ts->gpio_pendown); | 513 | return !gpio_get_value(ts->gpio_pendown); |
512 | } | 514 | } |
513 | 515 | ||
516 | static void null_wait_for_sync(void) | ||
517 | { | ||
518 | } | ||
519 | |||
514 | /* | 520 | /* |
515 | * PENIRQ only kicks the timer. The timer only reissues the SPI transfer, | 521 | * PENIRQ only kicks the timer. The timer only reissues the SPI transfer, |
516 | * to retrieve touchscreen status. | 522 | * to retrieve touchscreen status. |
@@ -686,6 +692,7 @@ static void ads7846_rx_val(void *ads) | |||
686 | default: | 692 | default: |
687 | BUG(); | 693 | BUG(); |
688 | } | 694 | } |
695 | ts->wait_for_sync(); | ||
689 | status = spi_async(ts->spi, m); | 696 | status = spi_async(ts->spi, m); |
690 | if (status) | 697 | if (status) |
691 | dev_err(&ts->spi->dev, "spi_async --> %d\n", | 698 | dev_err(&ts->spi->dev, "spi_async --> %d\n", |
@@ -723,6 +730,7 @@ static enum hrtimer_restart ads7846_timer(struct hrtimer *handle) | |||
723 | } else { | 730 | } else { |
724 | /* pen is still down, continue with the measurement */ | 731 | /* pen is still down, continue with the measurement */ |
725 | ts->msg_idx = 0; | 732 | ts->msg_idx = 0; |
733 | ts->wait_for_sync(); | ||
726 | status = spi_async(ts->spi, &ts->msg[0]); | 734 | status = spi_async(ts->spi, &ts->msg[0]); |
727 | if (status) | 735 | if (status) |
728 | dev_err(&ts->spi->dev, "spi_async --> %d\n", status); | 736 | dev_err(&ts->spi->dev, "spi_async --> %d\n", status); |
@@ -746,7 +754,7 @@ static irqreturn_t ads7846_irq(int irq, void *handle) | |||
746 | * that here. (The "generic irq" framework may help...) | 754 | * that here. (The "generic irq" framework may help...) |
747 | */ | 755 | */ |
748 | ts->irq_disabled = 1; | 756 | ts->irq_disabled = 1; |
749 | disable_irq(ts->spi->irq); | 757 | disable_irq_nosync(ts->spi->irq); |
750 | ts->pending = 1; | 758 | ts->pending = 1; |
751 | hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY), | 759 | hrtimer_start(&ts->timer, ktime_set(0, TS_POLL_DELAY), |
752 | HRTIMER_MODE_REL); | 760 | HRTIMER_MODE_REL); |
@@ -947,6 +955,8 @@ static int __devinit ads7846_probe(struct spi_device *spi) | |||
947 | ts->penirq_recheck_delay_usecs = | 955 | ts->penirq_recheck_delay_usecs = |
948 | pdata->penirq_recheck_delay_usecs; | 956 | pdata->penirq_recheck_delay_usecs; |
949 | 957 | ||
958 | ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync; | ||
959 | |||
950 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev)); | 960 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev)); |
951 | 961 | ||
952 | input_dev->name = "ADS784x Touchscreen"; | 962 | input_dev->name = "ADS784x Touchscreen"; |
diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c index fa67d782c3c3..3ffd4c4b170c 100644 --- a/drivers/input/touchscreen/da9034-ts.c +++ b/drivers/input/touchscreen/da9034-ts.c | |||
@@ -3,6 +3,7 @@ | |||
3 | * | 3 | * |
4 | * Copyright (C) 2006-2008 Marvell International Ltd. | 4 | * Copyright (C) 2006-2008 Marvell International Ltd. |
5 | * Fengwei Yin <fengwei.yin@marvell.com> | 5 | * Fengwei Yin <fengwei.yin@marvell.com> |
6 | * Bin Yang <bin.yang@marvell.com> | ||
6 | * Eric Miao <eric.miao@marvell.com> | 7 | * Eric Miao <eric.miao@marvell.com> |
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
@@ -175,6 +176,16 @@ static void da9034_event_handler(struct da9034_touch *touch, int event) | |||
175 | goto err_reset; | 176 | goto err_reset; |
176 | 177 | ||
177 | touch->state = STATE_STOP; | 178 | touch->state = STATE_STOP; |
179 | |||
180 | /* FIXME: PEN_{UP/DOWN} events are expected to be | ||
181 | * available by stopping TSI, but this is found not | ||
182 | * always true, delay and simulate such an event | ||
183 | * here is more reliable | ||
184 | */ | ||
185 | mdelay(1); | ||
186 | da9034_event_handler(touch, | ||
187 | is_pen_down(touch) ? EVENT_PEN_DOWN : | ||
188 | EVENT_PEN_UP); | ||
178 | break; | 189 | break; |
179 | 190 | ||
180 | case STATE_STOP: | 191 | case STATE_STOP: |
@@ -189,8 +200,6 @@ static void da9034_event_handler(struct da9034_touch *touch, int event) | |||
189 | report_pen_up(touch); | 200 | report_pen_up(touch); |
190 | touch->state = STATE_IDLE; | 201 | touch->state = STATE_IDLE; |
191 | } | 202 | } |
192 | |||
193 | input_sync(touch->input_dev); | ||
194 | break; | 203 | break; |
195 | 204 | ||
196 | case STATE_WAIT: | 205 | case STATE_WAIT: |
@@ -200,8 +209,10 @@ static void da9034_event_handler(struct da9034_touch *touch, int event) | |||
200 | if (is_pen_down(touch)) { | 209 | if (is_pen_down(touch)) { |
201 | start_tsi(touch); | 210 | start_tsi(touch); |
202 | touch->state = STATE_BUSY; | 211 | touch->state = STATE_BUSY; |
203 | } else | 212 | } else { |
213 | report_pen_up(touch); | ||
204 | touch->state = STATE_IDLE; | 214 | touch->state = STATE_IDLE; |
215 | } | ||
205 | break; | 216 | break; |
206 | } | 217 | } |
207 | return; | 218 | return; |
@@ -226,16 +237,12 @@ static int da9034_touch_notifier(struct notifier_block *nb, | |||
226 | struct da9034_touch *touch = | 237 | struct da9034_touch *touch = |
227 | container_of(nb, struct da9034_touch, notifier); | 238 | container_of(nb, struct da9034_touch, notifier); |
228 | 239 | ||
229 | if (event & DA9034_EVENT_PEN_DOWN) { | ||
230 | if (is_pen_down(touch)) | ||
231 | da9034_event_handler(touch, EVENT_PEN_DOWN); | ||
232 | else | ||
233 | da9034_event_handler(touch, EVENT_PEN_UP); | ||
234 | } | ||
235 | |||
236 | if (event & DA9034_EVENT_TSI_READY) | 240 | if (event & DA9034_EVENT_TSI_READY) |
237 | da9034_event_handler(touch, EVENT_TSI_READY); | 241 | da9034_event_handler(touch, EVENT_TSI_READY); |
238 | 242 | ||
243 | if ((event & DA9034_EVENT_PEN_DOWN) && touch->state == STATE_IDLE) | ||
244 | da9034_event_handler(touch, EVENT_PEN_DOWN); | ||
245 | |||
239 | return 0; | 246 | return 0; |
240 | } | 247 | } |
241 | 248 | ||
@@ -385,6 +392,6 @@ static void __exit da9034_touch_exit(void) | |||
385 | module_exit(da9034_touch_exit); | 392 | module_exit(da9034_touch_exit); |
386 | 393 | ||
387 | MODULE_DESCRIPTION("Touchscreen driver for Dialog Semiconductor DA9034"); | 394 | MODULE_DESCRIPTION("Touchscreen driver for Dialog Semiconductor DA9034"); |
388 | MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>"); | 395 | MODULE_AUTHOR("Eric Miao <eric.miao@marvell.com>, Bin Yang <bin.yang@marvell.com>"); |
389 | MODULE_LICENSE("GPL"); | 396 | MODULE_LICENSE("GPL"); |
390 | MODULE_ALIAS("platform:da9034-touch"); | 397 | MODULE_ALIAS("platform:da9034-touch"); |
diff --git a/drivers/input/touchscreen/mainstone-wm97xx.c b/drivers/input/touchscreen/mainstone-wm97xx.c index dfa6a84ab50a..4cc047a5116e 100644 --- a/drivers/input/touchscreen/mainstone-wm97xx.c +++ b/drivers/input/touchscreen/mainstone-wm97xx.c | |||
@@ -111,13 +111,12 @@ static void wm97xx_acc_pen_up(struct wm97xx *wm) | |||
111 | #else | 111 | #else |
112 | static void wm97xx_acc_pen_up(struct wm97xx *wm) | 112 | static void wm97xx_acc_pen_up(struct wm97xx *wm) |
113 | { | 113 | { |
114 | int count = 16; | 114 | unsigned int count; |
115 | |||
115 | schedule_timeout_uninterruptible(1); | 116 | schedule_timeout_uninterruptible(1); |
116 | 117 | ||
117 | while (count < 16) { | 118 | for (count = 0; count < 16; count++) |
118 | MODR; | 119 | MODR; |
119 | count--; | ||
120 | } | ||
121 | } | 120 | } |
122 | #endif | 121 | #endif |
123 | 122 | ||
diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index cec480bffe38..69af8385ab14 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c | |||
@@ -370,8 +370,7 @@ static int wm97xx_init_pen_irq(struct wm97xx *wm) | |||
370 | * provided. */ | 370 | * provided. */ |
371 | BUG_ON(!wm->mach_ops->irq_enable); | 371 | BUG_ON(!wm->mach_ops->irq_enable); |
372 | 372 | ||
373 | if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, | 373 | if (request_irq(wm->pen_irq, wm97xx_pen_interrupt, IRQF_SHARED, |
374 | IRQF_SHARED | IRQF_SAMPLE_RANDOM, | ||
375 | "wm97xx-pen", wm)) { | 374 | "wm97xx-pen", wm)) { |
376 | dev_err(wm->dev, | 375 | dev_err(wm->dev, |
377 | "Failed to register pen down interrupt, polling"); | 376 | "Failed to register pen down interrupt, polling"); |