Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp214701ybi; Fri, 24 May 2019 02:41:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxC3HBTHAzail9woJ1rmjB+DlDZgvVcSaG+7sKl23oRH9caeAhctEVyzUaqeBzMy2542yNs X-Received: by 2002:a17:902:bd94:: with SMTP id q20mr82404755pls.146.1558690895922; Fri, 24 May 2019 02:41:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558690895; cv=none; d=google.com; s=arc-20160816; b=xZnXulvmRTbRjBGVOfVrhJrSyVYnNKaJmGyPehFdxgVN7fJTaRAcBtHlPmRxOp53L+ L/JFndeOpH6SGTjbAPwawEuYSaG9CgSw5DwcgAMEH8UlYpDimXcstY341XjiZYPYRdj7 cXk8xLxEOUrtbjI9PNR0ekce5lBdHLamozFLIIpzho2z1ndvThNTGTnTTtIXWVTSYhDh DXhYVsu2RYX11YnjhMIrFxlSVA+0E0aOHg2tkEgaVlD4b77G45MODskJz8J+82dGtl5b 5ijMwREesUzRCju/NCcwDbJH7lTHz/vyvRWo4jEBn7PD1gykbkKIOlGMxtG5zC5I/Y75 R3hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=qxgWthsSczjYm5g7wCu6D6tqthzuV0FTUO3+NeUn/Bo=; b=e+jRDEdUDYQ7knUANivpXClYTS0Ojxac0ha8oqwoQL6MpN5GvYBABAxv9G4g3CFxHt VdiT73vioccE6wd6QZejSVlFsWnv+5NaYhOWPCwvd28zaHrKeSWoAxr0Mp5iFpFswLj6 Lo8QGCDJ0eCFz1p48W9aGMLildQHJ/nDHTMowHoDxOMN/BEqEbUn9hw5HyOi6DXRjXUV I5svUCq9vlTVEUT1jHi2pMENHMp3mnWsEWgudbDx/RikAdI06BX2K44eFfZxPLQbRdQ0 UNu8D8Y2NHH4QodZoALuJI4JuIHxeSMuFSObbFkvbTp15Q6EYEq7cXpIvUXMW7w9OWWi H9jw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z17si3070411pgv.485.2019.05.24.02.41.16; Fri, 24 May 2019 02:41:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390409AbfEXJhm (ORCPT + 99 others); Fri, 24 May 2019 05:37:42 -0400 Received: from mail-qk1-f196.google.com ([209.85.222.196]:35066 "EHLO mail-qk1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390391AbfEXJhl (ORCPT ); Fri, 24 May 2019 05:37:41 -0400 Received: by mail-qk1-f196.google.com with SMTP id c15so6489486qkl.2 for ; Fri, 24 May 2019 02:37:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qxgWthsSczjYm5g7wCu6D6tqthzuV0FTUO3+NeUn/Bo=; b=FW3xlPK7UheSy/4NLcLlMLCuacrb/ABhiQY1cN1EB3E7kzQlcPCnSrpFu382ItMJ3V Z5KDSSqgQ0aQAsSipgQlS/K1D8Zk/XKNOX2VmBGesEb4wItynkJpGsJ03UPFpXnhs9pR xqhQNyUv60E0toM+GCuIsS0bbp2ReqHMoVfJ72AeoEC0dt+wij901eXssB7MVfY9eMIv XRCRaG1XY5pABV/lHigYH62V0mjaGpumVfd0q3rg7H8Xg+Q31chHyVWIyI107dTQ9QjT ZnLbL2Uf0Fc4bZGKATj2jzfo74Q8mhYEQVhJ5fu6nnBUHhpyERVb2Nga+wBxQxx3TOFE MnpA== X-Gm-Message-State: APjAAAV2VimiPozJpLP2+1+0DNghfq6M1/DMR8SsosTA2hiH1Cj58HHZ bKV+7no5BUOoCFS1LLI83TLkyriHns2WMKgSkUDfqA== X-Received: by 2002:ac8:2998:: with SMTP id 24mr61772494qts.31.1558690660552; Fri, 24 May 2019 02:37:40 -0700 (PDT) MIME-Version: 1.0 References: <20190521132712.2818-1-benjamin.tissoires@redhat.com> <20190521132712.2818-9-benjamin.tissoires@redhat.com> In-Reply-To: <20190521132712.2818-9-benjamin.tissoires@redhat.com> From: Benjamin Tissoires Date: Fri, 24 May 2019 11:37:29 +0200 Message-ID: Subject: Re: [PATCH v2 08/10] Input: elan_i2c - export true width/height To: Dmitry Torokhov , KT Liao , Rob Herring , Aaron Ma , Hans de Goede Cc: "open list:HID CORE LAYER" , lkml , devicetree@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 21, 2019 at 3:28 PM Benjamin Tissoires wrote: > > The width/height is actually in the same unit than X and Y. So we should > not tamper the data, but just set the proper resolution, so that userspace > can correctly detect which touch is a palm or a finger. > > Signed-off-by: Benjamin Tissoires > > -- > > new in v2 > --- > drivers/input/mouse/elan_i2c_core.c | 11 ++++------- > 1 file changed, 4 insertions(+), 7 deletions(-) > > diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c > index 7ff044c6cd11..6f4feedb7765 100644 > --- a/drivers/input/mouse/elan_i2c_core.c > +++ b/drivers/input/mouse/elan_i2c_core.c > @@ -45,7 +45,6 @@ > #define DRIVER_NAME "elan_i2c" > #define ELAN_VENDOR_ID 0x04f3 > #define ETP_MAX_PRESSURE 255 > -#define ETP_FWIDTH_REDUCE 90 > #define ETP_FINGER_WIDTH 15 > #define ETP_RETRY_COUNT 3 > > @@ -915,12 +914,8 @@ static void elan_report_contact(struct elan_tp_data *data, > return; > } > > - /* > - * To avoid treating large finger as palm, let's reduce the > - * width x and y per trace. > - */ > - area_x = mk_x * (data->width_x - ETP_FWIDTH_REDUCE); > - area_y = mk_y * (data->width_y - ETP_FWIDTH_REDUCE); > + area_x = mk_x * data->width_x; > + area_y = mk_y * data->width_y; > > major = max(area_x, area_y); > minor = min(area_x, area_y); > @@ -1123,8 +1118,10 @@ static int elan_setup_input_device(struct elan_tp_data *data) > ETP_MAX_PRESSURE, 0, 0); > input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, > ETP_FINGER_WIDTH * max_width, 0, 0); > + input_abs_set_res(input, ABS_MT_TOUCH_MAJOR, data->x_res); > input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, > ETP_FINGER_WIDTH * min_width, 0, 0); > + input_abs_set_res(input, ABS_MT_TOUCH_MINOR, data->y_res); I had a chat with Peter on Wednesday, and he mentioned that this is dangerous as Major/Minor are max/min of the width and height. And given that we might have 2 different resolutions, we would need to do some computation in the kernel to ensure the data is correct with respect to the resolution. TL;DR: I don't think we should export the resolution there :( KT, should I drop the patch entirely, or is there a strong argument for keeping the ETP_FWIDTH_REDUCE around? Cheers, Benjamin > > data->input = input; > > -- > 2.21.0 >