Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2301954pxb; Wed, 9 Feb 2022 15:36:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJwb7tUqhyz0R8S8wG/34bpRMEhbf+DCgoZVehcyIzV93azHecssOiKRvXcr/HvO9CikdL30 X-Received: by 2002:a17:902:eac4:: with SMTP id p4mr4896588pld.90.1644449792946; Wed, 09 Feb 2022 15:36:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644449792; cv=none; d=google.com; s=arc-20160816; b=OWfTLsQn1FNOlkiTb/gwDsF8T4jMVOAQ9pVbeKAMwO7ehohcEEPmiYUvA2+gHE6b5/ 0+S5IpQ/MMUGDIfev2v5kldatIdolrA7W6Y6q/QB1Hr3344aE2W2U2GRxTIfLxnN0t7N F0QvGbZ8GdM2Mi9wJl0bS5idlng3klYcucqRXNxwxbrY88S+Krc8fxebIfDDN9mG9NyG 8XeONTIGvhBO8f99rJeg0L4O+NnOOqMH7j751OmyMo9WmaqiHt28GTgRZ3p5QDBWuCg9 jtKSVb1FOZpkAXfGA68rv9HBJ/pE7lwtDCJ8wK4+BBUdv9s+/VQUkDNhA+G1/RQCzL3D Yq6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=buL6XEcsAFqRDJJIXjfO8uUO8Hw6evGQ50HmwACTXmg=; b=T48kCPJIdisSgscT0dasd8MBdiW9HPmHlmY9FV3Fg71vNyESNPN80rJdIZ0j3QdP1o VmH9ExKPWkumvkOB6i3bwhBsgnJBPdFOB8c4qn8GwKIIkPLOTbBGFFr52P4BPsgALhkc J5lYDzPKqXv0IJEYchou0SjbHCeYgJzm5EoZVjqH38LgbLjhuAgHpbKBFZh5ByFP3emW sXGbDzfVvx/2eNB5/ESeiBoJK0HjOhTZVJK/QsRWfUS9i7VRp/ihNSIyL/VZWAhQNRxz OGuxpV1yDgP2FcA0I+r3ppjzlhQIgALfGZOKoYTuZfK/Vqp1yqPqJDFKzcfdK0hVWVwL xCRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=qM7mIcK1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c14si486062plg.216.2022.02.09.15.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 15:36:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=fail header.i=@phytec.de header.s=a4 header.b=qM7mIcK1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25C54E088FC5; Wed, 9 Feb 2022 15:23:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236152AbiBIWjj (ORCPT + 99 others); Wed, 9 Feb 2022 17:39:39 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:56802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236149AbiBIWje (ORCPT ); Wed, 9 Feb 2022 17:39:34 -0500 X-Greylist: delayed 394 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 09 Feb 2022 14:39:36 PST Received: from mickerik.phytec.de (mickerik.phytec.de [195.145.39.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1F52C1DF65E for ; Wed, 9 Feb 2022 14:39:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; d=phytec.de; s=a4; c=relaxed/simple; q=dns/txt; i=@phytec.de; t=1644446373; x=1647038373; h=From:Sender:Reply-To:Subject:Date:Message-Id:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=EzckGd9Ydqg+0+DJujflO9WgyKd1bNpDeZF5ujGoVhY=; b=qM7mIcK1sMFBFze6SBM+fBGFvvENMoIXas46Ttn8BDpyjrJD6OTvQOEEH2/bnuZb mNi1CK7CjiDipwfLSbTNXRIicWbMG/kDDU/yRq3o3Y+QXVnHYWIptWy2+EhjvmWe jyId/4mCTN6Qd6bqE7sCDPUPC2HHWnnvg+l3jwQ0Frc=; X-AuditID: c39127d2-9112070000002a63-fc-620442a57246 Received: from idefix.phytec.de (Unknown_Domain [172.16.0.10]) by mickerik.phytec.de (PHYTEC Mail Gateway) with SMTP id FA.82.10851.5A244026; Wed, 9 Feb 2022 23:39:33 +0100 (CET) Received: from augenblix2.phytec.de ([172.16.0.56]) by idefix.phytec.de (IBM Domino Release 9.0.1FP7) with ESMTP id 2022020923393376-256579 ; Wed, 9 Feb 2022 23:39:33 +0100 From: Yunus Bas To: dmitry.torokhov@gmail.com, yuehaibing@huawei.com, linux-input@vger.kernel.org Cc: u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org Subject: [PATCH RESEND] Input: tsc200x-core - Add axis inversion and swapping support Date: Wed, 9 Feb 2022 23:39:33 +0100 Message-Id: <20220209223933.1672782-1-y.bas@phytec.de> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-MIMETrack: Itemize by SMTP Server on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 09.02.2022 23:39:33, Serialize by Router on Idefix/Phytec(Release 9.0.1FP7|August 17, 2016) at 09.02.2022 23:39:33 X-TNEFEvaluated: 1 Content-Transfer-Encoding: quoted-printable X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprGLMWRmVeSWpSXmKPExsWyRoCBS3epE0uSwctXxhaHF71gtLj56Rur xeVdc9gsbk+czGhx5+tzFgdWj52z7rJ7tBx5y+rR/9fA4/MmuQCWKC6blNSczLLUIn27BK6M yW+2sRac5q1ov3WGvYFxFXcXIyeHhICJxOQjH9i6GLk4hAS2Mkq0TV7MDOGcY5Q49+MCC0gV m4CixPnbb1lBbBGBQImD/T1ANgcHs4CDREtfOYgpLBAq8WSBNkgFi4CKxPoZ9xlBbF4BM4kZ 0zuYIHbJS8y89J0dIi4ocXLmExaQVRICVxgl9kz5wAhRJCRxevFZZhCbWUBbYtnC18wTGPlm IemZhSS1gJFpFaNQbmZydmpRZrZeQUZlSWqyXkrqJkZg2B2eqH5pB2PfHI9DjEwcjIcYJTiY lUR4T9UzJwnxpiRWVqUW5ccXleakFh9ilOZgURLnvd/DlCgkkJ5YkpqdmlqQWgSTZeLglGpg NK06PSd7jsNJ29279jAsiz7y4c6Uq+Yiweu+6BW92JBX2fHo8AdRx7/LGTcpvnE8cm/dyvA0 QbaJ0/tnKj+T5Ons/ShrEB7kEl17SUzpXM/Cn3u71LdMe1yYwnfq6MKKnymvN54tfrVc+vQp 4dV7ZGxmRIgdLF1TwsRjrHTje9C9W0/+G4QUvVBiKc5INNRiLipOBADBttksKQIAAA== X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since Commit ed7c9870c9bc ("Input: of=5Ftouchscreen - add support for inverted / swapped axes"), the of=5Ftouchscreen interface supports axis inverting and swapping through Devicetree properties. Make use of this feature. Signed-off-by: Yunus Bas --- drivers/input/touchscreen/tsc200x-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touch= screen/tsc200x-core.c index 27810f6c69f6..72c7258b93a5 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c @@ -88,6 +88,8 @@ struct tsc200x { int in=5Fz1; int in=5Fz2; =20 + struct touchscreen=5Fproperties prop; + spinlock=5Ft lock; struct timer=5Flist penup=5Ftimer; =20 @@ -113,8 +115,7 @@ static void tsc200x=5Fupdate=5Fpen=5Fstate(struct tsc20= 0x *ts, int x, int y, int pressure) { if (pressure) { - input=5Freport=5Fabs(ts->idev, ABS=5FX, x); - input=5Freport=5Fabs(ts->idev, ABS=5FY, y); + touchscreen=5Freport=5Fpos(ts->idev, &ts->prop, x, y, false); input=5Freport=5Fabs(ts->idev, ABS=5FPRESSURE, pressure); if (!ts->pen=5Fdown) { input=5Freport=5Fkey(ts->idev, BTN=5FTOUCH, !!pressure); @@ -533,7 +534,7 @@ int tsc200x=5Fprobe(struct device *dev, int irq, const = struct input=5Fid *tsc=5Fid, input=5Fset=5Fabs=5Fparams(input=5Fdev, ABS=5FPRESSURE, 0, MAX=5F12BIT, TSC200X=5FDEF=5FP=5FFUZZ, 0); =20 - touchscreen=5Fparse=5Fproperties(input=5Fdev, false, NULL); + touchscreen=5Fparse=5Fproperties(input=5Fdev, false, &ts->prop); =20 /* Ensure the touchscreen is off */ tsc200x=5Fstop=5Fscan(ts); --=20 2.25.1