From patchwork Wed Feb 9 22:39:33 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yunus Bas X-Patchwork-Id: 12741036 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8040CC433F5 for ; Wed, 9 Feb 2022 22:54:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231361AbiBIWyg (ORCPT ); Wed, 9 Feb 2022 17:54:36 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:33100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236544AbiBIWyf (ORCPT ); Wed, 9 Feb 2022 17:54:35 -0500 X-Greylist: delayed 902 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 09 Feb 2022 14:54:37 PST Received: from mickerik.phytec.de (mickerik.phytec.de [195.145.39.210]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6BF6C0219EC for ; Wed, 9 Feb 2022 14:54:37 -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 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== Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Since Commit ed7c9870c9bc ("Input: of_touchscreen - add support for inverted / swapped axes"), the of_touchscreen 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/touchscreen/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_z1; int in_z2; + struct touchscreen_properties prop; + spinlock_t lock; struct timer_list penup_timer; @@ -113,8 +115,7 @@ static void tsc200x_update_pen_state(struct tsc200x *ts, int x, int y, int pressure) { if (pressure) { - input_report_abs(ts->idev, ABS_X, x); - input_report_abs(ts->idev, ABS_Y, y); + touchscreen_report_pos(ts->idev, &ts->prop, x, y, false); input_report_abs(ts->idev, ABS_PRESSURE, pressure); if (!ts->pen_down) { input_report_key(ts->idev, BTN_TOUCH, !!pressure); @@ -533,7 +534,7 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, input_set_abs_params(input_dev, ABS_PRESSURE, 0, MAX_12BIT, TSC200X_DEF_P_FUZZ, 0); - touchscreen_parse_properties(input_dev, false, NULL); + touchscreen_parse_properties(input_dev, false, &ts->prop); /* Ensure the touchscreen is off */ tsc200x_stop_scan(ts);