Skip to content

Commit 342035f

Browse files
cdleonardrafaeljw
authored andcommitted
PM / QoS: Reorder pm_qos/freq_qos/dev_pm_qos structs
This allows dev_pm_qos to embed freq_qos structs, which is done in the next patch. Separate commit to make it easier to review. Signed-off-by: Leonard Crestez <[email protected]> Reviewed-by: Matthias Kaehlcke <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 14e0875 commit 342035f

File tree

1 file changed

+38
-36
lines changed

1 file changed

+38
-36
lines changed

include/linux/pm_qos.h

Lines changed: 38 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,6 @@ struct pm_qos_flags_request {
4949
s32 flags; /* Do not change to 64 bit */
5050
};
5151

52-
enum dev_pm_qos_req_type {
53-
DEV_PM_QOS_RESUME_LATENCY = 1,
54-
DEV_PM_QOS_LATENCY_TOLERANCE,
55-
DEV_PM_QOS_FLAGS,
56-
};
57-
58-
struct dev_pm_qos_request {
59-
enum dev_pm_qos_req_type type;
60-
union {
61-
struct plist_node pnode;
62-
struct pm_qos_flags_request flr;
63-
} data;
64-
struct device *dev;
65-
};
66-
6752
enum pm_qos_type {
6853
PM_QOS_UNITIALIZED,
6954
PM_QOS_MAX, /* return the largest value */
@@ -90,6 +75,44 @@ struct pm_qos_flags {
9075
s32 effective_flags; /* Do not change to 64 bit */
9176
};
9277

78+
79+
#define FREQ_QOS_MIN_DEFAULT_VALUE 0
80+
#define FREQ_QOS_MAX_DEFAULT_VALUE S32_MAX
81+
82+
enum freq_qos_req_type {
83+
FREQ_QOS_MIN = 1,
84+
FREQ_QOS_MAX,
85+
};
86+
87+
struct freq_constraints {
88+
struct pm_qos_constraints min_freq;
89+
struct blocking_notifier_head min_freq_notifiers;
90+
struct pm_qos_constraints max_freq;
91+
struct blocking_notifier_head max_freq_notifiers;
92+
};
93+
94+
struct freq_qos_request {
95+
enum freq_qos_req_type type;
96+
struct plist_node pnode;
97+
struct freq_constraints *qos;
98+
};
99+
100+
101+
enum dev_pm_qos_req_type {
102+
DEV_PM_QOS_RESUME_LATENCY = 1,
103+
DEV_PM_QOS_LATENCY_TOLERANCE,
104+
DEV_PM_QOS_FLAGS,
105+
};
106+
107+
struct dev_pm_qos_request {
108+
enum dev_pm_qos_req_type type;
109+
union {
110+
struct plist_node pnode;
111+
struct pm_qos_flags_request flr;
112+
} data;
113+
struct device *dev;
114+
};
115+
93116
struct dev_pm_qos {
94117
struct pm_qos_constraints resume_latency;
95118
struct pm_qos_constraints latency_tolerance;
@@ -255,27 +278,6 @@ static inline s32 dev_pm_qos_raw_resume_latency(struct device *dev)
255278
}
256279
#endif
257280

258-
#define FREQ_QOS_MIN_DEFAULT_VALUE 0
259-
#define FREQ_QOS_MAX_DEFAULT_VALUE S32_MAX
260-
261-
enum freq_qos_req_type {
262-
FREQ_QOS_MIN = 1,
263-
FREQ_QOS_MAX,
264-
};
265-
266-
struct freq_constraints {
267-
struct pm_qos_constraints min_freq;
268-
struct blocking_notifier_head min_freq_notifiers;
269-
struct pm_qos_constraints max_freq;
270-
struct blocking_notifier_head max_freq_notifiers;
271-
};
272-
273-
struct freq_qos_request {
274-
enum freq_qos_req_type type;
275-
struct plist_node pnode;
276-
struct freq_constraints *qos;
277-
};
278-
279281
static inline int freq_qos_request_active(struct freq_qos_request *req)
280282
{
281283
return !IS_ERR_OR_NULL(req->qos);

0 commit comments

Comments
 (0)