From: "Rafael J. Wysocki" <rafael@kernel.org>
To: Tony <tony.makkiel@daqri.com>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>
Subject: Re: Any acpi_device_id naming conventions to follow?
Date: Tue, 28 Jun 2016 14:05:28 +0200 [thread overview]
Message-ID: <CAJZ5v0jcovfU_8tnG4jkPuGJCgDQ50aAhooFqxcnhdTsBeCpvw@mail.gmail.com> (raw)
In-Reply-To: <57710FCF.3090908@daqri.com>
On Mon, Jun 27, 2016 at 1:36 PM, Tony <tony.makkiel@daqri.com> wrote:
> Hi all,
> Is there a naming convention to follow on ACPI device names
> (acpi_device_id) for device drivers?
Yes, there is.
An ACPI device ID consists of four (upper case) characters (prefix)
followed by four hex digits.
A PNP device ID consists of three (upper case) characters (prefix)
followed by four hex digits.
In either case the prefix has to be registered for the device ID to be
valid. Once the prefix has been registered, the digits following the
prefix are allocated by the prefix owner (so as to avoid collisions).
Please read http://www.uefi.org/PNP_ACPI_Registry to learn about the
prefix registration process and other details.
> For TI led lp3952, I would otherwise name it as "lp3952". But in order to
> follow ACPI/PNP device ID convention, it has to be 7 or 8 char long. So is
> "TLP3952" a valid name?
>
> Should the name be registered before it can be used? If it has to be
> registered, is there a subset of characters which can be used without
> registration?
There is a special device ID PRP0001 that can be used if there is no
proper ACPI/PNP device ID registered for the device. In that case,
the ACPI device object using PRP0001 as its ID needs to contain a _DSD
object returning a "compatible" property of the device with a DT
compatible string as a value (please see
http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf
for the format specification). The driver only needs to specify a DT
compatible string to be matched against that device then.
However, that convention only works with Linux at the moment, so it
really is recommended to use proper ACPI/PNP device IDs with your
devices.
> From a little bit of googling, I found there is an ACPI ID 'TXNW' for TI,
> http://www.uefi.org/ACPI_ID_List?search=texas
>
> So should the device name be "TXNW3952"?
Depending on who owns the "TXNW" prefix. If you can ask them to
allocate the number following the prefix for you, that should be fine.
That said it may not be necessary to add ACPI device IDs to your
driver just yet. For prototyping and development you can use the
"PRP0001+compatible" convention described above and when you know what
the final ACPI/PNP ID of the device is going to be, you can add it to
the driver at that time (ie. later).
Thanks,
Rafael
next prev parent reply other threads:[~2016-06-28 12:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-27 11:36 Any acpi_device_id naming conventions to follow? Tony
2016-06-28 12:05 ` Rafael J. Wysocki [this message]
2016-06-28 12:17 ` Tony
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAJZ5v0jcovfU_8tnG4jkPuGJCgDQ50aAhooFqxcnhdTsBeCpvw@mail.gmail.com \
--to=rafael@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=tony.makkiel@daqri.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).