1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 /* 3 * Copyright (C) 2020-2023 Intel Corporation 4 */ 5 6 #ifndef __IVPU_PM_H__ 7 #define __IVPU_PM_H__ 8 9 #include <linux/types.h> 10 11 struct ivpu_device; 12 13 struct ivpu_pm_info { 14 struct ivpu_device *vdev; 15 struct work_struct recovery_work; 16 atomic_t in_reset; 17 bool is_warmboot; 18 u32 suspend_reschedule_counter; 19 }; 20 21 int ivpu_pm_init(struct ivpu_device *vdev); 22 void ivpu_pm_enable(struct ivpu_device *vdev); 23 void ivpu_pm_disable(struct ivpu_device *vdev); 24 25 int ivpu_pm_suspend_cb(struct device *dev); 26 int ivpu_pm_resume_cb(struct device *dev); 27 int ivpu_pm_runtime_suspend_cb(struct device *dev); 28 int ivpu_pm_runtime_resume_cb(struct device *dev); 29 30 void ivpu_pm_reset_prepare_cb(struct pci_dev *pdev); 31 void ivpu_pm_reset_done_cb(struct pci_dev *pdev); 32 33 int __must_check ivpu_rpm_get(struct ivpu_device *vdev); 34 void ivpu_rpm_put(struct ivpu_device *vdev); 35 36 void ivpu_pm_schedule_recovery(struct ivpu_device *vdev); 37 38 #endif /* __IVPU_PM_H__ */ 39