167754Smsmith/* SPDX-License-Identifier: MIT */ 267754Smsmith/* 367754Smsmith * Copyright (C) 2024 Intel Corporation 467754Smsmith */ 571867Smsmith 667754Smsmith#ifndef __INTEL_WAKELOCK_H__ 767754Smsmith#define __INTEL_WAKELOCK_H__ 867754Smsmith 967754Smsmith#include <linux/types.h> 1067754Smsmith#include <linux/workqueue.h> 1167754Smsmith#include <linux/refcount.h> 1267754Smsmith 1371867Smsmith#include "i915_reg_defs.h" 1470243Smsmith 1567754Smsmithstruct intel_display; 1667754Smsmith 1767754Smsmithstruct intel_dmc_wl { 1867754Smsmith spinlock_t lock; /* protects enabled, taken and refcount */ 1967754Smsmith bool enabled; 2067754Smsmith bool taken; 2167754Smsmith refcount_t refcount; 2267754Smsmith struct delayed_work work; 2367754Smsmith}; 2467754Smsmith 2567754Smsmithvoid intel_dmc_wl_init(struct intel_display *display); 2667754Smsmithvoid intel_dmc_wl_enable(struct intel_display *display); 2767754Smsmithvoid intel_dmc_wl_disable(struct intel_display *display); 2867754Smsmithvoid intel_dmc_wl_get(struct intel_display *display, i915_reg_t reg); 2967754Smsmithvoid intel_dmc_wl_put(struct intel_display *display, i915_reg_t reg); 3067754Smsmith 3167754Smsmith#endif /* __INTEL_WAKELOCK_H__ */ 3267754Smsmith