xref: /OK3568_Linux_fs/kernel/drivers/net/ipa/ipa_smp2p.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun 
3*4882a593Smuzhiyun /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4*4882a593Smuzhiyun  * Copyright (C) 2019-2020 Linaro Ltd.
5*4882a593Smuzhiyun  */
6*4882a593Smuzhiyun #ifndef _IPA_SMP2P_H_
7*4882a593Smuzhiyun #define _IPA_SMP2P_H_
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #include <linux/types.h>
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun struct ipa;
12*4882a593Smuzhiyun 
13*4882a593Smuzhiyun /**
14*4882a593Smuzhiyun  * ipa_smp2p_init() - Initialize the IPA SMP2P subsystem
15*4882a593Smuzhiyun  * @ipa:	IPA pointer
16*4882a593Smuzhiyun  * @modem_init:	Whether the modem is responsible for GSI initialization
17*4882a593Smuzhiyun  *
18*4882a593Smuzhiyun  * Return:	0 if successful, or a negative error code
19*4882a593Smuzhiyun  *
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun int ipa_smp2p_init(struct ipa *ipa, bool modem_init);
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun /**
24*4882a593Smuzhiyun  * ipa_smp2p_exit() - Inverse of ipa_smp2p_init()
25*4882a593Smuzhiyun  * @ipa:	IPA pointer
26*4882a593Smuzhiyun  */
27*4882a593Smuzhiyun void ipa_smp2p_exit(struct ipa *ipa);
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun /**
30*4882a593Smuzhiyun  * ipa_smp2p_disable() - Prevent "ipa-setup-ready" interrupt handling
31*4882a593Smuzhiyun  * @IPA:	IPA pointer
32*4882a593Smuzhiyun  *
33*4882a593Smuzhiyun  * Prevent handling of the "setup ready" interrupt from the modem.
34*4882a593Smuzhiyun  * This is used before initiating shutdown of the driver.
35*4882a593Smuzhiyun  */
36*4882a593Smuzhiyun void ipa_smp2p_disable(struct ipa *ipa);
37*4882a593Smuzhiyun 
38*4882a593Smuzhiyun /**
39*4882a593Smuzhiyun  * ipa_smp2p_notify_reset() - Reset modem notification state
40*4882a593Smuzhiyun  * @ipa:	IPA pointer
41*4882a593Smuzhiyun  *
42*4882a593Smuzhiyun  * If the modem crashes it queries the IPA clock state.  In cleaning
43*4882a593Smuzhiyun  * up after such a crash this is used to reset some state maintained
44*4882a593Smuzhiyun  * for managing this notification.
45*4882a593Smuzhiyun  */
46*4882a593Smuzhiyun void ipa_smp2p_notify_reset(struct ipa *ipa);
47*4882a593Smuzhiyun 
48*4882a593Smuzhiyun #endif /* _IPA_SMP2P_H_ */
49