diff options
Diffstat (limited to 'include/linux/pm_qos.h')
-rw-r--r-- | include/linux/pm_qos.h | 52 |
1 files changed, 19 insertions, 33 deletions
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index e5bbcbaa6f57..2e9191a712f3 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -9,12 +9,16 @@ | |||
9 | #include <linux/miscdevice.h> | 9 | #include <linux/miscdevice.h> |
10 | #include <linux/device.h> | 10 | #include <linux/device.h> |
11 | 11 | ||
12 | #define PM_QOS_RESERVED 0 | 12 | enum { |
13 | #define PM_QOS_CPU_DMA_LATENCY 1 | 13 | PM_QOS_RESERVED = 0, |
14 | #define PM_QOS_NETWORK_LATENCY 2 | 14 | PM_QOS_CPU_DMA_LATENCY, |
15 | #define PM_QOS_NETWORK_THROUGHPUT 3 | 15 | PM_QOS_NETWORK_LATENCY, |
16 | PM_QOS_NETWORK_THROUGHPUT, | ||
17 | |||
18 | /* insert new class ID */ | ||
19 | PM_QOS_NUM_CLASSES, | ||
20 | }; | ||
16 | 21 | ||
17 | #define PM_QOS_NUM_CLASSES 4 | ||
18 | #define PM_QOS_DEFAULT_VALUE -1 | 22 | #define PM_QOS_DEFAULT_VALUE -1 |
19 | 23 | ||
20 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) | 24 | #define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) |
@@ -63,7 +67,6 @@ static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) | |||
63 | return req->dev != 0; | 67 | return req->dev != 0; |
64 | } | 68 | } |
65 | 69 | ||
66 | #ifdef CONFIG_PM | ||
67 | int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, | 70 | int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, |
68 | enum pm_qos_req_action action, int value); | 71 | enum pm_qos_req_action action, int value); |
69 | void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, | 72 | void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, |
@@ -78,6 +81,7 @@ int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier); | |||
78 | int pm_qos_request_active(struct pm_qos_request *req); | 81 | int pm_qos_request_active(struct pm_qos_request *req); |
79 | s32 pm_qos_read_value(struct pm_qos_constraints *c); | 82 | s32 pm_qos_read_value(struct pm_qos_constraints *c); |
80 | 83 | ||
84 | #ifdef CONFIG_PM | ||
81 | s32 __dev_pm_qos_read_value(struct device *dev); | 85 | s32 __dev_pm_qos_read_value(struct device *dev); |
82 | s32 dev_pm_qos_read_value(struct device *dev); | 86 | s32 dev_pm_qos_read_value(struct device *dev); |
83 | int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, | 87 | int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, |
@@ -95,33 +99,6 @@ void dev_pm_qos_constraints_destroy(struct device *dev); | |||
95 | int dev_pm_qos_add_ancestor_request(struct device *dev, | 99 | int dev_pm_qos_add_ancestor_request(struct device *dev, |
96 | struct dev_pm_qos_request *req, s32 value); | 100 | struct dev_pm_qos_request *req, s32 value); |
97 | #else | 101 | #else |
98 | static inline int pm_qos_update_target(struct pm_qos_constraints *c, | ||
99 | struct plist_node *node, | ||
100 | enum pm_qos_req_action action, | ||
101 | int value) | ||
102 | { return 0; } | ||
103 | static inline void pm_qos_add_request(struct pm_qos_request *req, | ||
104 | int pm_qos_class, s32 value) | ||
105 | { return; } | ||
106 | static inline void pm_qos_update_request(struct pm_qos_request *req, | ||
107 | s32 new_value) | ||
108 | { return; } | ||
109 | static inline void pm_qos_remove_request(struct pm_qos_request *req) | ||
110 | { return; } | ||
111 | |||
112 | static inline int pm_qos_request(int pm_qos_class) | ||
113 | { return 0; } | ||
114 | static inline int pm_qos_add_notifier(int pm_qos_class, | ||
115 | struct notifier_block *notifier) | ||
116 | { return 0; } | ||
117 | static inline int pm_qos_remove_notifier(int pm_qos_class, | ||
118 | struct notifier_block *notifier) | ||
119 | { return 0; } | ||
120 | static inline int pm_qos_request_active(struct pm_qos_request *req) | ||
121 | { return 0; } | ||
122 | static inline s32 pm_qos_read_value(struct pm_qos_constraints *c) | ||
123 | { return 0; } | ||
124 | |||
125 | static inline s32 __dev_pm_qos_read_value(struct device *dev) | 102 | static inline s32 __dev_pm_qos_read_value(struct device *dev) |
126 | { return 0; } | 103 | { return 0; } |
127 | static inline s32 dev_pm_qos_read_value(struct device *dev) | 104 | static inline s32 dev_pm_qos_read_value(struct device *dev) |
@@ -160,4 +137,13 @@ static inline int dev_pm_qos_add_ancestor_request(struct device *dev, | |||
160 | { return 0; } | 137 | { return 0; } |
161 | #endif | 138 | #endif |
162 | 139 | ||
140 | #ifdef CONFIG_PM_RUNTIME | ||
141 | int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value); | ||
142 | void dev_pm_qos_hide_latency_limit(struct device *dev); | ||
143 | #else | ||
144 | static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value) | ||
145 | { return 0; } | ||
146 | static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {} | ||
147 | #endif | ||
148 | |||
163 | #endif | 149 | #endif |