Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp554994yba; Fri, 12 Apr 2019 08:50:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7x22FeqiF4FZQv1oe2J2qN3/tEDAV8dVohX8VP4QvwjS/po6BZZZWu4MKfcjEIsxieo75 X-Received: by 2002:a17:902:7885:: with SMTP id q5mr58813543pll.12.1555084250855; Fri, 12 Apr 2019 08:50:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555084250; cv=none; d=google.com; s=arc-20160816; b=i6QHLKf0hcg6dy0/RWE/4cdvJXPMBFwW6fLq+Wr6lDUQYpaT4XmpwvBiQ9DVJFooll 9MsaqQs2SRlFGFSiLbrwblAnNXVqYDA8WMHRwA9u3JfYO954ZEhBWKi57xXh9fuGFWcA SrabCvf2gVkQfE3fNeE0dD0XBo7eH++O1HpkV0qHti04+uYbMx3JI6LN6CSzyTNXKCPf lUcEo0VGKk7VjqZspCAtQ+2C53/FAsalM2VBpxWWjPtYNR7bA0XnVK/CirXp5I1emRcP uh3lIMjr3TtjzDd6s8U3L5ogTTFrQJa3OLhprC1VXY106Mj1Qd/hDWMPdxqVEHpH6pY/ Vzlw== 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:dkim-signature; bh=62MJGUeduydu1Zgjp6ip4dCzYUE9WOrom4X8KzkJ+XY=; b=zrIRepkfB9wzkL2OgPoXdh3AfTxMdWh1EjhbAP4o+VEglrJ3TbjQts7/S30nG5X3yi oVNFAF9RqzE0+GNCeQjOg3Nkd8FAZLuqUCFcqWR0OMJQZOfXMGJkLbkLZfA56Aj9MP0d qnXmGco+RMjfV6Ms2Ico1ueKBqFLZq0wryeubz/cvH4Pm9AzUdlS/z/DLkBUabmV147L 3tLfZmJNBCgM0Gaf6YIashNMVfMnW9gRpXBClulnM4DKIfBIYbYbKx+rfmDMFcTS2JYo 8Dtie0NrNus6z8xt8wetWFmWzlqgiUrHbeCK4iTDUV1GRBA3WGRxi93SdxQOZNqSRD3Q VPwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=VuY67WHH; 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 z31si38711012plb.333.2019.04.12.08.50.35; Fri, 12 Apr 2019 08:50:50 -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=VuY67WHH; 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 S1727065AbfDLPsa (ORCPT + 99 others); Fri, 12 Apr 2019 11:48:30 -0400 Received: from mail-io1-f66.google.com ([209.85.166.66]:35048 "EHLO mail-io1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726327AbfDLPs3 (ORCPT ); Fri, 12 Apr 2019 11:48:29 -0400 Received: by mail-io1-f66.google.com with SMTP id p16so8879547iod.2; Fri, 12 Apr 2019 08:48:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=62MJGUeduydu1Zgjp6ip4dCzYUE9WOrom4X8KzkJ+XY=; b=VuY67WHHCAPymKWAzQ7VNUULObIbSct6ERIKKYAfLhA6dD3TwG2kvmQCne2340Ywgm BQYMP45qB5SQoEJhGtY2CHOCL6qqIKlVSYSTCXCYz5E2o78V8quqHbxp47K2PQSGGYD2 eZjaVIOoC1lQSw5sTgAz87JwEFHZrduUqN7YDDKy6GPpHL55KtZIkav4XMjRhIh5PlWZ s6Cl9w6xeeXiZ1vgl892MmQ2/YJjQH0PpBJvprBSE058zGUqLtYfCEsfUHgewTgwb4bo PwuSTNc6o3A6u6lGHiU0k0JMEdjcZ7Z3dxeYOOvjWWS/jI6XbqIgsTngRN5tICkIFaTB sl0w== 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=62MJGUeduydu1Zgjp6ip4dCzYUE9WOrom4X8KzkJ+XY=; b=AxnViBESE4zV7h4mvLUtF0ehCrEqGphpnvnQ0cawrVwi6ClLAbV1PtPQtF/ewqjq+E 8O7qkvFZHRM6Awuz2ELRt6JUipRoYeXgC7IY3Um59eG6vK21L2wyKQSvqbCnMpdFncYt pnSd7GU898uMDmUXjRRcEg1OxVBA6i21+wXRJolYNqhZjFalYi+ewTTtotmlQNn+WejF fy2EdmvxDNfDUJRfBgrrUn9Ok2f3gr/G+Sqr6aqrFrlr5Q1bobbR1y9hiSdFjKweUb1z L6hPZ1DsDCJj/f0fJCaZHvW7MxKga6gIGBBzA0M/73jfuqHOkoE70c8R9/BFN8Ko0/VO Acow== X-Gm-Message-State: APjAAAVDKlSfyP/z5wtPD2a8yJBbXkh6OLClYX7bfPUfGd686OtNKF9T M5mmXx4uR5KkaxYgbHBt+Lb2cyyoJD1Ge15/KLY= X-Received: by 2002:a6b:8f96:: with SMTP id r144mr26990218iod.153.1555084108802; Fri, 12 Apr 2019 08:48:28 -0700 (PDT) MIME-Version: 1.0 References: <20190411205144.43557-1-jeffrey.l.hugo@gmail.com> <20190412144712.GA7481@lakrids.cambridge.arm.com> <20190412153040.GB7481@lakrids.cambridge.arm.com> In-Reply-To: <20190412153040.GB7481@lakrids.cambridge.arm.com> From: Jeffrey Hugo Date: Fri, 12 Apr 2019 09:48:17 -0600 Message-ID: Subject: Re: [PATCH v2] arm64: dts: qcom: Add Lenovo Miix 630 To: Mark Rutland Cc: bjorn.andersson@linaro.org, agross@kernel.org, David Brown , robh+dt@kernel.org, Lee Jones , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@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 Fri, Apr 12, 2019 at 9:30 AM Mark Rutland wrote: > > On Fri, Apr 12, 2019 at 09:19:18AM -0600, Jeffrey Hugo wrote: > > > > + keyboard@3a { > > > > + /* QTEC0001 is the ACPI HID, which could be used for quirks */ > > > > + compatible = "QTEC0001", "hid-over-i2c"; > > > > > > As mentioned last time, please drop the ACPI HID, and allocate a real > > > compatible string. > > > > So, I'm in a quandary with this device. As far as I can tell, its an > > off the shelf component, the device adheres to the "PNP0C50" spec (HID > > over I2C), and can be driven by the full "hid-over-i2c" driver (which > > is just a DT shim over the PNP0C50 ACPI driver). However, the device > > itself identifies itself as an ELAN 400 device, which is an ID that is > > also used for standalone touchpad devices. Per my understanding of > > the Linux drivers, there is a separate ELAN driver for the standalone > > touchpad devices as its been discovered though trial and error that > > the Linux PNP0C50 driver cannot drive those devices. To handle this, > > there is a quirk in hid-quirks which rejects ELAN 400 devices, except > > those which are "QTEC0001". > > > > We need that quirk bypass for this device because the ELAN driver > > cannot handle this device. > > This is useful context; thanks for writing this up! > > > I'd much rather have a single identifier to quirk on, rather than > > having one for DT and one for ACPI, and its not looking feasible to > > get the vendor to update the ACPI, so it seems like using the ACPI > > identifier is just simpler. > > > > So, if you want a different compatible string, I'll need to go put DT > > in a driver that is primarily ACPI. I'm not sure what the HID folks > > will think of that. > > My objection is that an ACPI HID is _not_ a DT compatible string, and > the two should be treated separately. Munging the two together opens the > door for other pain. > > The driver in question has a DT probe function, i2c_hid_of_probe, so > there's certainly a place to wire up that quirk. Except that isn't where HID quirks are handled. They are handled in drivers/hid/hid-quirks.c There is a table of vendor/device IDs of HIDs which need quirking. In hid_ignore(), there is provision to detect based on vendor/device and the device name, whether the device can be driven by the HID framework, or needs to be handled by a standalone driver. All the I2C HID DT driver is doing is filling in the vendor/device IDs (read from the hardware) into the HID framework struct. The device name seems to come from standard mechanisms. > > > I'll propose it, but what do you view is a > > "proper" compatible string? "ELAN0400-msm8998-clamshell"? > > A proper compatible string has a vendor-prefix, and is documented > somewhere in Documentation/devicetree/bindings. > > e.g. you could allocate something like: > > "qcom,msm8998-clamshell-hid-over-i2c" Ok, let me create a simple bindings file, propose to amend the hid-quirks to accept the DT string, and then have a v3 of the miix 630 dts all as one series to hopefully get everyone on the same page and happy with things.