xref: /linux/drivers/gpu/drm/i915/display/intel_dmc_wl.h (revision daa121128a2d2ac6006159e2c47676e4fcd21eab)
1 /* SPDX-License-Identifier: MIT */
2 /*
3  * Copyright (C) 2024 Intel Corporation
4  */
5 
6 #ifndef __INTEL_WAKELOCK_H__
7 #define __INTEL_WAKELOCK_H__
8 
9 #include <linux/types.h>
10 #include <linux/workqueue.h>
11 #include <linux/refcount.h>
12 
13 #include "i915_reg_defs.h"
14 
15 struct intel_display;
16 
17 struct intel_dmc_wl {
18 	spinlock_t lock; /* protects enabled, taken  and refcount */
19 	bool enabled;
20 	bool taken;
21 	refcount_t refcount;
22 	struct delayed_work work;
23 };
24 
25 void intel_dmc_wl_init(struct intel_display *display);
26 void intel_dmc_wl_enable(struct intel_display *display);
27 void intel_dmc_wl_disable(struct intel_display *display);
28 void intel_dmc_wl_get(struct intel_display *display, i915_reg_t reg);
29 void intel_dmc_wl_put(struct intel_display *display, i915_reg_t reg);
30 
31 #endif /* __INTEL_WAKELOCK_H__ */
32