ipa_power.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
  3. * Copyright (C) 2018-2024 Linaro Ltd.
  4. */
  5. #ifndef _IPA_POWER_H_
  6. #define _IPA_POWER_H_
  7. #include <linux/types.h>
  8. struct device;
  9. struct ipa;
  10. struct ipa_power_data;
  11. /* IPA device power management function block */
  12. extern const struct dev_pm_ops ipa_pm_ops;
  13. /**
  14. * ipa_core_clock_rate() - Return the current IPA core clock rate
  15. * @ipa: IPA structure
  16. *
  17. * Return: The current clock rate (in Hz), or 0.
  18. */
  19. u32 ipa_core_clock_rate(struct ipa *ipa);
  20. /**
  21. * ipa_power_retention() - Control register retention on power collapse
  22. * @ipa: IPA pointer
  23. * @enable: Whether retention should be enabled or disabled
  24. */
  25. void ipa_power_retention(struct ipa *ipa, bool enable);
  26. /**
  27. * ipa_power_init() - Initialize IPA power management
  28. * @dev: IPA device
  29. * @data: Clock configuration data
  30. *
  31. * Return: A pointer to an ipa_power structure, or a pointer-coded error
  32. */
  33. struct ipa_power *ipa_power_init(struct device *dev,
  34. const struct ipa_power_data *data);
  35. /**
  36. * ipa_power_exit() - Inverse of ipa_power_init()
  37. * @power: IPA power pointer
  38. */
  39. void ipa_power_exit(struct ipa_power *power);
  40. #endif /* _IPA_POWER_H_ */