From patchwork Tue Jul 11 17:02:18 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 9835279 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4D0BF602BD for ; Tue, 11 Jul 2017 17:02:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3BF8026E56 for ; Tue, 11 Jul 2017 17:02:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 307F72857F; Tue, 11 Jul 2017 17:02:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C1B226E56 for ; Tue, 11 Jul 2017 17:02:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932822AbdGKRCd (ORCPT ); Tue, 11 Jul 2017 13:02:33 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35361 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755585AbdGKRCc (ORCPT ); Tue, 11 Jul 2017 13:02:32 -0400 Received: by mail-pf0-f195.google.com with SMTP id q85so631468pfq.2; Tue, 11 Jul 2017 10:02:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=vQytfgxa7SxpnmzVzGeCUpGbe8XkcI7iK0WAAzquN64=; b=mur2gPYGRto6kVLLJK01L96xPl1cOtEXMU0Q65s5p0LZw0DUnEg7SOozcECvKr6epb AJmRM+KN28055RS0hBkvU5RE+etcnH+IofuIn8Fdk2RcmCsU0oYvaFXiRbRCMC3g/M7C GeW3ZhpvSZ/ozWWv7UtMKFMfMbxBVPHmICy7dUImDDs1wbNxWdTjCwO4+j0gA4l+zCpm ptGsOPTzdPjOotF8tnQ4IZpNIZ/L+WjvDywkXt3vQOhsbyGzXzF2H3L3lqlJmCugPqw6 TTy9GCk3MfRQ4hRceI135Luy2WYRml3AVyHfQsHT7xjQ0Snm3Jc7sW1mHM9GHCIj7bG4 vWGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=vQytfgxa7SxpnmzVzGeCUpGbe8XkcI7iK0WAAzquN64=; b=MlFQoakqs3YoblFo8fcYxJTB1cC/O1JCfspDJ8doT6+LDO1vLPGXCIw0T6Y+jx5Y63 l9EFvoIrWwgivzE+uiTB6h296eBJELPYaZ/Y2U3/4ufoWGMEU+ZrPgBNi959NHke5nNC RuIFYnsGh+WsSlq1Jif/K/4YfIP+vSJpDQUabyHvFVRdZ/ZS84/EI+MKoGOrTDLCKZR3 AtYYijUzCjrmfYaE6tB+Jg6WbFbruo2jRDFs2JWeaN4ut184BeUTT69hEIT/rJZ2zJon QPSgeYrQx10cqdB6lxTGc1is7XqQ61HgALpx5Tbp0pmUfyYkgmkyzS8XoLQcxlCU2eS9 0IAA== X-Gm-Message-State: AIVw1139L+0ihs2VpHPmstNRAFjJrEmjDKvTHYnFTku+5ydwEVGh2N+p jP2MmCLdKA2jRQ== X-Received: by 10.84.217.198 with SMTP id d6mr905859plj.45.1499792541435; Tue, 11 Jul 2017 10:02:21 -0700 (PDT) Received: from dtor-ws ([2620:0:1000:1311:fd54:cce0:da2:adc9]) by smtp.gmail.com with ESMTPSA id x85sm757950pff.92.2017.07.11.10.02.20 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 11 Jul 2017 10:02:20 -0700 (PDT) Date: Tue, 11 Jul 2017 10:02:18 -0700 From: Dmitry Torokhov To: Jiri Kosina , Benjamin Tissoires Cc: Matthias Fend , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] HID: multitouch: do not blindly set EV_KEY or EV_ABS bits Message-ID: <20170711170218.GA30175@dtor-ws> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Now that input core insists on having dev->absinfo when device claims to generate EV_ABS in its dev->evbit, we should not be blindly setting that bit. The code in question might have been needed before input_set_abs_params() started setting EV_ABS in device's evbit, but not anymore, and is now breaking devices such as SMART SPNL-6075 Touchscreen. Fixes: 6ecfe51b4082 ("Input: refuse to register absolute devices ...") Reported-by: Matthias Fend Tested-by: Matthias Fend Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov Reviewed-by: Benjamin Tissoires --- Jiri, Benjamin, I marked it for stable as it causes regressions in 4.12 reported by users. Please take a look. drivers/hid/hid-multitouch.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c index 24d5b6deb571..be5bea15ce52 100644 --- a/drivers/hid/hid-multitouch.c +++ b/drivers/hid/hid-multitouch.c @@ -595,16 +595,6 @@ static int mt_touch_input_mapping(struct hid_device *hdev, struct hid_input *hi, return 0; } -static int mt_touch_input_mapped(struct hid_device *hdev, struct hid_input *hi, - struct hid_field *field, struct hid_usage *usage, - unsigned long **bit, int *max) -{ - if (usage->type == EV_KEY || usage->type == EV_ABS) - set_bit(usage->type, hi->input->evbit); - - return -1; -} - static int mt_compute_slot(struct mt_device *td, struct input_dev *input) { __s32 quirks = td->mtclass.quirks; @@ -905,8 +895,10 @@ static int mt_input_mapped(struct hid_device *hdev, struct hid_input *hi, return 0; if (field->application == HID_DG_TOUCHSCREEN || - field->application == HID_DG_TOUCHPAD) - return mt_touch_input_mapped(hdev, hi, field, usage, bit, max); + field->application == HID_DG_TOUCHPAD) { + /* We own these mappings, tell hid-input to ignore them */ + return -1; + } /* let hid-core decide for the others */ return 0;