mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Michael Hennerich <michael.hennerich@analog.com>
To: Stefan Agner <stefan@agner.ch>, <dmitry.torokhov@gmail.com>,
	<robh+dt@kernel.org>
Cc: <mark.rutland@arm.com>, <ijc+devicetree@hellion.org.uk>,
	<galak@codeaurora.org>, <realmz6@gmail.com>, <broonie@kernel.org>,
	<jic23@kernel.org>, <linux-input@vger.kernel.org>,
	<devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v3 2/3] input: touchscreen: ad7879: fix default x/y axis assignment
Date: Wed, 3 Feb 2016 08:41:42 +0100	[thread overview]
Message-ID: <56B1AF36.9080204@analog.com> (raw)
In-Reply-To: <1454455218-13004-2-git-send-email-stefan@agner.ch>

On 02/03/2016 12:20 AM, Stefan Agner wrote:
> 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>

> ---
> Changes since v2:
> - (none)
> Changes since v1:
> - Keep axis swapped by default when using platform data
>
>   drivers/input/touchscreen/ad7879.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c
> index 93b8ea2..abd0220 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);
>
>


-- 
Greetings,
Michael

--
Analog Devices GmbH      Wilhelm-Wagenfeld-Str. 6      80807 Muenchen
Sitz der Gesellschaft: Muenchen; Registergericht: Muenchen HRB 40368;
Geschaeftsfuehrer:Dr.Carsten Suckrow, Thomas Wessel, William A. Martin,
Margaret Seif

  reply	other threads:[~2016-02-03  7:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-02 23:20 [PATCH v3 1/3] input: touchscreen: ad7879: move header to platform_data directory Stefan Agner
2016-02-02 23:20 ` [PATCH v3 2/3] input: touchscreen: ad7879: fix default x/y axis assignment Stefan Agner
2016-02-03  7:41   ` Michael Hennerich [this message]
2016-02-02 23:20 ` [PATCH v3 3/3] input: touchscreen: ad7879: add device tree support Stefan Agner
2016-02-03  7:41   ` Michael Hennerich
2016-03-08 18:50   ` Dmitry Torokhov
2016-03-08 17:48 ` [PATCH v3 1/3] input: touchscreen: ad7879: move header to platform_data directory Stefan Agner
2016-03-08 18:48   ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56B1AF36.9080204@analog.com \
    --to=michael.hennerich@analog.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jic23@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=realmz6@gmail.com \
    --cc=robh+dt@kernel.org \
    --cc=stefan@agner.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome