Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 2 | /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 3 | |
| 4 | /* \file cc_pm.h |
| 5 | */ |
| 6 | |
| 7 | #ifndef __CC_POWER_MGR_H__ |
| 8 | #define __CC_POWER_MGR_H__ |
| 9 | |
| 10 | #include "cc_driver.h" |
| 11 | |
| 12 | #define CC_SUSPEND_TIMEOUT 3000 |
| 13 | |
| 14 | #if defined(CONFIG_PM) |
| 15 | |
| 16 | extern const struct dev_pm_ops ccree_pm; |
| 17 | |
| 18 | int cc_pm_init(struct cc_drvdata *drvdata); |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 19 | void cc_pm_go(struct cc_drvdata *drvdata); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 20 | void cc_pm_fini(struct cc_drvdata *drvdata); |
| 21 | int cc_pm_suspend(struct device *dev); |
| 22 | int cc_pm_resume(struct device *dev); |
| 23 | int cc_pm_get(struct device *dev); |
| 24 | int cc_pm_put_suspend(struct device *dev); |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 25 | bool cc_pm_is_dev_suspended(struct device *dev); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 26 | |
| 27 | #else |
| 28 | |
| 29 | static inline int cc_pm_init(struct cc_drvdata *drvdata) |
| 30 | { |
| 31 | return 0; |
| 32 | } |
| 33 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 34 | static inline void cc_pm_go(struct cc_drvdata *drvdata) {} |
| 35 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 36 | static inline void cc_pm_fini(struct cc_drvdata *drvdata) {} |
| 37 | |
| 38 | static inline int cc_pm_suspend(struct device *dev) |
| 39 | { |
| 40 | return 0; |
| 41 | } |
| 42 | |
| 43 | static inline int cc_pm_resume(struct device *dev) |
| 44 | { |
| 45 | return 0; |
| 46 | } |
| 47 | |
| 48 | static inline int cc_pm_get(struct device *dev) |
| 49 | { |
| 50 | return 0; |
| 51 | } |
| 52 | |
| 53 | static inline int cc_pm_put_suspend(struct device *dev) |
| 54 | { |
| 55 | return 0; |
| 56 | } |
| 57 | |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame^] | 58 | static inline bool cc_pm_is_dev_suspended(struct device *dev) |
| 59 | { |
| 60 | /* if PM not supported device is never suspend */ |
| 61 | return false; |
| 62 | } |
| 63 | |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 64 | #endif |
| 65 | |
| 66 | #endif /*__POWER_MGR_H__*/ |