1 /* SPDX-License-Identifier: GPL-2.0 */
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2018-2022 Linaro Ltd.
6 #ifndef _IPA_INTERRUPT_H_
7 #define _IPA_INTERRUPT_H_
9 #include <linux/types.h>
10 #include <linux/bits.h>
17 * ipa_interrupt_suspend_enable - Enable TX_SUSPEND for an endpoint
18 * @interrupt: IPA interrupt structure
19 * @endpoint_id: Endpoint whose interrupt should be enabled
21 * Note: The "TX" in the name is from the perspective of the IPA hardware.
22 * A TX_SUSPEND interrupt arrives on an AP RX enpoint when packet data can't
23 * be delivered to the endpoint because it is suspended (or its underlying
24 * channel is stopped).
26 void ipa_interrupt_suspend_enable(struct ipa_interrupt *interrupt,
30 * ipa_interrupt_suspend_disable - Disable TX_SUSPEND for an endpoint
31 * @interrupt: IPA interrupt structure
32 * @endpoint_id: Endpoint whose interrupt should be disabled
34 void ipa_interrupt_suspend_disable(struct ipa_interrupt *interrupt,
38 * ipa_interrupt_suspend_clear_all - clear all suspend interrupts
39 * @interrupt: IPA interrupt structure
41 * Clear the TX_SUSPEND interrupt for all endpoints that signaled it.
43 void ipa_interrupt_suspend_clear_all(struct ipa_interrupt *interrupt);
46 * ipa_interrupt_simulate_suspend() - Simulate TX_SUSPEND IPA interrupt
47 * @interrupt: IPA interrupt structure
49 * This calls the TX_SUSPEND interrupt handler, as if such an interrupt
50 * had been signaled. This is needed to work around a hardware quirk
51 * that occurs if aggregation is active on an endpoint when its underlying
52 * channel is suspended.
54 void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt);
57 * ipa_interrupt_enable() - Enable an IPA interrupt type
59 * @ipa_irq: IPA interrupt ID
61 void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
64 * ipa_interrupt_disable() - Disable an IPA interrupt type
66 * @ipa_irq: IPA interrupt ID
68 void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
71 * ipa_interrupt_irq_enable() - Enable IPA interrupts
74 * This enables the IPA interrupt line
76 void ipa_interrupt_irq_enable(struct ipa *ipa);
79 * ipa_interrupt_irq_disable() - Disable IPA interrupts
82 * This disables the IPA interrupt line
84 void ipa_interrupt_irq_disable(struct ipa *ipa);
87 * ipa_interrupt_config() - Configure the IPA interrupt framework
90 * Return: Pointer to IPA SMP2P info, or a pointer-coded error
92 struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa);
95 * ipa_interrupt_deconfig() - Inverse of ipa_interrupt_config()
96 * @interrupt: IPA interrupt structure
98 void ipa_interrupt_deconfig(struct ipa_interrupt *interrupt);
100 #endif /* _IPA_INTERRUPT_H_ */