Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62169
b: refs/heads/master
c: 1d25891
h: refs/heads/master
i:
  62167: cb0b22d
v: v3
  • Loading branch information
Semih Hazar authored and Dmitry Torokhov committed Jul 18, 2007
1 parent 310c2f7 commit de4d496
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e4f48861993294c27849076741eb0c090482560b
refs/heads/master: 1d25891f3241103d14ea78236504474a138b8ada
15 changes: 15 additions & 0 deletions trunk/drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ struct ads7846 {
u16 debounce_tol;
u16 debounce_rep;

u16 penirq_recheck_delay_usecs;

spinlock_t lock;
struct hrtimer timer;
unsigned pendown:1; /* P: lock */
Expand Down Expand Up @@ -553,6 +555,15 @@ static void ads7846_rx(void *ads)
return;
}

/* Maybe check the pendown state before reporting. This discards
* false readings when the pen is lifted.
*/
if (ts->penirq_recheck_delay_usecs) {
udelay(ts->penirq_recheck_delay_usecs);
if (!ts->get_pendown_state())
Rt = 0;
}

/* NOTE: We can't rely on the pressure to determine the pen down
* state, even this controller has a pressure sensor. The pressure
* value can fluctuate for quite a while after lifting the pen and
Expand Down Expand Up @@ -896,6 +907,10 @@ static int __devinit ads7846_probe(struct spi_device *spi)
ts->filter = ads7846_no_filter;
ts->get_pendown_state = pdata->get_pendown_state;

if (pdata->penirq_recheck_delay_usecs)
ts->penirq_recheck_delay_usecs =
pdata->penirq_recheck_delay_usecs;

snprintf(ts->phys, sizeof(ts->phys), "%s/input0", spi->dev.bus_id);

input_dev->name = "ADS784x Touchscreen";
Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/spi/ads7846.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ struct ads7846_platform_data {
*/
u16 settle_delay_usecs;

/* If set to non-zero, after samples are taken this delay is applied
* and penirq is rechecked, to help avoid false events. This value
* is affected by the material used to build the touch layer.
*/
u16 penirq_recheck_delay_usecs;

u16 x_plate_ohms;
u16 y_plate_ohms;

Expand Down

0 comments on commit de4d496

Please sign in to comment.