Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | |
| 3 | /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved. |
| 4 | * Copyright (C) 2018-2020 Linaro Ltd. |
| 5 | */ |
Alex Elder | 2775cbc | 2021-08-20 11:01:29 -0500 | [diff] [blame] | 6 | #ifndef _IPA_POWER_H_ |
| 7 | #define _IPA_POWER_H_ |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 8 | |
| 9 | struct device; |
| 10 | |
| 11 | struct ipa; |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 12 | struct ipa_power_data; |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 13 | |
Alex Elder | 73ff316 | 2021-08-04 10:36:24 -0500 | [diff] [blame] | 14 | /* IPA device power management function block */ |
| 15 | extern const struct dev_pm_ops ipa_pm_ops; |
| 16 | |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 17 | /** |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 18 | * ipa_core_clock_rate() - Return the current IPA core clock rate |
Alex Elder | 78b348f | 2020-07-03 16:23:34 -0500 | [diff] [blame] | 19 | * @ipa: IPA structure |
| 20 | * |
| 21 | * Return: The current clock rate (in Hz), or 0. |
| 22 | */ |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 23 | u32 ipa_core_clock_rate(struct ipa *ipa); |
Alex Elder | 78b348f | 2020-07-03 16:23:34 -0500 | [diff] [blame] | 24 | |
| 25 | /** |
Alex Elder | b8e36e1 | 2021-08-19 16:12:28 -0500 | [diff] [blame] | 26 | * ipa_power_modem_queue_stop() - Possibly stop the modem netdev TX queue |
| 27 | * @ipa: IPA pointer |
| 28 | */ |
| 29 | void ipa_power_modem_queue_stop(struct ipa *ipa); |
| 30 | |
| 31 | /** |
| 32 | * ipa_power_modem_queue_wake() - Possibly wake the modem netdev TX queue |
| 33 | * @ipa: IPA pointer |
| 34 | */ |
| 35 | void ipa_power_modem_queue_wake(struct ipa *ipa); |
| 36 | |
| 37 | /** |
| 38 | * ipa_power_modem_queue_active() - Report modem netdev TX queue active |
| 39 | * @ipa: IPA pointer |
| 40 | */ |
| 41 | void ipa_power_modem_queue_active(struct ipa *ipa); |
| 42 | |
| 43 | /** |
Alex Elder | afe1baa | 2021-08-04 10:36:25 -0500 | [diff] [blame] | 44 | * ipa_power_setup() - Set up IPA power management |
| 45 | * @ipa: IPA pointer |
Alex Elder | d430fe4 | 2021-08-12 14:50:30 -0500 | [diff] [blame] | 46 | * |
| 47 | * Return: 0 if successful, or a negative error code |
Alex Elder | afe1baa | 2021-08-04 10:36:25 -0500 | [diff] [blame] | 48 | */ |
Alex Elder | d430fe4 | 2021-08-12 14:50:30 -0500 | [diff] [blame] | 49 | int ipa_power_setup(struct ipa *ipa); |
Alex Elder | afe1baa | 2021-08-04 10:36:25 -0500 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * ipa_power_teardown() - Inverse of ipa_power_setup() |
| 53 | * @ipa: IPA pointer |
| 54 | */ |
| 55 | void ipa_power_teardown(struct ipa *ipa); |
| 56 | |
| 57 | /** |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 58 | * ipa_power_init() - Initialize IPA power management |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 59 | * @dev: IPA device |
Alex Elder | dfccb8b | 2020-11-19 16:40:39 -0600 | [diff] [blame] | 60 | * @data: Clock configuration data |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 61 | * |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 62 | * Return: A pointer to an ipa_power structure, or a pointer-coded error |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 63 | */ |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 64 | struct ipa_power *ipa_power_init(struct device *dev, |
| 65 | const struct ipa_power_data *data); |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 66 | |
| 67 | /** |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 68 | * ipa_power_exit() - Inverse of ipa_power_init() |
| 69 | * @power: IPA power pointer |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 70 | */ |
Alex Elder | 7aa0e8b | 2021-08-20 11:01:28 -0500 | [diff] [blame] | 71 | void ipa_power_exit(struct ipa_power *power); |
Alex Elder | ba764c4 | 2020-03-05 22:28:19 -0600 | [diff] [blame] | 72 | |
Alex Elder | 2775cbc | 2021-08-20 11:01:29 -0500 | [diff] [blame] | 73 | #endif /* _IPA_POWER_H_ */ |