Linux Audio

Check our new training course

Loading...
Note: File does not exist in v4.6.
 1/*
 2 * SPDX-License-Identifier: MIT
 3 *
 4 * Copyright © 2019 Intel Corporation
 5 */
 6
 7#ifndef INTEL_GT_PM_H
 8#define INTEL_GT_PM_H
 9
10#include <linux/types.h>
11
12#include "intel_gt_types.h"
13#include "intel_wakeref.h"
14
15enum {
16	INTEL_GT_UNPARK,
17	INTEL_GT_PARK,
18};
19
20static inline bool intel_gt_pm_is_awake(const struct intel_gt *gt)
21{
22	return intel_wakeref_is_active(&gt->wakeref);
23}
24
25static inline void intel_gt_pm_get(struct intel_gt *gt)
26{
27	intel_wakeref_get(&gt->wakeref);
28}
29
30static inline bool intel_gt_pm_get_if_awake(struct intel_gt *gt)
31{
32	return intel_wakeref_get_if_active(&gt->wakeref);
33}
34
35static inline void intel_gt_pm_put(struct intel_gt *gt)
36{
37	intel_wakeref_put(&gt->wakeref);
38}
39
40static inline int intel_gt_pm_wait_for_idle(struct intel_gt *gt)
41{
42	return intel_wakeref_wait_for_idle(&gt->wakeref);
43}
44
45void intel_gt_pm_init_early(struct intel_gt *gt);
46
47void intel_gt_sanitize(struct intel_gt *gt, bool force);
48int intel_gt_resume(struct intel_gt *gt);
49void intel_gt_runtime_suspend(struct intel_gt *gt);
50int intel_gt_runtime_resume(struct intel_gt *gt);
51
52#endif /* INTEL_GT_PM_H */