Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2015348ybz; Sun, 26 Apr 2020 09:14:04 -0700 (PDT) X-Google-Smtp-Source: APiQypLocFZHAmEEFEg8CM/MAv7lxM1XbxyXSECF6rbbJjir0vWF62p2tu3HO+AIMlcb6+m8CuaE X-Received: by 2002:a17:907:2155:: with SMTP id rk21mr16695510ejb.163.1587917644397; Sun, 26 Apr 2020 09:14:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587917644; cv=none; d=google.com; s=arc-20160816; b=0UEB0kYrlDVVPfEBYwxiDHz1zu+yB1Jm/HO3MXSlCH+fztDwxuBFmTcDr/b8V7Z96T OknN6w3Y04uZGTrJMyIEKCxLxTFITol0DVAQygLaq/eHUPNpSMWJK1jclrYtmPfNWfZi kQiVPdF6b0785rXOXCTiBen31hSZrnMVSWb5UFC1XmNhkjqgcQTzDwmsdkdeLrMMcSMX aWVfcN/PZQWvCChFhpUN91LNQq0Io+EgPnn29YFmvqkomS8oa0WQ0rTCnevM3WM1fl6m WWGWs1HjSkkHEIXSks73SvZ7pn7RBx34FpTkFjTed2MXYY7RPRTJqNW2wjyO/MLQnSxW OLqw== 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=GJI6F0HjJBpsN/bjK6adjEe0MPsuAxhymXztxbciWAM=; b=uYsyhnkbs7Gab233aZapTzTB0iA9COLYqfdFE4bcv8nkzQeCRz2PduV+4OLQ0X0KPl qHWr4uXQ81nwT6gELwhAGYMD1cPPPO9r46sZ+KgRgSP1q3wQ3prD0Rs4g7Zyi56ZIQs5 J9L1uY6v7fRYJhtYgDCwOIDaYh6zZJxEhie7BETmufNu1Hz5jyzuN2SvAfHXoYxr2P8l X03Y/1yyYDmIWZtaRLRtCxl/2By2JjpCNgx+tjLDrzMfdxpNXVdhS+99jSkiykbL6NE6 0gRvBl5xqugsBBqixYBpK6VzUlztnFDPBxGpTdGKUSpT6gIvF0I5n38szhW6Gecmex+C 3OsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=gciuW6Hb; 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 f3si6585363edy.68.2020.04.26.09.13.41; Sun, 26 Apr 2020 09:14:04 -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=gciuW6Hb; 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 S1726262AbgDZQLq (ORCPT + 99 others); Sun, 26 Apr 2020 12:11:46 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:44824 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725778AbgDZQLP (ORCPT ); Sun, 26 Apr 2020 12:11:15 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 499CZT1ZyYz11D; Sun, 26 Apr 2020 18:11:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1587917473; bh=tA/XPgpGJbSi7V9EhJqnCr4qj2YgmKhxnLWBran/2S8=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=gciuW6Hbb79FTP+KgTWhzMaN29GWFNxgKoyr5j8dd1jDXE1yBoyNoqqOUsqeenetQ vpfMJyCbp0ciIA72mm1nQ13nXMz/TjQA/Y+We8ZNjwf9Qfw6X6Q6xpPIFdyLfUu3sY bc3PaYv6sydQTSBs7BoLKxeVDYntyVqp3bDbunE9CWfgLw8pAXAxu1jtdUc0K9pS2O u31QLmAotsgsEL/tgW+jP0j6K0OPMrpU7606vokjXyS51Z+rhmTp5XhAuPQCewd5Rr ySspwImnZU4sVv8oJ+0OUfCpBdkYKeMnkFy9wUMgDtAmMoCH4EWcdHAvr6Uf+fKH6G dAOckCN1coIrA== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at mail Date: Sun, 26 Apr 2020 18:11:12 +0200 Message-Id: <6988fbee4b349686faa7fdea2137c431a79baf14.1587916846.git.mirq-linux@rere.qmqm.pl> In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH v4 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 --- 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 58aa9b7dbcbf..c08a7971cd32 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -150,6 +151,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; @@ -894,8 +896,7 @@ static void elants_i2c_mt_event(struct elants_data *ts, u8 *buf, input_mt_slot(input, i); input_mt_report_slot_state(input, MT_TOOL_FINGER, 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); @@ -1322,6 +1323,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