aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/touchscreen/ads7846.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/input/touchscreen/ads7846.c')
-rw-r--r--drivers/input/touchscreen/ads7846.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 0a26e0663542..693e3b2a65a3 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
@@ -897,7 +899,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
897 899
898 input_dev->name = "ADS784x Touchscreen"; 900 input_dev->name = "ADS784x Touchscreen";
899 input_dev->phys = ts->phys; 901 input_dev->phys = ts->phys;
900 input_dev->cdev.dev = &spi->dev; 902 input_dev->dev.parent = &spi->dev;
901 903
902 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS); 904 input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_ABS);
903 input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH); 905 input_dev->keybit[LONG(BTN_TOUCH)] = BIT(BTN_TOUCH);