diff options
author | Stefan Agner <stefan@agner.ch> | 2016-03-08 13:34:38 -0500 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-03-08 13:51:12 -0500 |
commit | 5f2940c4a544ae9040d0feff6da06a994cc201ff (patch) | |
tree | 086fcabe8ea4a4924702c85611bcb3dd89f14347 | |
parent | 4774f400935fbb44a25f5e8fd5c5583431e28ac1 (diff) |
Input: ad7879 - fix default x/y axis assignment
The X/Y position measurements read from the controller are interpreted
wrong. The first measurement X+ contains the Y position, and the second
measurement Y+ the X position (see also Table 11 Register Table in the
data sheet).
The problem is already known and a swap option has been introduced:
commit 6680884a4420 ("Input: ad7879 - add option to correct xy axis")
However, the meaning of the new boolean is inverted since the underlying
values are already swapped. Let ts->swap_xy set to true actually be the
swapped configuration of the two axis.
Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
-rw-r--r-- | drivers/input/touchscreen/ad7879.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index b32dbf389777..a770b92a9aa1 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c | |||
@@ -94,8 +94,8 @@ | |||
94 | #define AD7879_TEMP_BIT (1<<1) | 94 | #define AD7879_TEMP_BIT (1<<1) |
95 | 95 | ||
96 | enum { | 96 | enum { |
97 | AD7879_SEQ_XPOS = 0, | 97 | AD7879_SEQ_YPOS = 0, |
98 | AD7879_SEQ_YPOS = 1, | 98 | AD7879_SEQ_XPOS = 1, |
99 | AD7879_SEQ_Z1 = 2, | 99 | AD7879_SEQ_Z1 = 2, |
100 | AD7879_SEQ_Z2 = 3, | 100 | AD7879_SEQ_Z2 = 3, |
101 | AD7879_NR_SENSE = 4, | 101 | AD7879_NR_SENSE = 4, |
@@ -517,7 +517,9 @@ struct ad7879 *ad7879_probe(struct device *dev, u8 devid, unsigned int irq, | |||
517 | ts->dev = dev; | 517 | ts->dev = dev; |
518 | ts->input = input_dev; | 518 | ts->input = input_dev; |
519 | ts->irq = irq; | 519 | ts->irq = irq; |
520 | ts->swap_xy = pdata->swap_xy; | 520 | |
521 | /* Use swapped axis by default (backward compatibility) */ | ||
522 | ts->swap_xy = !pdata->swap_xy; | ||
521 | 523 | ||
522 | setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts); | 524 | setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts); |
523 | 525 | ||