Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4250644imm; Wed, 30 May 2018 01:54:32 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIF8QlcdgAjX5FY79Qnh7N/XiiKp97JSopVvN3J3n6jviYhs/XPKA8gjBCSzzU7FtPuTSIu X-Received: by 2002:a63:ad46:: with SMTP id y6-v6mr1545825pgo.10.1527670472315; Wed, 30 May 2018 01:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527670472; cv=none; d=google.com; s=arc-20160816; b=sATVzjKXHqiiQXRt2nvWb/r6MUdfwjFqGG1iaJBNCMWGg/F67E4KefRiCN3t9PdeoD s/nZnA+YvbjVFbwm7vHwKOO545UHiA3CTH2QB1nEEy63Q79wtBkx/Pt8nfYxkZsQ9GyS ULAx1ukg4UiJRRw7ngl3HrJIwgEngjnpFC3l33WIHfJ6S9wfY3bX0bNazhq6EqPqnQzB wd/HOsYKLIbvYadCBMyLKSOwn6Gr0VdZGLWjapvIy5MSA8a5VypM90bOwS2+36Rxh7iJ 2wm3FvRmAobHjILzrRN8nYoZStBsh9KYCrQYAwzqc1NCk6Ta+xyIrFvhrv25r7XMxWFT xYiQ== 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 :references:in-reply-to:mime-version:arc-authentication-results; bh=So3wmiXPaVgZGRTmTyP5+suYyezPiF44SOsVCfbHZps=; b=FZ1WKPOuw6RpBwSAaLNNLRHf9reKRjq8jkPQbM301m7PJVNyEvWR2Ia3Bjcl65O11x sS4bRyfTIXhG4KVbOerysBXqtKRORzWDKPznxftz0o5WviTiagTyrIa2fXnOgQVQx/v0 4dRcL4SCoToDt+EQiyHlAJcBeaZn+4lrvRejg0BPAIYAYW4tWrRoW0xhfj5qsgIJ8Vaj fLIVRaWAMjFpyJP3oGsxXsdeudBVHtVvqXCvLCus4LD5hUoTFNEFedQUx+U0ehe9fGUP G8anJ0kpzSyiq5Zba/6VfxRGXKXsu7zGAwrPrk2CDWTN4hLcEczKbAfkj74tl6QwzPaz kHzQ== 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 z7-v6si11015904pfn.247.2018.05.30.01.54.18; Wed, 30 May 2018 01:54:32 -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 S968728AbeE3Ixc (ORCPT + 99 others); Wed, 30 May 2018 04:53:32 -0400 Received: from mail-qt0-f193.google.com ([209.85.216.193]:39212 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965157AbeE3IxZ (ORCPT ); Wed, 30 May 2018 04:53:25 -0400 Received: by mail-qt0-f193.google.com with SMTP id f1-v6so22277705qtj.6 for ; Wed, 30 May 2018 01:53:25 -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:in-reply-to:references:from:date :message-id:subject:to:cc; bh=So3wmiXPaVgZGRTmTyP5+suYyezPiF44SOsVCfbHZps=; b=r5mKq4DU5r9nq9nMPB46CUj3QOk4ZplwkEuOI1jnPcD5rgVWIi5cgN6QMWc+nEkXWF I5zhmd8JZRol6wqj/FOk3sZhpnLQ6IIPNODOf8DZohhoY6WApFtr9/Ay3gJ2xosacjwY TAXIRs0W5zFrsGX0WzSei1tzIqJacmbEDQ7BDWKOpYtQ3xgHe1veiSu6nI7mz7UyQucI alR24EJC2VDMcMA/hk0CDnLM/Oyoos/r8eV3Yzia9GoQgLCricxsNCmS4GnlBu9yNZzL feBLB8glEWwAMbsyjhsEVPqkpdXdWHC8YKLm6UtV9iaeT8G6umWsSZgYdUpxXJ4nsItQ oYbw== X-Gm-Message-State: APt69E07gts6LKUnDr4US00DJAXgjgnBXoKDUfKXPR3ikcZMKNbYIrmB 9ZwEeBxogDPAQvJ8/wsylj2HGtBlNYWbonZuWuT4tA== X-Received: by 2002:a0c:92a2:: with SMTP id b31-v6mr1571959qvb.185.1527670404739; Wed, 30 May 2018 01:53:24 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:aed:2bc7:0:0:0:0:0 with HTTP; Wed, 30 May 2018 01:53:24 -0700 (PDT) In-Reply-To: <20180529182107.GC167092@dtor-ws> References: <20180529095800.13504-1-benjamin.tissoires@redhat.com> <20180529095800.13504-2-benjamin.tissoires@redhat.com> <20180529182107.GC167092@dtor-ws> From: Benjamin Tissoires Date: Wed, 30 May 2018 10:53:24 +0200 Message-ID: Subject: Re: [PATCH 1/9] Input: mt - export MT_TOOL in input_mt_init_slot() To: Dmitry Torokhov Cc: Jiri Kosina , Mario.Limonciello@dell.com, Peter Hutterer , "open list:HID CORE LAYER" , lkml 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 Hi Dmitry, On Tue, May 29, 2018 at 8:21 PM, Dmitry Torokhov wrote: > Hi Benjamin, > > On Tue, May 29, 2018 at 11:57:52AM +0200, Benjamin Tissoires wrote: >> Looks like we require users to set a tool but input_mt_init_slots() never >> set the tool bit for us. Meaning that this is a useless information the >> driver tries to forward. > > I am not sure if I agree with this patch: up until now drivers could > decide if they export presence of the tool type to userspace and > userspace could distinguish between "pure" touchscreens and touchscreens > that support additional tools, such as stylus. Now we unconditionally > claim that all multi-touch devices support multiple tools. > > The fact that we were dropping MT_TOOL_TYPE for devices that do not > support anything but finger I'd consider a "feature". OK. I was not sure to agree with this, but I had a quick chat with Peter and he also agrees. There is no real point in forwarding an event that will never be updated, so let's just skip that patch then. Expect this to be removed in v2 then. Cheers, Benjamin > >> >> Signed-off-by: Benjamin Tissoires >> --- >> drivers/input/input-mt.c | 1 + >> drivers/input/rmi4/rmi_2d_sensor.c | 2 -- >> drivers/input/touchscreen/atmel_mxt_ts.c | 2 -- >> drivers/input/touchscreen/hideep.c | 2 -- >> drivers/input/touchscreen/wacom_w8001.c | 2 -- >> 5 files changed, 1 insertion(+), 8 deletions(-) >> >> diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c >> index a1bbec9cda8d..3900686c5d0f 100644 >> --- a/drivers/input/input-mt.c >> +++ b/drivers/input/input-mt.c >> @@ -57,6 +57,7 @@ int input_mt_init_slots(struct input_dev *dev, unsigned int num_slots, >> mt->flags = flags; >> input_set_abs_params(dev, ABS_MT_SLOT, 0, num_slots - 1, 0, 0); >> input_set_abs_params(dev, ABS_MT_TRACKING_ID, 0, TRKID_MAX, 0, 0); >> + input_set_abs_params(dev, ABS_MT_TOOL_TYPE, 0, MT_TOOL_MAX, 0, 0); >> >> if (flags & (INPUT_MT_POINTER | INPUT_MT_DIRECT)) { >> __set_bit(EV_KEY, dev->evbit); >> diff --git a/drivers/input/rmi4/rmi_2d_sensor.c b/drivers/input/rmi4/rmi_2d_sensor.c >> index 8bb866c7b985..23e666bd2539 100644 >> --- a/drivers/input/rmi4/rmi_2d_sensor.c >> +++ b/drivers/input/rmi4/rmi_2d_sensor.c >> @@ -186,8 +186,6 @@ static void rmi_2d_sensor_set_input_params(struct rmi_2d_sensor *sensor) >> input_set_abs_params(input, ABS_MT_TOUCH_MAJOR, 0, 0x0f, 0, 0); >> input_set_abs_params(input, ABS_MT_TOUCH_MINOR, 0, 0x0f, 0, 0); >> input_set_abs_params(input, ABS_MT_ORIENTATION, 0, 1, 0, 0); >> - input_set_abs_params(input, ABS_MT_TOOL_TYPE, >> - 0, MT_TOOL_MAX, 0, 0); >> >> if (sensor->sensor_type == rmi_sensor_touchpad) >> input_flags = INPUT_MT_POINTER; >> diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c >> index 54fe190fd4bc..0dcf48100dc1 100644 >> --- a/drivers/input/touchscreen/atmel_mxt_ts.c >> +++ b/drivers/input/touchscreen/atmel_mxt_ts.c >> @@ -2021,8 +2021,6 @@ static int mxt_initialize_input_device(struct mxt_data *data) >> } >> >> if (data->multitouch == MXT_TOUCH_MULTITOUCHSCREEN_T100) { >> - input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, >> - 0, MT_TOOL_MAX, 0, 0); >> input_set_abs_params(input_dev, ABS_MT_DISTANCE, >> MXT_DISTANCE_ACTIVE_TOUCH, >> MXT_DISTANCE_HOVERING, >> diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c >> index f1cd4dd9a4a3..980539d8d551 100644 >> --- a/drivers/input/touchscreen/hideep.c >> +++ b/drivers/input/touchscreen/hideep.c >> @@ -799,8 +799,6 @@ static int hideep_init_input(struct hideep_ts *ts) >> input_set_capability(ts->input_dev, EV_ABS, ABS_MT_POSITION_Y); >> input_set_abs_params(ts->input_dev, ABS_MT_PRESSURE, 0, 65535, 0, 0); >> input_set_abs_params(ts->input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); >> - input_set_abs_params(ts->input_dev, ABS_MT_TOOL_TYPE, >> - 0, MT_TOOL_MAX, 0, 0); >> touchscreen_parse_properties(ts->input_dev, true, &ts->prop); >> >> if (ts->prop.max_x == 0 || ts->prop.max_y == 0) { >> diff --git a/drivers/input/touchscreen/wacom_w8001.c b/drivers/input/touchscreen/wacom_w8001.c >> index 3715d1eace92..946dca30560b 100644 >> --- a/drivers/input/touchscreen/wacom_w8001.c >> +++ b/drivers/input/touchscreen/wacom_w8001.c >> @@ -529,8 +529,6 @@ static int w8001_setup_touch(struct w8001 *w8001, char *basename, >> 0, touch.x, 0, 0); >> input_set_abs_params(dev, ABS_MT_POSITION_Y, >> 0, touch.y, 0, 0); >> - input_set_abs_params(dev, ABS_MT_TOOL_TYPE, >> - 0, MT_TOOL_MAX, 0, 0); >> input_abs_set_res(dev, ABS_MT_POSITION_X, touch.panel_res); >> input_abs_set_res(dev, ABS_MT_POSITION_Y, touch.panel_res); >> >> -- >> 2.14.3 >> > > Thanks. > > -- > Dmitry