aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Ferre <nicolas.ferre@rfo.atmel.com>2007-02-28 23:51:03 -0500
committerDmitry Torokhov <dtor@insightbb.com>2007-02-28 23:51:03 -0500
commit969111e900226a8dbd1f596f34c09eecd20afc7d (patch)
tree2a9d331f90e8049c5d2fbc0a37a7971bccfe07f1
parentbebb8a2bc180a4c920c57e89b2d713a34c1d096c (diff)
Input: ads7846 - add support for the ads7843 touchscreen
The ads7843 support has now become almost trivial since the last rework. Signed-off-by: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
-rw-r--r--drivers/input/touchscreen/ads7846.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 0a26e066354..2f5fc804336 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -39,7 +39,8 @@
39/* 39/*
40 * This code has been heavily tested on a Nokia 770, and lightly 40 * This code has been heavily tested on a Nokia 770, and lightly
41 * tested on other ads7846 devices (OSK/Mistral, Lubbock). 41 * tested on other ads7846 devices (OSK/Mistral, Lubbock).
42 * Support for ads7843 and ads7845 has only been stubbed in. 42 * Support for ads7843 tested on Atmel at91sam926x-EK.
43 * Support for ads7845 has only been stubbed in.
43 * 44 *
44 * IRQ handling needs a workaround because of a shortcoming in handling 45 * IRQ handling needs a workaround because of a shortcoming in handling
45 * edge triggered IRQs on some platforms like the OMAP1/2. These 46 * edge triggered IRQs on some platforms like the OMAP1/2. These
@@ -246,18 +247,16 @@ static int ads7846_read12_ser(struct device *dev, unsigned command)
246 247
247 /* REVISIT: take a few more samples, and compare ... */ 248 /* REVISIT: take a few more samples, and compare ... */
248 249
249 /* maybe off internal vREF */ 250 /* converter in low power mode & enable PENIRQ */
250 if (use_internal) { 251 req->ref_off = PWRDOWN;
251 req->ref_off = REF_OFF; 252 req->xfer[4].tx_buf = &req->ref_off;
252 req->xfer[4].tx_buf = &req->ref_off; 253 req->xfer[4].len = 1;
253 req->xfer[4].len = 1; 254 spi_message_add_tail(&req->xfer[4], &req->msg);
254 spi_message_add_tail(&req->xfer[4], &req->msg); 255
255 256 req->xfer[5].rx_buf = &req->scratch;
256 req->xfer[5].rx_buf = &req->scratch; 257 req->xfer[5].len = 2;
257 req->xfer[5].len = 2; 258 CS_CHANGE(req->xfer[5]);
258 CS_CHANGE(req->xfer[5]); 259 spi_message_add_tail(&req->xfer[5], &req->msg);
259 spi_message_add_tail(&req->xfer[5], &req->msg);
260 }
261 260
262 ts->irq_disabled = 1; 261 ts->irq_disabled = 1;
263 disable_irq(spi->irq); 262 disable_irq(spi->irq);
@@ -536,6 +535,9 @@ static void ads7846_rx(void *ads)
536 } else 535 } else
537 Rt = 0; 536 Rt = 0;
538 537
538 if (ts->model == 7843)
539 Rt = ts->pressure_max / 2;
540
539 /* Sample found inconsistent by debouncing or pressure is beyond 541 /* Sample found inconsistent by debouncing or pressure is beyond
540 * the maximum. Don't report it to user space, repeat at least 542 * the maximum. Don't report it to user space, repeat at least
541 * once more the measurement 543 * once more the measurement