Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp365760yba; Thu, 18 Apr 2019 02:37:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxPJ4/M5igbneAadnjkCe+7wRbp6NLlAfTW0uvU9ZrqiFLd2uiCLHkwxVpiQgbosPvVzrah X-Received: by 2002:a17:902:56e:: with SMTP id 101mr44137728plf.142.1555580240701; Thu, 18 Apr 2019 02:37:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555580240; cv=none; d=google.com; s=arc-20160816; b=D32chReDsDOeQ0nFddV0dyTrDTnbt6LlF5dum3I6ASoWrLZ35JTm3AMJzEgOI4ygBz Qq2cEUfB1JSmXNSbomaAiLJELex/2QctrafktBpr83A98hX3tjVSV0QqWmk5qLENSjyg V8tQzPXS5ayk1xd2b698nNuS+vEJjONVZHTE8zWBySXwV+ytNZE4+D23XBD8sZ96B3gS IxlZCQbCUzEBQ1mRppr49EaYuUPoHAE8uhEu+OwhC7zmC6pJD/WG9bflG+JejcESbUdW s6hoewTbeBKi8g+HkPWONjX0E0Kpye1rkoFS1yEeGWbQJ1h0Xo1DCs3fdPhgpx8pYX6o rEnQ== 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=AH2jzuxgQkHCo2L+2wZAXOkBXc1bgQpke4ii6ID2BoY=; b=l5vL36Vg+QUZKSlgpuUykrMKXpmoAJyNWp+LFTGH4EsNpnS7BDIlxjtRyO3FAWCXXW 2KU6m5ZuPbKnqdgGLHeOhSWGvWlWqjr8uyoGcj9kx8dxbFtZmaiNBEwUg7IMPrWoOnBZ enu1ASHJxZ6LmZ8UYrrUaOjUC2O6J6EwjAEnwzDIyNgXCA7ArAxwV3wC0Usu3NnNp6ev 1mLu1cAuaD8KBUZY4iNsVF9sn0J0bz4nMxOmiZ3QVt8pNV+x5pu7M1MtgSAGMjDzYzn/ vFV+6Opca3YCr23vMG4iZLrqAc1dt6yNWVVnZMqXeuP1YlzCph05vzjhpwmsegZOYyOD QXeA== 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 g1si1418510pgq.268.2019.04.18.02.37.05; Thu, 18 Apr 2019 02:37:20 -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 S2388434AbfDRJfA (ORCPT + 99 others); Thu, 18 Apr 2019 05:35:00 -0400 Received: from mail-qt1-f193.google.com ([209.85.160.193]:40395 "EHLO mail-qt1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388346AbfDRJfA (ORCPT ); Thu, 18 Apr 2019 05:35:00 -0400 Received: by mail-qt1-f193.google.com with SMTP id x12so1434583qts.7 for ; Thu, 18 Apr 2019 02:34:59 -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=AH2jzuxgQkHCo2L+2wZAXOkBXc1bgQpke4ii6ID2BoY=; b=R+gYijRyXqOPl2u2YyiZ67ewAzVjodQt5egzDfw2lD7WUhDCLXZSfT2NYrMchiAFSz N8JgkvVGVlyDpyN7aXTWLmX95g4OlWKyt6w8BVqlE5jzHonL16RcNfK3Ebsvrh+AdDD2 gI+f5Exzd7ASeZmyF3LG0DLciV5t4X+VudENx7HPSfzZOTJXaBNEW4nJFawY3HOvfryV P5mYWNWdzo26c1zqpd5NhDaM+9PGHk1pcsdhrZj7e6ZZegKWBV7Q3nOnovEcDdezcC5z nEBYMRTUwfnnqZHWJ3EXqi2AcpVBgFR54d+oPnP/rTjJtcZEFU6o7ucsYiKxi8uyziWY vGSQ== X-Gm-Message-State: APjAAAUDWsmCsqaM6bk+bjXLnQDhlrQo5Mx6MNnxoZc096lBDKXeB8P9 n/Yjty/GQn9enoMRw7b8ZdH2w2M1v/4R0hEkWyqkyg== X-Received: by 2002:ac8:24cf:: with SMTP id t15mr79009585qtt.112.1555580099339; Thu, 18 Apr 2019 02:34:59 -0700 (PDT) MIME-Version: 1.0 References: <20190415160915.16324-1-jeffrey.l.hugo@gmail.com> <20190415161108.16419-1-jeffrey.l.hugo@gmail.com> In-Reply-To: <20190415161108.16419-1-jeffrey.l.hugo@gmail.com> From: Benjamin Tissoires Date: Thu, 18 Apr 2019 11:34:47 +0200 Message-ID: Subject: Re: [PATCH v3 2/3] HID: quirks: Fix keyboard + touchpad on Lenovo Miix 630 for DT To: Jeffrey Hugo , Hans de Goede Cc: Rob Herring , mark.rutland@arm.com, Jiri Kosina , Lee Jones , bjorn.andersson@linaro.org, Dmitry Torokhov , agross@kernel.org, david.brown@linaro.org, "open list:HID CORE LAYER" , devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, 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 On Mon, Apr 15, 2019 at 6:11 PM Jeffrey Hugo wrote: > > Following up on commit 2bafa1e96254 ("HID: quirks: Fix keyboard + touchpad > on Lenovo Miix 630"), the devicetree (DT) identifier for the combo keyboard > + touchpad device is "elan,combo400-i2c", which differs from the ACPI ID, > thus if we want the quirk to work properly when booting via DT instead of > ACPI, we need to key off the DT id as well. > > Signed-off-by: Jeffrey Hugo > --- > drivers/hid/hid-quirks.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c > index 77ffba48cc73..00c08f8318b8 100644 > --- a/drivers/hid/hid-quirks.c > +++ b/drivers/hid/hid-quirks.c > @@ -997,7 +997,8 @@ bool hid_ignore(struct hid_device *hdev) > return true; > /* Same with product id 0x0400 */ > if (hdev->product == 0x0400 && > - strncmp(hdev->name, "QTEC0001", 8) != 0) > + (strncmp(hdev->name, "QTEC0001", 8) != 0 || > + strncmp(hdev->name, "elan,combo400-i2c", 17) != 0)) I think we are taking the problem the wrong way here. When I first introduced 6ccfe64, I thought 0x0400 would be reserved for the elan_i2c touchpads only. But it turns out we are deliberately disabling valid HID touchpads hoping that they would be picked up by elan_i2c when elan_i2c has its own whitelist of devices. How about we turn this into list with the matching ones from elan_i2c: if ((hdev->product == 0x0400 || hdev->product == 0x0401) && (strncmp(hdev->name, "ELAN0000", 8) == 0 || strncmp(hdev->name, "ELAN0100", 8) == 0 || ... strncmp(hdev->name, "ELAN1000", 8) == 0)) return true; So next time we need to force binding a HID touchpad to elan_i2c, we can just blacklist here and whitelist it in elan_i2c. Cheers, Benjamin > return true; > break; > } > -- > 2.17.1 >