Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2086846ybz; Sun, 26 Apr 2020 10:51:03 -0700 (PDT) X-Google-Smtp-Source: APiQypK+ejN3EUS7ILNYuDEucMYSjQ6vlDJvpQilc/zc3pjC0LZisNEIdyVC75y/o8tb7eSvTrES X-Received: by 2002:a17:906:808:: with SMTP id e8mr16021977ejd.372.1587923463635; Sun, 26 Apr 2020 10:51:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587923463; cv=none; d=google.com; s=arc-20160816; b=bgXvPhxo8E2SpPnVhlWE/YTSqZz2rIKuo/o+ku/CJxOVZwYJNY4/103ujtSLhftc9V IJ5MJVj6XgsuyDZTj/4oQoc42ozPUrvbyVm/aAh+v4CEWjZX6tXhOapTNYeA+i0Wb1kJ vISW651JqAfY2oXYXFCGfOJD5srUKKH4ew6/X3Ncsde5BC/0ALULGnZ9e4lVG4SOGAac fwIpmmnty8eYB8JGHarTdOQmogaeYV1cEZhp2r657OG/kJT4nF5QJZFD9yV1lzOfinXS ZnmYWQg1FYTEUQNhlPFl8uFYw4pW5Ipy2OWMuvmxykSxBUqtz4T9jzFFuHad6Sj9PlzL ycng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:content-transfer-encoding :mime-version:subject:from:references:in-reply-to:message-id:date :dkim-signature; bh=st8osPFL79j2tozMJv8xa5Skh0Ow6SfZJYTrvmWlM6A=; b=rcViIe7refmiFG1w5MAA2DCvRPIfIOpoL+c2R+LRd4ox9V/kvo1gNNo3mGDj2R/kvF 53uRl8v7WTQ/c0bmdG03e6U4Hsah+G3U3bfYQnnoh6BZsnEepGH7haViVCXQOYQpOZWQ aDTz19+J5IMyVLdDuyu6ybBRvlKXk0czskhYkXrtI9EE1CT8K5UjeEa6yZDtu/1K3FNx VNNBn5OF95IBQGPhJky95gnyCOHviuAalZH5u9JBdhOs4Xbg4/zda90SVrFKmtAz6Vwy H2XheXkiGGAycIerTYOzCRpqo+JwlGEQiXJyWf6wrJgSryEc073x86xQUEdrBXtHGida hMBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=kQuCp3wO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y12si6841320edf.435.2020.04.26.10.50.40; Sun, 26 Apr 2020 10:51:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=kQuCp3wO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726323AbgDZRr4 (ORCPT + 99 others); Sun, 26 Apr 2020 13:47:56 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:6194 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726199AbgDZRrx (ORCPT ); Sun, 26 Apr 2020 13:47:53 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 499Fjz3F62z11D; Sun, 26 Apr 2020 19:47:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1587923271; bh=Ml7ML5grvVGYphuVKQi2NhHQLiMQjmo33iGw5j3sT0M=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=kQuCp3wOxtGqhU1zzCKLEef5oSX7yC9Oj/Hg//NfcvI34Px31dG4IZ1deGyY3OiyJ v69DBDVS8FSpSd0dmPQ+0ntRxe8jnKj5hrrRAzc39AHrnKUv1E4JhnlRDT628dfNlE 3niNJpGII6v78EVO259Ij/7q/UHXLKSX3uSCmQ+mvgsecV+LE4JrmotuH32K182AsG N84Ys7xxBbRkvM5Wq7i5uvLKdSwEsItRFrCn1n254Cu6iWJTiWXiq/aN/Di2Lxxv8J ahJxUfq2PsTbAUKQYj20dOwW/ql//VS3ymv7Fm+xQuJoQ0Bo8JyG2sp6/dDjIkVk3Y Dw+XdkUGuawMw== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at mail Date: Sun, 26 Apr 2020 19:47:51 +0200 Message-Id: <49ea996878264f7c8bde25204e4ddf4b1e85ae71.1587923061.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH v5 04/10] input: elants: override touchscreen info with DT properties MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit To: David Heidelberg , Dmitry Osipenko , Dmitry Torokhov , Henrik Rydberg , James Chen , Johnny Chuang , Rob Herring , Scott Liu Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allow overriding of information from hardware and support additional common DT properties like axis inversion. This is required for eg. Nexus 7 and TF300T where the programmed values in firmware differ from reality. Signed-off-by: Dmitry Osipenko [moved "prop" before DMA buffer] Signed-off-by: Michał Mirosław --- v5: rebase against dtor/input/for-linus --- drivers/input/touchscreen/elants_i2c.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 61a9098f35d2..d2be61ae6722 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -33,6 +33,7 @@ #include #include #include +#include #include #include #include @@ -152,6 +153,7 @@ struct elants_data { unsigned int y_res; unsigned int x_max; unsigned int y_max; + struct touchscreen_properties prop; enum elants_state state; enum elants_iap_mode iap_mode; @@ -901,8 +903,7 @@ static void elants_i2c_mt_event(struct elants_data *ts, u8 *buf, input_mt_slot(input, i); input_mt_report_slot_state(input, tool_type, true); - input_event(input, EV_ABS, ABS_MT_POSITION_X, x); - input_event(input, EV_ABS, ABS_MT_POSITION_Y, y); + touchscreen_report_pos(input, &ts->prop, x, y, true); input_event(input, EV_ABS, ABS_MT_PRESSURE, p); input_event(input, EV_ABS, ABS_MT_TOUCH_MAJOR, w); @@ -1331,6 +1332,8 @@ static int elants_i2c_probe(struct i2c_client *client, input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, 1); + touchscreen_parse_properties(ts->input, true, &ts->prop); + error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); if (error) { -- 2.20.1