Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp1504617imd; Sat, 27 Oct 2018 10:21:49 -0700 (PDT) X-Google-Smtp-Source: AJdET5eHcArnN5zkm7ExBg+N66AjqTBjUnWySDoG3gTKhAb51jhfJSvHNHYd/ALqUSo9fC6TkLrA X-Received: by 2002:a17:902:148:: with SMTP id 66-v6mr7949616plb.140.1540660909661; Sat, 27 Oct 2018 10:21:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540660909; cv=none; d=google.com; s=arc-20160816; b=B8ojbxRb4gT6uVC6rcN0H01dHDFGBOseyt53jv4gUjvzETqOhjPmXkBo4Yc3i8iNvh EI0nLYKCcwtKFbpIByB4LkuRCQi1yjVczOQdQdB6xXE/NWBOFklwzo2tOIWX7oDXfpXD uM16uKkafe3kNavHD3voQTxuXQNLudKQTPBW+GfTkO7bkG7TOh2Za78Q2i2tvampCCAC r9mLMUATRgncX2c1wu+Zs463XWSufbsxX1hspbvCJh7xm29qOAhk+VCpeuVQCiAk6agc I34RzRd7nflhx01mrxvCKPmLfxNEZILu8fy4SZ6Nt9i9QnXFg3D08B6MB1OiFAXjYyYj B5dw== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OCRv4A0VJ9/qMPljWG2QE5nwjzDgigATOeOWkARuYp4=; b=vswHsnN+2hOUoJlVd3qMBbrLdh0MonpUvRRFi3317jYTf4zdbci29CKEf2oI1mLl4f JsZqCw+y14Kn83QsKCZfTm2uVlRtZpZ7vmh9zfzGdm1VZuyaHH0A5SqWMs/t2ue/fmZo FYQSsL6zhuadvvClr78qmIg5tgLQ2Fi1CMyyGDxmOwUyLcsltbGcOuvqjjCPRB0wekP9 S4cNBxda1mPW5fKNiY0OwTgI3p8RrpY3jJPpWtE1ctJXW3gXCJjVRFUb0Ubikq9wbpQc Yti6R0sDsec979KEZAA/pL+/jHLoEwEkfOCkd0BIZC9ETdxx5hpbKxzAlJ4eJG9gZMyM dDIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=j3hRr5qP; 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 b20-v6si15386455pgk.360.2018.10.27.10.21.33; Sat, 27 Oct 2018 10:21:49 -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=j3hRr5qP; 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 S1728835AbeJ1B4W (ORCPT + 99 others); Sat, 27 Oct 2018 21:56:22 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:43899 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728610AbeJ1B4W (ORCPT ); Sat, 27 Oct 2018 21:56:22 -0400 Received: by mail-pl1-f195.google.com with SMTP id 30-v6so1882860plb.10; Sat, 27 Oct 2018 10:14:44 -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:content-transfer-encoding:in-reply-to :user-agent; bh=OCRv4A0VJ9/qMPljWG2QE5nwjzDgigATOeOWkARuYp4=; b=j3hRr5qPNvYbzXYul9kMQcJzveqnDeNJBFX50oFC/JbY1lMlNGK1xH/njoGkOEf0Pm cJ3q9pYkpzxJvBgyze7oVWe7ZKU5VCCqnPwYQj0GR/+Nc0ApNuam9zr63+0npriOUXye IJsnE2FJWX1Mz/ZxpaJR8k53YsnET4xsnC/JVRkio5XvavzVNoEdt0ZrOqdmWWpB46/i neuRJ3VJAyX8kQPfHeRdR9wik+QhSkYrLwWOlbOTmaspSVXTGQRVlO5NNMfGdOeuigRF 9/S3YBdlZmD287uHhEkJ7JQy0ge7H/kRJItL5kfXz9xMB1pM3XEHg6h/2Oul9Q38MxxZ /WBw== 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:content-transfer-encoding :in-reply-to:user-agent; bh=OCRv4A0VJ9/qMPljWG2QE5nwjzDgigATOeOWkARuYp4=; b=RMN4kbBQr8sqn1jQ3l8ulm9OHYnPVjgRoEWr7ffv9TxrcUGvxre4QBqAzs4KwG6q27 QxTvRsiEBvGBKoAx3VM9gNytzTWt7U5nk3LnYjm2VnZyvlX02gjwSPBUsuBwlGJjY+cZ lJH4VHO5B4b/YIUT7R//DOsZ2trIIwSdG6i4fSX48e+L5WnHiCu8/Lv+rXfbleYVTVa6 qgxAUFO9p4i3KMfN1kUl5eybqHVeeWxx2AqTA/a7shl9YX9ZNcOT6Gc4QECcwpPgRN+0 CBTa6dbqKd8gVYVxEXdN/jMayT4b2F3o2LMx2v6JL70SUIaV2uP1mhEyMlwExT7KAYQH 6sNw== X-Gm-Message-State: AGRZ1gKQcJCVnry/KOudHIoiTiEsjvDL/c6Z+qR66Xrt/TAiRTDjs34I myVr+SxdKG6u6z1LlvLXOHw= X-Received: by 2002:a17:902:7802:: with SMTP id p2-v6mr7802914pll.170.1540660483738; Sat, 27 Oct 2018 10:14:43 -0700 (PDT) Received: from himanshu-Vostro-3559 ([103.233.116.134]) by smtp.gmail.com with ESMTPSA id b88-v6sm35081053pfc.150.2018.10.27.10.14.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 27 Oct 2018 10:14:42 -0700 (PDT) Date: Sat, 27 Oct 2018 22:44:28 +0530 From: Himanshu Jha To: Dan O'Donovan Cc: linux-kernel@vger.kernel.org, Andy Shevchenko , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, Rob Herring , Mark Rutland , devicetree@vger.kernel.org, Carlos Iglesias , Nicola Lunghi , Javier Arteaga , srinivas.pandruvada@linux.intel.com Subject: Re: [PATCH v3 2/3] iio: adc128s052: add ACPI _HID AANT1280 Message-ID: <20181027171428.GA2503@himanshu-Vostro-3559> References: <20180423213805.12591-1-javier@emutex.com> <1540481742-23596-1-git-send-email-dan@emutex.com> <1540481742-23596-3-git-send-email-dan@emutex.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1540481742-23596-3-git-send-email-dan@emutex.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dan, On Thu, Oct 25, 2018 at 04:35:41PM +0100, Dan O'Donovan wrote: > From: Nicola Lunghi > > ACPI _HID AANT1280 matches an ADC124S101 present on E3940 SKUs of the UP > Squared board. > > Add it to the driver. > > Signed-off-by: Nicola Lunghi > [javier@emutex.com: fix up commit message and one checkpatch warning] > Signed-off-by: Javier Arteaga > Signed-off-by: Dan O'Donovan > --- > drivers/iio/adc/ti-adc128s052.c | 18 +++++++++++++++++- > 1 file changed, 17 insertions(+), 1 deletion(-) [] > +#ifdef CONFIG_ACPI > +static const struct acpi_device_id adc128_acpi_match[] = { > + { "AANT1280", 2 }, /* ADC124S021 compatible ACPI ID */ > + { } > +}; > +MODULE_DEVICE_TABLE(acpi, adc128_acpi_match); > +#endif I'm curious about the naming conventions used for selecting an ACPI ID. AFAIK, ACPI or PNP ID consists of *Vendor* ID + Product ID. PNP ID: PNP Vendor IDs consist of 3 characters, each character being an uppercase letter (A-Z). ACPI ID: ACPI Vendor IDs consist of 4 characters, each character being either an uppercase letter (A-Z) or a numeral (0-9). In your case, Vendor ID -> AANT (AAEON TECHNOLOGY INC. registered ACPI ID prefix) http://www.uefi.org/ACPI_ID_List?search=AANT Product ID -> 1280 How did you come up with 1280 ? And why AANT ? why not TXNW which is registered ACPI prefix for TEXAS INSTRUMENTS ? http://www.uefi.org/ACPI_ID_List?search=Texas+ Latest ACPI manuals says: 6.1.5 _HID (Hardware ID) ------------------------ This object is used to supply OSPM with the device’s Plug and Play hardware ID.[1] [1] "A Plug and Play ID or ACPI ID can be obtained by sending e-mail to pnpid@microsoft.com." A _HID object evaluates to either a numeric 32-bit compressed EISA type ID or a string. If a string, the format must be an alphanumeric PNP or ACPI ID with no asterisk or other leading characters. A valid PNP ID must be of the form "AAA####" where A is an uppercase letter and # is a hex digit. A valid ACPI ID must be of the form "NNNN####" where N is an uppercase letter or a digit ('0'-'9') and # is a hex digit. This specification reserves the string "ACPI" for use only with devices defined herein. It further reserves all strings representing 4 HEX digits for exclusive use with PCI-assigned Vendor IDs. Next question: There are a lot drivers in iio/ using ACPI for device enumeration using these IDs. For now, let's take an example of Bosch Sensors: drivers/iio/accel/bmc150-accel-i2c.c:static const struct acpi_device_id bmc150_accel_acpi_match[] = { drivers/iio/accel/bmc150-accel-i2c.c- {"BSBA0150", bmc150}, drivers/iio/accel/bmc150-accel-i2c.c- {"BMC150A", bmc150}, drivers/iio/accel/bmc150-accel-i2c.c- {"BMI055A", bmi055}, drivers/iio/accel/bmc150-accel-i2c.c- {"BMA0255", bma255}, drivers/iio/gyro/bmg160_i2c.c:static const struct acpi_device_id bmg160_acpi_match[] = { drivers/iio/gyro/bmg160_i2c.c- {"BMG0160", 0}, drivers/iio/gyro/bmg160_i2c.c- {"BMI055B", 0}, drivers/iio/gyro/bmg160_i2c.c- {}, drivers/iio/gyro/bmg160_i2c.c-}; drivers/iio/imu/bmi160/bmi160_i2c.c:static const struct acpi_device_id bmi160_acpi_match[] = { drivers/iio/imu/bmi160/bmi160_i2c.c- {"BMI0160", 0}, drivers/iio/imu/bmi160/bmi160_i2c.c- { }, drivers/iio/imu/bmi160/bmi160_i2c.c-}; drivers/iio/imu/bmi160/bmi160_i2c.c-MODULE_DEVICE_TABLE(acpi, bmi160_acpi_match); Bosch registered ACPI ID: BOSC http://www.uefi.org/ACPI_ID_List?search=Bosch Bosch registered PNP ID: BSG http://www.uefi.org/PNP_ID_List?search=Bosch So, how could we use PNP ID "BMI" which is registered prefix for BENSON MEDICAL INSTRUMENTS COMPANY ? http://www.uefi.org/PNP_ID_List?search=BMI Product ID -> "160" is fine for bmi160 which uniquely identifies the sensor device. But shouldn't the prefix be "BSG0160" instead of "BMI0160" ? When I wrote the driver for Bosch BME680, I followed the same guideline as done everywhere else in the Bosch family: drivers/iio/pressure/bmp280-i2c.c- {"BMP0280", BMP280_CHIP_ID }, drivers/iio/pressure/bmp280-i2c.c- {"BMP0180", BMP180_CHIP_ID }, drivers/iio/pressure/bmp280-i2c.c- {"BMP0085", BMP180_CHIP_ID }, drivers/iio/pressure/bmp280-i2c.c- {"BME0280", BME280_CHIP_ID }, Therefore, I used BME0680 for bosch bme680 sensor! In OF matching, we use vendor prefixes and that looks more legimate: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/Documentation/devicetree/bindings/vendor-prefixes.txt Dan, These questions are not just for you but to rest of the community members as well. If there is something I misunderstood, then please let me know :) Thanks -- Himanshu Jha Undergraduate Student Department of Electronics & Communication Guru Tegh Bahadur Institute of Technology