Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143526
b: refs/heads/master
c: fd746d5
h: refs/heads/master
v: v3
  • Loading branch information
Eric Miao authored and Dmitry Torokhov committed Apr 12, 2009
1 parent af29798 commit b62f367
Show file tree
Hide file tree
Showing 3 changed files with 12 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: b79e83bdd961ec9b862191c0df51aaeb3cb85664
refs/heads/master: fd746d540abf8c686f5f868ae62112692e684088
10 changes: 10 additions & 0 deletions trunk/drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ struct ads7846 {
void (*filter_cleanup)(void *data);
int (*get_pendown_state)(void);
int gpio_pendown;

void (*wait_for_sync)(void);
};

/* leave chip selected when we're done, for quicker re-select? */
Expand Down Expand Up @@ -511,6 +513,10 @@ static int get_pendown_state(struct ads7846 *ts)
return !gpio_get_value(ts->gpio_pendown);
}

static void null_wait_for_sync(void)
{
}

/*
* PENIRQ only kicks the timer. The timer only reissues the SPI transfer,
* to retrieve touchscreen status.
Expand Down Expand Up @@ -686,6 +692,7 @@ static void ads7846_rx_val(void *ads)
default:
BUG();
}
ts->wait_for_sync();
status = spi_async(ts->spi, m);
if (status)
dev_err(&ts->spi->dev, "spi_async --> %d\n",
Expand Down Expand Up @@ -723,6 +730,7 @@ static enum hrtimer_restart ads7846_timer(struct hrtimer *handle)
} else {
/* pen is still down, continue with the measurement */
ts->msg_idx = 0;
ts->wait_for_sync();
status = spi_async(ts->spi, &ts->msg[0]);
if (status)
dev_err(&ts->spi->dev, "spi_async --> %d\n", status);
Expand Down Expand Up @@ -947,6 +955,8 @@ static int __devinit ads7846_probe(struct spi_device *spi)
ts->penirq_recheck_delay_usecs =
pdata->penirq_recheck_delay_usecs;

ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync;

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

input_dev->name = "ADS784x Touchscreen";
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/spi/ads7846.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,6 @@ struct ads7846_platform_data {
void **filter_data);
int (*filter) (void *filter_data, int data_idx, int *val);
void (*filter_cleanup)(void *filter_data);
void (*wait_for_sync)(void);
};

0 comments on commit b62f367

Please sign in to comment.