Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1317500

[PATCH 2/3] input: touchscreen: ad7879: fix default x/y axis assignment

From Stefan Agner <stefan@agner.ch>
Newsgroups linux.kernel
Subject [PATCH 2/3] input: touchscreen: ad7879: fix default x/y axis assignment
Date 2016-01-26 04:10 +0100
Message-ID <qV2b0-5md-7@gated-at.bofh.it> (permalink)
References <qV2b0-5md-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


The measurements read from the controller which are temporary stored
in conversion_data, 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, with that the meaning of the new boolean is inverted since
the underlying values are already swapped. With this change, a true
in swap_xy actually swaps the two axis.

Signed-off-by: Stefan Agner <stefan@agner.ch>
---
Hi Michael,

It seems that swap_xy is not used in any board which is in mainline,
hence swap_xy is always false. Therefore, up until now all boards
actually used swapped axis. However, I doubt that the blackfin boards
really have those axis swapped, it is probably more likely that the
userspace calibration took care of it.

However, if they are really swapped, we should set the swap_xy flag
to 1 for those board...

Do you happen to now what is the case with those boards?

--
Stefan

 drivers/input/touchscreen/ad7879.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
index a73934b..e290e7b 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,
-- 
2.7.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH 2/3] input: touchscreen: ad7879: fix default x/y axis assignment Stefan Agner <stefan@agner.ch> - 2016-01-26 04:10 +0100
  Re: [PATCH 2/3] input: touchscreen: ad7879: fix default x/y axis  assignment Stefan Agner <stefan@agner.ch> - 2016-01-26 18:10 +0100

csiph-web