1 /* SPDX-License-Identifier: GPL-2.0-only OR MIT */
2 /* Copyright (c) 2023 Imagination Technologies Ltd. */
7 #include "pvr_device.h"
9 #include <linux/mutex.h>
10 #include <linux/pm_runtime.h>
12 int pvr_watchdog_init(struct pvr_device *pvr_dev);
13 void pvr_watchdog_fini(struct pvr_device *pvr_dev);
15 void pvr_device_lost(struct pvr_device *pvr_dev);
17 bool pvr_power_is_idle(struct pvr_device *pvr_dev);
19 int pvr_power_device_suspend(struct device *dev);
20 int pvr_power_device_resume(struct device *dev);
21 int pvr_power_device_idle(struct device *dev);
23 int pvr_power_reset(struct pvr_device *pvr_dev, bool hard_reset);
25 static __always_inline int
26 pvr_power_get(struct pvr_device *pvr_dev)
28 struct drm_device *drm_dev = from_pvr_device(pvr_dev);
30 return pm_runtime_resume_and_get(drm_dev->dev);
33 static __always_inline int
34 pvr_power_put(struct pvr_device *pvr_dev)
36 struct drm_device *drm_dev = from_pvr_device(pvr_dev);
38 return pm_runtime_put(drm_dev->dev);
41 #endif /* PVR_POWER_H */