Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2086616ybz; Sun, 26 Apr 2020 10:50:39 -0700 (PDT) X-Google-Smtp-Source: APiQypIC4/gFqqKFnF1ZbAkk/26T73GUugViJsn3gwb+2zoT85BKpAyFASY53B6hty9XOdwAskjN X-Received: by 2002:a50:81c5:: with SMTP id 63mr15374802ede.115.1587923438946; Sun, 26 Apr 2020 10:50:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587923438; cv=none; d=google.com; s=arc-20160816; b=QWiT+r2bRFb3CeqStt6Im4sRwmXGfK5JabsZsRxJX1R6SJt+iSCQ5wkx0Nb/K+HP+F DX4lMuAOzRL3UIIgG8US96AE99OAPVl7Wz+HbDx9j1AqG6TP4dJganLCjqVo4ncvrXd/ V03qJ7d5EraDOFygvMXnn/dU0qgJxy4o2vJFZ1y1NeHoTpEbm+jhp2Re53GMWSa+Xyus q/1vwiRb1FT1pVDTND8Z7rapxgv+Bw4afqfJZkaEtt9h9Gvm7oLIl4doqdlPIW7xUGHp B0GaXxnXwhBIqiFwSy+tCNTi6DizwNamraWxB0hM4O0f/M7sSPm58QlxzqUvvHUvhCto JZGQ== 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=ShHjjVscelOMwKc+O0sZ76t/5xD8Lx6EeCL1qgq3pSg=; b=oNzmTWhJxtSHwpIYN1rX0/6N2njx/f2ylHCXhR5izNLonqwydB8fe2+iKobF/dZGyU b+EJZQ8ILibnaL/xh8xVxQrAAY86bKsF2CrfiaaVp4/LYZqsY4ks25kPT7szOhaDxURU q4KuvT3C18P0ADFMkEZuxmlH3PJqgEh7nuyhTwmjksz43cKrV8gvKm6l8QIUpbCkdz5N r4SD/WbTLU7umTIh52Dr+fzDCWQsKGFCEzy9sPPcxU3ndlyuJTN2s7WWDqn/4vDGOz3+ ec7q0vRHxNM0emiHt6Pn2kvpQyX8MqOfWf/SIDcVW4M0wfQTqHMCAMzIpj261Z2pHMM2 Ts/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=dQjlUsj2; 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 b9si6436443edx.31.2020.04.26.10.50.15; Sun, 26 Apr 2020 10:50:38 -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=dQjlUsj2; 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 S1726284AbgDZRry (ORCPT + 99 others); Sun, 26 Apr 2020 13:47:54 -0400 Received: from rere.qmqm.pl ([91.227.64.183]:35248 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgDZRrw (ORCPT ); Sun, 26 Apr 2020 13:47:52 -0400 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 499Fjy6ZN8zwy; Sun, 26 Apr 2020 19:47:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1587923271; bh=mskidBsclqFcBTsNzthkgNf+6hGPUgTRnXCBqGY/AR8=; h=Date:In-Reply-To:References:From:Subject:To:Cc:From; b=dQjlUsj2NMurEWjE5Dhk5kAVgOGyX0o7vmTdFKJfTOz8SqeQ62PJB5I7gQUwrJb7Y y7PcntVm+JhWNB8R/AvjMPm+DN3UnTv8A8iTTzBkS7kJTOykWeCZ3qlzGyNLExAGGI QiSkTImsEW67JsQU0yuG3lQHLD7dODbD4zWr/7byIprTfzyFeSvM8V72eOp28trmEp wj2tNEHyKPZAz12T0p135GaeVJ1FN5KJA5O+HPNkRevm5xZmQVwJnPX74sgSodcd2H EPN44CXEuPDekaykwHFOWDUn9lR0ugIXjUcl//TngTTUfDIqJ3t2e2pSzA6aEVIv+J xLpscAh6lANqQ== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.2 at mail Date: Sun, 26 Apr 2020 19:47:50 +0200 Message-Id: In-Reply-To: References: From: =?UTF-8?q?Micha=C5=82=20Miros=C5=82aw?= Subject: [PATCH v5 03/10] input: elants: remove unused axes 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 Driver only ever reports MT events and input_mt_init_slots() sets up emulated axes already. Clear the capabilities not generated directly and move MT axes setup, so they are visible by input_mt_init_slots(). Signed-off-by: Michał Mirosław Reviewed-by: Dmitry Osipenko Tested-by: Dmitry Osipenko --- v4: reword commitmsg; reorder axis setup --- drivers/input/touchscreen/elants_i2c.c | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 6c2b336d92bf..61a9098f35d2 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -1319,25 +1319,7 @@ static int elants_i2c_probe(struct i2c_client *client, ts->input->name = "Elan Touchscreen"; ts->input->id.bustype = BUS_I2C; - __set_bit(BTN_TOUCH, ts->input->keybit); - __set_bit(EV_ABS, ts->input->evbit); - __set_bit(EV_KEY, ts->input->evbit); - - /* Single touch input params setup */ - input_set_abs_params(ts->input, ABS_X, 0, ts->x_max, 0, 0); - input_set_abs_params(ts->input, ABS_Y, 0, ts->y_max, 0, 0); - input_set_abs_params(ts->input, ABS_PRESSURE, 0, 255, 0, 0); - input_abs_set_res(ts->input, ABS_X, ts->x_res); - input_abs_set_res(ts->input, ABS_Y, ts->y_res); - /* Multitouch input params setup */ - error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, - INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); - if (error) { - dev_err(&client->dev, - "failed to initialize MT slots: %d\n", error); - return error; - } input_set_abs_params(ts->input, ABS_MT_POSITION_X, 0, ts->x_max, 0, 0); input_set_abs_params(ts->input, ABS_MT_POSITION_Y, 0, ts->y_max, 0, 0); @@ -1349,6 +1331,14 @@ 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); + error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, + INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); + if (error) { + dev_err(&client->dev, + "failed to initialize MT slots: %d\n", error); + return error; + } + error = input_register_device(ts->input); if (error) { dev_err(&client->dev, -- 2.20.1