From patchwork Tue Jan 26 03:04:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 8117541 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DBE07BEEE5 for ; Tue, 26 Jan 2016 03:05:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 198B4202E6 for ; Tue, 26 Jan 2016 03:05:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3337320274 for ; Tue, 26 Jan 2016 03:05:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933248AbcAZDE4 (ORCPT ); Mon, 25 Jan 2016 22:04:56 -0500 Received: from mail.kmu-office.ch ([178.209.48.109]:48561 "EHLO mail.kmu-office.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932094AbcAZDEv (ORCPT ); Mon, 25 Jan 2016 22:04:51 -0500 Received: from trochilidae.toradex.int (75-146-58-181-Washington.hfc.comcastbusiness.net [75.146.58.181]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 8FDBA5C089A; Tue, 26 Jan 2016 04:03:33 +0100 (CET) From: Stefan Agner To: dmitry.torokhov@gmail.com, michael.hennerich@analog.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, Stefan Agner Subject: [PATCH 2/3] input: touchscreen: ad7879: fix default x/y axis assignment Date: Mon, 25 Jan 2016 19:04:36 -0800 Message-Id: <1453777477-29706-2-git-send-email-stefan@agner.ch> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1453777477-29706-1-git-send-email-stefan@agner.ch> References: <1453777477-29706-1-git-send-email-stefan@agner.ch> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1453777416; bh=gSVpMxdy/tq7BoLsLyVgYDYp6jw2NKDjYUs9pVWEvAI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References; b=R0xfnrGC3kvpvIgxO/qke8fceRwOYWdfznCP9f58XMK8ZDTusoNbggiA7D3jl1m/5Zyxh58yMgLsi5fRRJqyD7bFy/5orP7ZBY269gXl/EX5O1ZO5cLDg1ss2Altt72WRXsUJ22H3uRDjpikraXgcNLUtbNM8F4/J3+GtVK5mRY= Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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,