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