blob: 7b7864f3029b663778f950fa65852272af7a5032 [file] [log] [blame]
Alex Elderba764c42020-03-05 22:28:19 -06001/* 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 */
6#ifndef _IPA_CLOCK_H_
7#define _IPA_CLOCK_H_
8
9struct device;
10
11struct ipa;
Alex Elderdfccb8b2020-11-19 16:40:39 -060012struct ipa_clock_data;
Alex Elderba764c42020-03-05 22:28:19 -060013
Alex Elder73ff3162021-08-04 10:36:24 -050014/* IPA device power management function block */
15extern const struct dev_pm_ops ipa_pm_ops;
16
Alex Elderba764c42020-03-05 22:28:19 -060017/**
Alex Elder78b348f2020-07-03 16:23:34 -050018 * ipa_clock_rate() - Return the current IPA core clock rate
19 * @ipa: IPA structure
20 *
21 * Return: The current clock rate (in Hz), or 0.
22 */
23u32 ipa_clock_rate(struct ipa *ipa);
24
25/**
Alex Elderb8e36e12021-08-19 16:12:28 -050026 * ipa_power_modem_queue_stop() - Possibly stop the modem netdev TX queue
27 * @ipa: IPA pointer
28 */
29void 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 */
35void 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 */
41void ipa_power_modem_queue_active(struct ipa *ipa);
42
43/**
Alex Elderafe1baa2021-08-04 10:36:25 -050044 * ipa_power_setup() - Set up IPA power management
45 * @ipa: IPA pointer
Alex Elderd430fe42021-08-12 14:50:30 -050046 *
47 * Return: 0 if successful, or a negative error code
Alex Elderafe1baa2021-08-04 10:36:25 -050048 */
Alex Elderd430fe42021-08-12 14:50:30 -050049int ipa_power_setup(struct ipa *ipa);
Alex Elderafe1baa2021-08-04 10:36:25 -050050
51/**
52 * ipa_power_teardown() - Inverse of ipa_power_setup()
53 * @ipa: IPA pointer
54 */
55void ipa_power_teardown(struct ipa *ipa);
56
57/**
Alex Elderba764c42020-03-05 22:28:19 -060058 * ipa_clock_init() - Initialize IPA clocking
59 * @dev: IPA device
Alex Elderdfccb8b2020-11-19 16:40:39 -060060 * @data: Clock configuration data
Alex Elderba764c42020-03-05 22:28:19 -060061 *
Alex Eldere3eea082020-07-13 07:24:18 -050062 * Return: A pointer to an ipa_clock structure, or a pointer-coded error
Alex Elderba764c42020-03-05 22:28:19 -060063 */
Alex Elderdfccb8b2020-11-19 16:40:39 -060064struct ipa_clock *ipa_clock_init(struct device *dev,
65 const struct ipa_clock_data *data);
Alex Elderba764c42020-03-05 22:28:19 -060066
67/**
68 * ipa_clock_exit() - Inverse of ipa_clock_init()
69 * @clock: IPA clock pointer
70 */
71void ipa_clock_exit(struct ipa_clock *clock);
72
Alex Elderba764c42020-03-05 22:28:19 -060073#endif /* _IPA_CLOCK_H_ */