Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 26348
b: refs/heads/master
c: 53a0ef8
h: refs/heads/master
v: v3
  • Loading branch information
Imre Deak authored and Dmitry Torokhov committed Apr 12, 2006
1 parent 04e26f8 commit 0998b33
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 438f2a7401ec5d8f85923a7c3e6da444f097a3a1
refs/heads/master: 53a0ef89e95c725f3faab98573770aeb7429c1a3
21 changes: 18 additions & 3 deletions trunk/drivers/input/touchscreen/ads7846.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@ struct ads7846 {
u16 vref_delay_usecs;
u16 x_plate_ohms;

u8 read_x, read_y, read_z1, read_z2;
u8 read_x, read_y, read_z1, read_z2, pwrdown;
u16 dummy; /* for the pwrdown read */
struct ts_event tc;

struct spi_transfer xfer[8];
struct spi_transfer xfer[10];
struct spi_message msg;

spinlock_t lock;
Expand Down Expand Up @@ -125,7 +126,9 @@ struct ads7846 {
#define READ_Y (READ_12BIT_DFR(y) | ADS_PD10_ADC_ON)
#define READ_Z1 (READ_12BIT_DFR(z1) | ADS_PD10_ADC_ON)
#define READ_Z2 (READ_12BIT_DFR(z2) | ADS_PD10_ADC_ON)
#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_PDOWN) /* LAST */

#define READ_X (READ_12BIT_DFR(x) | ADS_PD10_ADC_ON)
#define PWRDOWN (READ_12BIT_DFR(y) | ADS_PD10_PDOWN) /* LAST */

/* single-ended samples need to first power up reference voltage;
* we leave both ADC and VREF powered
Expand Down Expand Up @@ -541,6 +544,18 @@ static int __devinit ads7846_probe(struct spi_device *spi)
x++;
x->rx_buf = &ts->tc.x;
x->len = 2;
spi_message_add_tail(x, &ts->msg);

/* power down */
x++;
ts->pwrdown = PWRDOWN;
x->tx_buf = &ts->pwrdown;
x->len = 1;
spi_message_add_tail(x, &ts->msg);

x++;
x->rx_buf = &ts->dummy;
x->len = 2;
CS_CHANGE(*x);
spi_message_add_tail(x, &ts->msg);

Expand Down

0 comments on commit 0998b33

Please sign in to comment.