linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Any acpi_device_id naming conventions to follow?
@ 2016-06-27 11:36 Tony
  2016-06-28 12:05 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Tony @ 2016-06-27 11:36 UTC (permalink / raw)
  To: linux-acpi

Hi all,
         Is there a naming convention to follow on ACPI device names 
(acpi_device_id) for device drivers?

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?

 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"?

Many Thanks,
Tony

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Any acpi_device_id naming conventions to follow?
  2016-06-27 11:36 Any acpi_device_id naming conventions to follow? Tony
@ 2016-06-28 12:05 ` Rafael J. Wysocki
  2016-06-28 12:17   ` Tony
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2016-06-28 12:05 UTC (permalink / raw)
  To: Tony; +Cc: ACPI Devel Maling List

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Any acpi_device_id naming conventions to follow?
  2016-06-28 12:05 ` Rafael J. Wysocki
@ 2016-06-28 12:17   ` Tony
  0 siblings, 0 replies; 3+ messages in thread
From: Tony @ 2016-06-28 12:17 UTC (permalink / raw)
  To: linux-acpi; +Cc: Rafael J. Wysocki

Thank you Rafael.

On 28/06/16 13:05, Rafael J. Wysocki wrote:
> 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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-28 12:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-27 11:36 Any acpi_device_id naming conventions to follow? Tony
2016-06-28 12:05 ` Rafael J. Wysocki
2016-06-28 12:17   ` Tony

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).