xref: /linux/drivers/accel/amdxdna/amdxdna_pm.h (revision 1fd1dc41724319406b0aff221a352a400b0ddfc5)
1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright (C) 2025, Advanced Micro Devices, Inc.
4  */
5 
6 #ifndef _AMDXDNA_PM_H_
7 #define _AMDXDNA_PM_H_
8 
9 #include "amdxdna_pci_drv.h"
10 
11 int amdxdna_pm_suspend(struct device *dev);
12 int amdxdna_pm_resume(struct device  *dev);
13 int amdxdna_pm_resume_get(struct amdxdna_dev *xdna);
14 void amdxdna_pm_suspend_put(struct amdxdna_dev *xdna);
15 void amdxdna_pm_init(struct amdxdna_dev *xdna);
16 void amdxdna_pm_fini(struct amdxdna_dev *xdna);
17 
18 static inline int amdxdna_pm_resume_get_locked(struct amdxdna_dev *xdna)
19 {
20 	int ret;
21 
22 	mutex_unlock(&xdna->dev_lock);
23 	ret = amdxdna_pm_resume_get(xdna);
24 	mutex_lock(&xdna->dev_lock);
25 
26 	return ret;
27 }
28 
29 #endif /* _AMDXDNA_PM_H_ */
30