diff options
author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-12 14:48:18 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2016-12-12 14:48:18 -0500 |
commit | 80f1b3dea9d4262817b5510547b1313681669f66 (patch) | |
tree | 1a084972bb36a9a51d75ad6f68c41743bc11e0c8 /Documentation/acpi | |
parent | d2c2ba690180da366bdc5ca037c2d4f077bd5ffd (diff) | |
parent | ee39222d45839284f91e882df8a985e1af0f7e18 (diff) |
Merge branch 'device-properties'
* device-properties:
ACPI / property: Document usage rules for _DSD properties
ACPI / property: Hierarchical properties support update
Diffstat (limited to 'Documentation/acpi')
-rw-r--r-- | Documentation/acpi/DSD-properties-rules.txt | 97 | ||||
-rw-r--r-- | Documentation/acpi/enumeration.txt | 9 |
2 files changed, 106 insertions, 0 deletions
diff --git a/Documentation/acpi/DSD-properties-rules.txt b/Documentation/acpi/DSD-properties-rules.txt new file mode 100644 index 000000000000..3e4862bdad98 --- /dev/null +++ b/Documentation/acpi/DSD-properties-rules.txt | |||
@@ -0,0 +1,97 @@ | |||
1 | _DSD Device Properties Usage Rules | ||
2 | ---------------------------------- | ||
3 | |||
4 | Properties, Property Sets and Property Subsets | ||
5 | ---------------------------------------------- | ||
6 | |||
7 | The _DSD (Device Specific Data) configuration object, introduced in ACPI 5.1, | ||
8 | allows any type of device configuration data to be provided via the ACPI | ||
9 | namespace. In principle, the format of the data may be arbitrary, but it has to | ||
10 | be identified by a UUID which must be recognized by the driver processing the | ||
11 | _DSD output. However, there are generic UUIDs defined for _DSD recognized by | ||
12 | the ACPI subsystem in the Linux kernel which automatically processes the data | ||
13 | packages associated with them and makes those data available to device drivers | ||
14 | as "device properties". | ||
15 | |||
16 | A device property is a data item consisting of a string key and a value (of a | ||
17 | specific type) associated with it. | ||
18 | |||
19 | In the ACPI _DSD context it is an element of the sub-package following the | ||
20 | generic Device Properties UUID in the _DSD return package as specified in the | ||
21 | Device Properties UUID definition document [1]. | ||
22 | |||
23 | It also may be regarded as the definition of a key and the associated data type | ||
24 | that can be returned by _DSD in the Device Properties UUID sub-package for a | ||
25 | given device. | ||
26 | |||
27 | A property set is a collection of properties applicable to a hardware entity | ||
28 | like a device. In the ACPI _DSD context it is the set of all properties that | ||
29 | can be returned in the Device Properties UUID sub-package for the device in | ||
30 | question. | ||
31 | |||
32 | Property subsets are nested collections of properties. Each of them is | ||
33 | associated with an additional key (name) allowing the subset to be referred | ||
34 | to as a whole (and to be treated as a separate entity). The canonical | ||
35 | representation of property subsets is via the mechanism specified in the | ||
36 | Hierarchical Properties Extension UUID definition document [2]. | ||
37 | |||
38 | Property sets may be hierarchical. That is, a property set may contain | ||
39 | multiple property subsets that each may contain property subsets of its | ||
40 | own and so on. | ||
41 | |||
42 | General Validity Rule for Property Sets | ||
43 | --------------------------------------- | ||
44 | |||
45 | Valid property sets must follow the guidance given by the Device Properties UUID | ||
46 | definition document [1]. | ||
47 | |||
48 | _DSD properties are intended to be used in addition to, and not instead of, the | ||
49 | existing mechanisms defined by the ACPI specification. Therefore, as a rule, | ||
50 | they should only be used if the ACPI specification does not make direct | ||
51 | provisions for handling the underlying use case. It generally is invalid to | ||
52 | return property sets which do not follow that rule from _DSD in data packages | ||
53 | associated with the Device Properties UUID. | ||
54 | |||
55 | Additional Considerations | ||
56 | ------------------------- | ||
57 | |||
58 | There are cases in which, even if the general rule given above is followed in | ||
59 | principle, the property set may still not be regarded as a valid one. | ||
60 | |||
61 | For example, that applies to device properties which may cause kernel code | ||
62 | (either a device driver or a library/subsystem) to access hardware in a way | ||
63 | possibly leading to a conflict with AML methods in the ACPI namespace. In | ||
64 | particular, that may happen if the kernel code uses device properties to | ||
65 | manipulate hardware normally controlled by ACPI methods related to power | ||
66 | management, like _PSx and _DSW (for device objects) or _ON and _OFF (for power | ||
67 | resource objects), or by ACPI device disabling/enabling methods, like _DIS and | ||
68 | _SRS. | ||
69 | |||
70 | In all cases in which kernel code may do something that will confuse AML as a | ||
71 | result of using device properties, the device properties in question are not | ||
72 | suitable for the ACPI environment and consequently they cannot belong to a valid | ||
73 | property set. | ||
74 | |||
75 | Property Sets and Device Tree Bindings | ||
76 | -------------------------------------- | ||
77 | |||
78 | It often is useful to make _DSD return property sets that follow Device Tree | ||
79 | bindings. | ||
80 | |||
81 | In those cases, however, the above validity considerations must be taken into | ||
82 | account in the first place and returning invalid property sets from _DSD must be | ||
83 | avoided. For this reason, it may not be possible to make _DSD return a property | ||
84 | set following the given DT binding literally and completely. Still, for the | ||
85 | sake of code re-use, it may make sense to provide as much of the configuration | ||
86 | data as possible in the form of device properties and complement that with an | ||
87 | ACPI-specific mechanism suitable for the use case at hand. | ||
88 | |||
89 | In any case, property sets following DT bindings literally should not be | ||
90 | expected to automatically work in the ACPI environment regardless of their | ||
91 | contents. | ||
92 | |||
93 | References | ||
94 | ---------- | ||
95 | |||
96 | [1] http://www.uefi.org/sites/default/files/resources/_DSD-device-properties-UUID.pdf | ||
97 | [2] http://www.uefi.org/sites/default/files/resources/_DSD-hierarchical-data-extension-UUID-v1.1.pdf | ||
diff --git a/Documentation/acpi/enumeration.txt b/Documentation/acpi/enumeration.txt index a91ec5af52df..209a5eba6b87 100644 --- a/Documentation/acpi/enumeration.txt +++ b/Documentation/acpi/enumeration.txt | |||
@@ -415,3 +415,12 @@ the "compatible" property in the _DSD or a _CID as long as one of their | |||
415 | ancestors provides a _DSD with a valid "compatible" property. Such device | 415 | ancestors provides a _DSD with a valid "compatible" property. Such device |
416 | objects are then simply regarded as additional "blocks" providing hierarchical | 416 | objects are then simply regarded as additional "blocks" providing hierarchical |
417 | configuration information to the driver of the composite ancestor device. | 417 | configuration information to the driver of the composite ancestor device. |
418 | |||
419 | However, PRP0001 can only be returned from either _HID or _CID of a device | ||
420 | object if all of the properties returned by the _DSD associated with it (either | ||
421 | the _DSD of the device object itself or the _DSD of its ancestor in the | ||
422 | "composite device" case described above) can be used in the ACPI environment. | ||
423 | Otherwise, the _DSD itself is regarded as invalid and therefore the "compatible" | ||
424 | property returned by it is meaningless. | ||
425 | |||
426 | Refer to DSD-properties-rules.txt for more information. | ||