aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_qos.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/pm_qos.h')
-rw-r--r--include/linux/pm_qos.h52
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 12enum {
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
67int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, 70int 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);
69void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class, 72void 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);
78int pm_qos_request_active(struct pm_qos_request *req); 81int pm_qos_request_active(struct pm_qos_request *req);
79s32 pm_qos_read_value(struct pm_qos_constraints *c); 82s32 pm_qos_read_value(struct pm_qos_constraints *c);
80 83
84#ifdef CONFIG_PM
81s32 __dev_pm_qos_read_value(struct device *dev); 85s32 __dev_pm_qos_read_value(struct device *dev);
82s32 dev_pm_qos_read_value(struct device *dev); 86s32 dev_pm_qos_read_value(struct device *dev);
83int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req, 87int 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);
95int dev_pm_qos_add_ancestor_request(struct device *dev, 99int 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
98static 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; }
103static inline void pm_qos_add_request(struct pm_qos_request *req,
104 int pm_qos_class, s32 value)
105 { return; }
106static inline void pm_qos_update_request(struct pm_qos_request *req,
107 s32 new_value)
108 { return; }
109static inline void pm_qos_remove_request(struct pm_qos_request *req)
110 { return; }
111
112static inline int pm_qos_request(int pm_qos_class)
113 { return 0; }
114static inline int pm_qos_add_notifier(int pm_qos_class,
115 struct notifier_block *notifier)
116 { return 0; }
117static inline int pm_qos_remove_notifier(int pm_qos_class,
118 struct notifier_block *notifier)
119 { return 0; }
120static inline int pm_qos_request_active(struct pm_qos_request *req)
121 { return 0; }
122static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
123 { return 0; }
124
125static inline s32 __dev_pm_qos_read_value(struct device *dev) 102static inline s32 __dev_pm_qos_read_value(struct device *dev)
126 { return 0; } 103 { return 0; }
127static inline s32 dev_pm_qos_read_value(struct device *dev) 104static 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
141int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value);
142void dev_pm_qos_hide_latency_limit(struct device *dev);
143#else
144static inline int dev_pm_qos_expose_latency_limit(struct device *dev, s32 value)
145 { return 0; }
146static inline void dev_pm_qos_hide_latency_limit(struct device *dev) {}
147#endif
148
163#endif 149#endif