summaryrefslogtreecommitdiff
path: root/drivers/input
diff options
context:
space:
mode:
authorStefan Agner <stefan@agner.ch>2016-03-08 10:34:38 -0800
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-01-10 23:09:40 +0100
commit63339e0fdb888fbf6e8489ca6131dfc2ec38d3f8 (patch)
tree1463c4410fa76657ea18abf6e9583937e5a05929 /drivers/input
parentd1a439ea19e7bdc38bcdb3245bd881dcf74ecedc (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> (cherry picked from commit 5f2940c4a544ae9040d0feff6da06a994cc201ff) (cherry picked from commit cf04e9f2cf8cb1e89ccecc01e650d5bd2ec33952)
Diffstat (limited to 'drivers/input')
-rw-r--r--drivers/input/touchscreen/ad7879.c8
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 @@
#define AD7879_TEMP_BIT (1<<1)
enum {
- AD7879_SEQ_XPOS = 0,
- AD7879_SEQ_YPOS = 1,
+ AD7879_SEQ_YPOS = 0,
+ AD7879_SEQ_XPOS = 1,
AD7879_SEQ_Z1 = 2,
AD7879_SEQ_Z2 = 3,
AD7879_NR_SENSE = 4,
@@ -517,7 +517,9 @@ 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;
+
+ /* Use swapped axis by default (backward compatibility) */
+ ts->swap_xy = !pdata->swap_xy;
setup_timer(&ts->timer, ad7879_timer, (unsigned long) ts);