diff options
Diffstat (limited to 'Documentation/power/pm_qos_interface.txt')
-rw-r--r-- | Documentation/power/pm_qos_interface.txt | 50 |
1 files changed, 43 insertions, 7 deletions
diff --git a/Documentation/power/pm_qos_interface.txt b/Documentation/power/pm_qos_interface.txt index 79a2a58425ee..483632087788 100644 --- a/Documentation/power/pm_qos_interface.txt +++ b/Documentation/power/pm_qos_interface.txt | |||
@@ -7,7 +7,7 @@ one of the parameters. | |||
7 | Two different PM QoS frameworks are available: | 7 | Two different PM QoS frameworks are available: |
8 | 1. PM QoS classes for cpu_dma_latency, network_latency, network_throughput. | 8 | 1. PM QoS classes for cpu_dma_latency, network_latency, network_throughput. |
9 | 2. the per-device PM QoS framework provides the API to manage the per-device latency | 9 | 2. the per-device PM QoS framework provides the API to manage the per-device latency |
10 | constraints. | 10 | constraints and PM QoS flags. |
11 | 11 | ||
12 | Each parameters have defined units: | 12 | Each parameters have defined units: |
13 | * latency: usec | 13 | * latency: usec |
@@ -86,13 +86,17 @@ To remove the user mode request for a target value simply close the device | |||
86 | node. | 86 | node. |
87 | 87 | ||
88 | 88 | ||
89 | 2. PM QoS per-device latency framework | 89 | 2. PM QoS per-device latency and flags framework |
90 | |||
91 | For each device, there are two lists of PM QoS requests. One is maintained | ||
92 | along with the aggregated target of latency value and the other is for PM QoS | ||
93 | flags. Values are updated in response to changes of the request list. | ||
94 | |||
95 | Target latency value is simply the minimum of the request values held in the | ||
96 | parameter list elements. The PM QoS flags aggregate value is a gather (bitwise | ||
97 | OR) of all list elements' values. Two device PM QoS flags are defined currently: | ||
98 | PM_QOS_FLAG_NO_POWER_OFF and PM_QOS_FLAG_REMOTE_WAKEUP. | ||
90 | 99 | ||
91 | For each device a list of performance requests is maintained along with | ||
92 | an aggregated target value. The aggregated target value is updated with | ||
93 | changes to the request list or elements of the list. Typically the | ||
94 | aggregated target value is simply the max or min of the request values held | ||
95 | in the parameter list elements. | ||
96 | Note: the aggregated target value is implemented as an atomic variable so that | 100 | Note: the aggregated target value is implemented as an atomic variable so that |
97 | reading the aggregated value does not require any locking mechanism. | 101 | reading the aggregated value does not require any locking mechanism. |
98 | 102 | ||
@@ -119,6 +123,38 @@ the request. | |||
119 | s32 dev_pm_qos_read_value(device): | 123 | s32 dev_pm_qos_read_value(device): |
120 | Returns the aggregated value for a given device's constraints list. | 124 | Returns the aggregated value for a given device's constraints list. |
121 | 125 | ||
126 | enum pm_qos_flags_status dev_pm_qos_flags(device, mask) | ||
127 | Check PM QoS flags of the given device against the given mask of flags. | ||
128 | The meaning of the return values is as follows: | ||
129 | PM_QOS_FLAGS_ALL: All flags from the mask are set | ||
130 | PM_QOS_FLAGS_SOME: Some flags from the mask are set | ||
131 | PM_QOS_FLAGS_NONE: No flags from the mask are set | ||
132 | PM_QOS_FLAGS_UNDEFINED: The device's PM QoS structure has not been | ||
133 | initialized or the list of requests is empty. | ||
134 | |||
135 | int dev_pm_qos_add_ancestor_request(dev, handle, value) | ||
136 | Add a PM QoS request for the first direct ancestor of the given device whose | ||
137 | power.ignore_children flag is unset. | ||
138 | |||
139 | int dev_pm_qos_expose_latency_limit(device, value) | ||
140 | Add a request to the device's PM QoS list of latency constraints and create | ||
141 | a sysfs attribute pm_qos_resume_latency_us under the device's power directory | ||
142 | allowing user space to manipulate that request. | ||
143 | |||
144 | void dev_pm_qos_hide_latency_limit(device) | ||
145 | Drop the request added by dev_pm_qos_expose_latency_limit() from the device's | ||
146 | PM QoS list of latency constraints and remove sysfs attribute pm_qos_resume_latency_us | ||
147 | from the device's power directory. | ||
148 | |||
149 | int dev_pm_qos_expose_flags(device, value) | ||
150 | Add a request to the device's PM QoS list of flags and create sysfs attributes | ||
151 | pm_qos_no_power_off and pm_qos_remote_wakeup under the device's power directory | ||
152 | allowing user space to change these flags' value. | ||
153 | |||
154 | void dev_pm_qos_hide_flags(device) | ||
155 | Drop the request added by dev_pm_qos_expose_flags() from the device's PM QoS list | ||
156 | of flags and remove sysfs attributes pm_qos_no_power_off and pm_qos_remote_wakeup | ||
157 | under the device's power directory. | ||
122 | 158 | ||
123 | Notification mechanisms: | 159 | Notification mechanisms: |
124 | The per-device PM QoS framework has 2 different and distinct notification trees: | 160 | The per-device PM QoS framework has 2 different and distinct notification trees: |