cc_pm.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (C) 2012-2019 ARM Limited (or its affiliates). */
  3. /* \file cc_pm.h
  4. */
  5. #ifndef __CC_POWER_MGR_H__
  6. #define __CC_POWER_MGR_H__
  7. #include "cc_driver.h"
  8. #define CC_SUSPEND_TIMEOUT 3000
  9. #if defined(CONFIG_PM)
  10. extern const struct dev_pm_ops ccree_pm;
  11. int cc_pm_init(struct cc_drvdata *drvdata);
  12. void cc_pm_go(struct cc_drvdata *drvdata);
  13. void cc_pm_fini(struct cc_drvdata *drvdata);
  14. int cc_pm_suspend(struct device *dev);
  15. int cc_pm_resume(struct device *dev);
  16. int cc_pm_get(struct device *dev);
  17. int cc_pm_put_suspend(struct device *dev);
  18. bool cc_pm_is_dev_suspended(struct device *dev);
  19. #else
  20. static inline int cc_pm_init(struct cc_drvdata *drvdata)
  21. {
  22. return 0;
  23. }
  24. static inline void cc_pm_go(struct cc_drvdata *drvdata) {}
  25. static inline void cc_pm_fini(struct cc_drvdata *drvdata) {}
  26. static inline int cc_pm_suspend(struct device *dev)
  27. {
  28. return 0;
  29. }
  30. static inline int cc_pm_resume(struct device *dev)
  31. {
  32. return 0;
  33. }
  34. static inline int cc_pm_get(struct device *dev)
  35. {
  36. return 0;
  37. }
  38. static inline int cc_pm_put_suspend(struct device *dev)
  39. {
  40. return 0;
  41. }
  42. static inline bool cc_pm_is_dev_suspended(struct device *dev)
  43. {
  44. /* if PM not supported device is never suspend */
  45. return false;
  46. }
  47. #endif
  48. #endif /*__POWER_MGR_H__*/