Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp798355ybi; Sun, 30 Jun 2019 00:20:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzGznY/Nnp01msymlw7WVpmBaX5mbJCfLOr2Hk5UIL1TYhDdtjxD6moCcNWdcPxO9G0Pm4Z X-Received: by 2002:a63:de50:: with SMTP id y16mr18019124pgi.431.1561879252801; Sun, 30 Jun 2019 00:20:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561879252; cv=none; d=google.com; s=arc-20160816; b=MR3zbYFW6fxzpIhZfY2MPUgtJCUY2WkO78dVSoWqKxJ42Bg8apJkvqGh3w505+YUKA fcbAKAL0c/42+cwdzowjgngjquSXUWSxUi/vxZUcxouAh5WbYy37w9G2Qj9Vma/Ls480 ZzdKozWc1J9zSVqwGhVxKAsiRqbHMYieWc/PIkoI1Ey1Cm+lC+Gqzor73PlLHCZXQily hCbQ7JDb/ME07bsg1joU4HaVNsBkV6iZABHPaH/kxqdbI3vI9ulbiKnKZ4T1N/v7kq0+ 8VbeJhqfHLMoPD01wlD3ajLXWmlPvIVaBJq88nI9bIj+sdoEdlC7atzzHwuqUQqj9KcK WICw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=lqmewgLdox3q6xeJleJbddpt+EE2+zPuCoLU7Opy5NU=; b=AN8WUIipJhijo/uaA3Qh4MIprIxFZ3VEZYLIiJQLk/Kp2qefqPymze46v2e+yBRo5D kB1+SzTyM2E2Y6my3f4wNjHAs10eUOxqSnJPXApFed4lG2sD1cSo/631CD+MroSd472/ iX4Ak/MJiAu2ENxZWG7dUv2EdkN/GUMc91k+49TDSEC2zsAiUe67erzeSOZrOoZC+x0g xWtVcf7KALYJfz0iAMrFu8lz6Q2dNwkKwJb1+XnV6KEPMY6dP2W34fLakJFRutwQrl62 PoGe8P/t6EzqHZbJd6TbDfOtMhsBA4M4gBvBQLnms8Xma0s0FsYgdHYxcjM059OKWELe 3M/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=efWyaDxl; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a10si7515283pfc.55.2019.06.30.00.20.36; Sun, 30 Jun 2019 00:20:52 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=efWyaDxl; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbfF3HTD (ORCPT + 99 others); Sun, 30 Jun 2019 03:19:03 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:40177 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725959AbfF3HTD (ORCPT ); Sun, 30 Jun 2019 03:19:03 -0400 Received: by mail-pf1-f194.google.com with SMTP id p184so4997089pfp.7; Sun, 30 Jun 2019 00:19:02 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=lqmewgLdox3q6xeJleJbddpt+EE2+zPuCoLU7Opy5NU=; b=efWyaDxla4encwtVoRQlQMgzCCy1yi9jsLij1Mj7K2vjKBK6SiQXu1lY3DhcfakNjx XI2MXwwdeNce4iLXPk9TD3vhIOknXMbUWiMd3dkncW2LDID6UFwrwfnKYMjybMiVPkI8 JGqCzfEYkvUG7OXgnjphZ0KMNmhGBTVudIB5NPMdIyiq8Co6Eu43vIdVYD3zSYoRu/2w cdo+SPbBYixsF9i7cs+hnQ3JJvkc8MwB9BtI2plvpG4J62o1UjS2rlK4p2NV+sBSbtV5 hQMtUA1qE0Kfu/L846Df0zH129iNWzhQQLoYdCjqS38EA4wlJ5UDN7ZK574gvageYbcG 4CUA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=lqmewgLdox3q6xeJleJbddpt+EE2+zPuCoLU7Opy5NU=; b=g6lhQGr6FTlIXhcAWUZ8MFftUjGoNXK29CcY7J479nAuwRmqX4VIZv8dzm5hgJy1n7 v9rq/UYe75f/5n8m8MiKf7+hA0AoejIQRDnXSZtGIvudmr/5PN+ClEEFhN/B3qRiekoU V1h+cf16jIpxPSs2l8v9SxQWCy+crYhYaqecqPiNTGjHE1HHGh7JAcwUgwIktWXdH0yO tahsIiXIGnnv8C+EsaYhojH85eEZdD9FhXaPMd/wqIoIicyBfvVJaBYreOk6VjlScONU T6sbYqAacr7Ag12m/UqHD6GP3xBTSzvdYgKj3DIWPSyKYuV2nt8/LEihsMQyp+ZEHEx4 sPlw== X-Gm-Message-State: APjAAAWKlK/yPGIhA+RIDPcx5TY8KLzKTtV+pyQy2Xm0IHeIIk6iZNtJ YswbN8hvKE5AFzsOfdAzPts= X-Received: by 2002:a17:90a:ff17:: with SMTP id ce23mr561811pjb.47.1561879142087; Sun, 30 Jun 2019 00:19:02 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id s20sm6386360pfe.169.2019.06.30.00.19.01 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Sun, 30 Jun 2019 00:19:01 -0700 (PDT) Date: Sun, 30 Jun 2019 00:18:59 -0700 From: Dmitry Torokhov To: Jeffrey Hugo Cc: benjamin.tissoires@redhat.com, jikos@kernel.org, hdegoede@redhat.com, bjorn.andersson@linaro.org, agross@kernel.org, lee.jones@linaro.org, xnox@ubuntu.com, robh+dt@kernel.org, mark.rutland@arm.com, linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v8 2/5] HID: quirks: Refactor ELAN 400 and 401 handling Message-ID: <20190630071859.GD91171@dtor-ws> References: <20190621144854.38568-1-jeffrey.l.hugo@gmail.com> <20190621145312.38688-1-jeffrey.l.hugo@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190621145312.38688-1-jeffrey.l.hugo@gmail.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jun 21, 2019 at 07:53:12AM -0700, Jeffrey Hugo wrote: > There needs to be coordination between hid-quirks and the elan_i2c driver > about which devices are handled by what drivers. Currently, both use > whitelists, which results in valid devices being unhandled by default, > when they should not be rejected by hid-quirks. This is quickly becoming > an issue. > > Since elan_i2c has a maintained whitelist of what devices it will handle, > which is now in a header file that hid-quirks can access, use that to > implement a blacklist in hid-quirks so that only the devices that need to > be handled by elan_i2c get rejected by hid-quirks, and everything else is > handled by default. > > Suggested-by: Benjamin Tissoires > Signed-off-by: Jeffrey Hugo > Acked-by: Benjamin Tissoires Applied, thank you. > --- > drivers/hid/hid-quirks.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c > index e5ca6fe2ca57..48ed4caf0ebc 100644 > --- a/drivers/hid/hid-quirks.c > +++ b/drivers/hid/hid-quirks.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > > #include "hid-ids.h" > > @@ -914,6 +915,8 @@ static const struct hid_device_id hid_mouse_ignore_list[] = { > > bool hid_ignore(struct hid_device *hdev) > { > + int i; > + > if (hdev->quirks & HID_QUIRK_NO_IGNORE) > return false; > if (hdev->quirks & HID_QUIRK_IGNORE) > @@ -978,18 +981,15 @@ bool hid_ignore(struct hid_device *hdev) > break; > case USB_VENDOR_ID_ELAN: > /* > - * Many Elan devices have a product id of 0x0401 and are handled > - * by the elan_i2c input driver. But the ACPI HID ELAN0800 dev > - * is not (and cannot be) handled by that driver -> > - * Ignore all 0x0401 devs except for the ELAN0800 dev. > + * Blacklist of everything that gets handled by the elan_i2c > + * input driver. This avoids disabling valid touchpads and > + * other ELAN devices. > */ > - if (hdev->product == 0x0401 && > - strncmp(hdev->name, "ELAN0800", 8) != 0) > - return true; > - /* Same with product id 0x0400 */ > - if (hdev->product == 0x0400 && > - strncmp(hdev->name, "QTEC0001", 8) != 0) > - return true; > + if ((hdev->product == 0x0401 || hdev->product == 0x0400)) > + for (i = 0; strlen(elan_acpi_id[i].id); ++i) > + if (!strncmp(hdev->name, elan_acpi_id[i].id, > + strlen(elan_acpi_id[i].id))) > + return true; > break; > } > > -- > 2.17.1 > -- Dmitry