Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3404325img; Mon, 25 Mar 2019 09:35:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfBd8vg9EyCzaZVyvIdPvzxcGtG5m/IvQLWn6njY5siovuYe3Lcb2OW9IM+ft7gQKEIP9r X-Received: by 2002:a63:2c4c:: with SMTP id s73mr24635261pgs.113.1553531729091; Mon, 25 Mar 2019 09:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553531729; cv=none; d=google.com; s=arc-20160816; b=d21po9SdX+XYdSrzx3KUE2rLzEW5R3F/ira4B42uULJgt9MSKW4vvgUTOzixtAFJfG CHH3q4GFs3OgwGZdpQPXjJs3JVSb8420OWmI3L03dekFUc/QZYhUSC/xaMSANfEYU8r0 gapFQo9tBu8CYLqjzDr85998bN0pcTl3ttG1bt3XRZWWyk8zHRbcPLjtHFByMVv4xSuY J3TDsc1T57Xemd0Eq2XjkSSf7p5jl5PPfshXMK23IAz725FmJFO5VfAAgTHJmtSE94oy DeSGpKnXlJL2AhGRbI6U6N2pOuQDXGZFwICgoCpqOQkGaOruhKkZGBN8PqXT/9XfRCub JODg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=2Kx2z1Tx8bVmiCM224yiJz20H/MHHg8RchmwidiEKM8=; b=uQ3lHXB1EVzf/GMAMUZV5VKi8E1PX24L/ejzl7Iftb8dJgHjQkVUwrYwDTn3364PZw tU8GKVm4p+YYGsXCi+RdUCztdQ2YR6EJAP8esQiuk/kM40uAbq4C4Fn8Rz2AgV4jeFZU 46bm3ijPmab1vwXmnJLrTUV1242nCDuDNr+NzwAugh2I50oNb19pnPUA8Ilz1O/s/9OR j/YD9svdYm7XNyQg3KdNLNN9LPbPkZeUAyuu30HFa3Ujx9opWhiH+rieim1wmgwkNQP6 5xBbKqz21KQvWMpZ55RTXR6q6PS3KoIHaA4rFACr11KMwZZaOqgOLke8XOQKcCBZ09cW Wr2A== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 193si3596631pfv.108.2019.03.25.09.35.13; Mon, 25 Mar 2019 09:35:29 -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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729779AbfCYQe1 (ORCPT + 99 others); Mon, 25 Mar 2019 12:34:27 -0400 Received: from mga14.intel.com ([192.55.52.115]:21592 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729106AbfCYQe0 (ORCPT ); Mon, 25 Mar 2019 12:34:26 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Mar 2019 09:34:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,269,1549958400"; d="scan'208";a="137134913" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga003.jf.intel.com with ESMTP; 25 Mar 2019 09:34:24 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1h8SYJ-0007uY-59; Mon, 25 Mar 2019 18:34:23 +0200 Date: Mon, 25 Mar 2019 18:34:23 +0200 From: Andy Shevchenko To: Thomas Preston Cc: rjw@rjwysocki.net, lenb@kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, mika.westerberg@linux.intel.com Subject: Re: [PATCH v2] Documentation: acpi: Add an example for PRP0001 Message-ID: <20190325163423.GJ9224@smile.fi.intel.com> References: <20190325151210.23226-1-thomas.preston@codethink.co.uk> <20190325153032.GG9224@smile.fi.intel.com> <3ae33d42-1175-bdbe-036b-1df5edc6a802@codethink.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3ae33d42-1175-bdbe-036b-1df5edc6a802@codethink.co.uk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo 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 Mon, Mar 25, 2019 at 03:58:13PM +0000, Thomas Preston wrote: > On 25/03/2019 15:30, Andy Shevchenko wrote: > > On Mon, Mar 25, 2019 at 03:12:10PM +0000, Thomas Preston wrote: > > > Add an example for the magic PRP0001 device ID which allows matching > > > ACPI devices against drivers using OF Device Tree compatible property. > > > > > It wasn't clear to me that PRP0001 could be used in _CID. > > > > Yes, but it's not necessary to have it if we have defined a _HID. > > > > In that case PRP0001 is a temporary stub until corresponding driver > > incorporates an official _HID. > > > > On the contrary, when there is no official _HID available, PRP0001 can be used > > instead directly as a _HID and no _CID is needed. > > > > In that case, how do we uniquely identify devices in sysfs? By their class, etc. Identifying devices based in instance name is bad idea to start with. > We have a > case where sound/soc/soc-core.c generates an i2c codec name i2c-TDA7802:00. > It is useful to identify that device by part name, rather than some indexed > generic PRP device i2c-PRP0001:04. I can achieve this with: If TDA7802 is *official* _HID dedicated for that codec by vendor, add it to the driver... > _HID("TDA7802") > _CID("PRP0001") > ... > compatible = "st,tda7802" // driver I want to load using OF DT ...and these lines become unneeded. The only case when both are needed is a time between one gets a case and actual ID appears in the upstream driver. Effectively means product developing stage. P.S. Yes, I know that sometimes the platform/BIOS vendors abuse specification and ACPI ID registry and made up IDs, in that case we need to support them as a "de facto" quirks. And yes, ASoC subsystem in ACPI case abuses Linux device hierarchy by matching by instance instead of matching by let say fwnode. It should be fixed there, not in ACPI table. > > > I would really recommend to look at the examples in meta-acpi repository. There > > are cases like described above. > > > > This one is good enough, though see below. > > > > I will drop the superfluous _CID - I think the example is still useful > to have. Even if we don't illustrate my special case for _HID/_CID. Yes, I agree with that. -- With Best Regards, Andy Shevchenko