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/touchscreen | |
parent | ba28f22e7cf16cb310bb491cbb3f7d0d5d1f5c5d (diff) | |
parent | 3f3e7c6e139f704e2f48ea3b45ff7724a8d46456 (diff) |
Merge branch 'next' into for-linus
Diffstat (limited to 'drivers/input/touchscreen')
-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 |
6 files changed, 36 insertions, 22 deletions
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"); |