Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ACPI / enumeration: Document the rules regarding the PRP0001 device ID

Document how the ACPI device enumeration code uses the special
PRP0001 device ID.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Reviewed-by: Hanjun Guo <hanjun.guo@linaro.org>
Reviewed-by: Darren Hart <dvhart@linux.intel.com>

+51
+51
Documentation/acpi/enumeration.txt
··· 359 359 The ACPI id "XYZ0001" is then used to lookup an ACPI device directly under 360 360 the MFD device and if found, that ACPI companion device is bound to the 361 361 resulting child platform device. 362 + 363 + Device Tree namespace link device ID 364 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 365 + The Device Tree protocol uses device indentification based on the "compatible" 366 + property whose value is a string or an array of strings recognized as device 367 + identifiers by drivers and the driver core. The set of all those strings may be 368 + regarded as a device indentification namespace analogous to the ACPI/PNP device 369 + ID namespace. Consequently, in principle it should not be necessary to allocate 370 + a new (and arguably redundant) ACPI/PNP device ID for a devices with an existing 371 + identification string in the Device Tree (DT) namespace, especially if that ID 372 + is only needed to indicate that a given device is compatible with another one, 373 + presumably having a matching driver in the kernel already. 374 + 375 + In ACPI, the device identification object called _CID (Compatible ID) is used to 376 + list the IDs of devices the given one is compatible with, but those IDs must 377 + belong to one of the namespaces prescribed by the ACPI specification (see 378 + Section 6.1.2 of ACPI 6.0 for details) and the DT namespace is not one of them. 379 + Moreover, the specification mandates that either a _HID or an _ADR identificaion 380 + object be present for all ACPI objects representing devices (Section 6.1 of ACPI 381 + 6.0). For non-enumerable bus types that object must be _HID and its value must 382 + be a device ID from one of the namespaces prescribed by the specification too. 383 + 384 + The special DT namespace link device ID, PRP0001, provides a means to use the 385 + existing DT-compatible device identification in ACPI and to satisfy the above 386 + requirements following from the ACPI specification at the same time. Namely, 387 + if PRP0001 is returned by _HID, the ACPI subsystem will look for the 388 + "compatible" property in the device object's _DSD and will use the value of that 389 + property to identify the corresponding device in analogy with the original DT 390 + device identification algorithm. If the "compatible" property is not present 391 + or its value is not valid, the device will not be enumerated by the ACPI 392 + subsystem. Otherwise, it will be enumerated automatically as a platform device 393 + (except when an I2C or SPI link from the device to its parent is present, in 394 + which case the ACPI core will leave the device enumeration to the parent's 395 + driver) and the identification strings from the "compatible" property value will 396 + be used to find a driver for the device along with the device IDs listed by _CID 397 + (if present). 398 + 399 + Analogously, if PRP0001 is present in the list of device IDs returned by _CID, 400 + the identification strings listed by the "compatible" property value (if present 401 + and valid) will be used to look for a driver matching the device, but in that 402 + case their relative priority with respect to the other device IDs listed by 403 + _HID and _CID depends on the position of PRP0001 in the _CID return package. 404 + Specifically, the device IDs returned by _HID and preceding PRP0001 in the _CID 405 + return package will be checked first. Also in that case the bus type the device 406 + will be enumerated to depends on the device ID returned by _HID. 407 + 408 + It is valid to define device objects with a _HID returning PRP0001 and without 409 + the "compatible" property in the _DSD or a _CID as long as one of their 410 + ancestors provides a _DSD with a valid "compatible" property. Such device 411 + objects are then simply regarded as additional "blocks" providing hierarchical 412 + configuration information to the driver of the composite ancestor device.