Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318283
b: refs/heads/master
c: 6680884
h: refs/heads/master
i:
  318281: a1e711a
  318279: 20f814d
v: v3
  • Loading branch information
Michael Hennerich authored and Dmitry Torokhov committed Jul 7, 2012
1 parent 7b73b41 commit 581eab7
Show file tree
Hide file tree
Showing 3 changed files with 8 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: f2bb26b9b7652287719f08f080c09c2d7ddcf6b5
refs/heads/master: 6680884a44207efe8ef6bc56b1c932cce2b89994
5 changes: 5 additions & 0 deletions trunk/drivers/input/touchscreen/ad7879.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ struct ad7879 {
unsigned int irq;
bool disabled; /* P: input->mutex */
bool suspended; /* P: input->mutex */
bool swap_xy;
u16 conversion_data[AD7879_NR_SENSE];
char phys[32];
u8 first_conversion_delay;
Expand Down Expand Up @@ -161,6 +162,9 @@ static int ad7879_report(struct ad7879 *ts)
z1 = ts->conversion_data[AD7879_SEQ_Z1] & MAX_12BIT;
z2 = ts->conversion_data[AD7879_SEQ_Z2] & MAX_12BIT;

if (ts->swap_xy)
swap(x, y);

/*
* The samples processed here are already preprocessed by the AD7879.
* The preprocessing function consists of a median and an averaging
Expand Down Expand Up @@ -520,6 +524,7 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq,
ts->dev = dev;
ts->input = input_dev;
ts->irq = irq;
ts->swap_xy = pdata->swap_xy;

setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts);

Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/spi/ad7879.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ struct ad7879_platform_data {
u16 y_min, y_max;
u16 pressure_min, pressure_max;

bool swap_xy; /* swap x and y axes */

/* [0..255] 0=OFF Starts at 1=550us and goes
* all the way to 9.440ms in steps of 35us.
*/
Expand Down

0 comments on commit 581eab7

Please sign in to comment.