1 /* SPDX-License-Identifier: GPL-2.0 */
3 /* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2018-2024 Linaro Ltd.
6 #ifndef _IPA_INTERRUPT_H_
7 #define _IPA_INTERRUPT_H_
9 #include <linux/types.h>
11 struct platform_device
;
19 * ipa_interrupt_suspend_enable - Enable TX_SUSPEND for an endpoint
20 * @interrupt: IPA interrupt structure
21 * @endpoint_id: Endpoint whose interrupt should be enabled
23 * Note: The "TX" in the name is from the perspective of the IPA hardware.
24 * A TX_SUSPEND interrupt arrives on an AP RX enpoint when packet data can't
25 * be delivered to the endpoint because it is suspended (or its underlying
26 * channel is stopped).
28 void ipa_interrupt_suspend_enable(struct ipa_interrupt
*interrupt
,
32 * ipa_interrupt_suspend_disable - Disable TX_SUSPEND for an endpoint
33 * @interrupt: IPA interrupt structure
34 * @endpoint_id: Endpoint whose interrupt should be disabled
36 void ipa_interrupt_suspend_disable(struct ipa_interrupt
*interrupt
,
40 * ipa_interrupt_simulate_suspend() - Simulate TX_SUSPEND IPA interrupt
41 * @interrupt: IPA interrupt structure
43 * This calls the TX_SUSPEND interrupt handler, as if such an interrupt
44 * had been signaled. This is needed to work around a hardware quirk
45 * that occurs if aggregation is active on an endpoint when its underlying
46 * channel is suspended.
48 void ipa_interrupt_simulate_suspend(struct ipa_interrupt
*interrupt
);
51 * ipa_interrupt_enable() - Enable an IPA interrupt type
53 * @ipa_irq: IPA interrupt ID
55 void ipa_interrupt_enable(struct ipa
*ipa
, enum ipa_irq_id ipa_irq
);
58 * ipa_interrupt_disable() - Disable an IPA interrupt type
60 * @ipa_irq: IPA interrupt ID
62 void ipa_interrupt_disable(struct ipa
*ipa
, enum ipa_irq_id ipa_irq
);
65 * ipa_interrupt_irq_enable() - Enable IPA interrupts
68 * This enables the IPA interrupt line
70 void ipa_interrupt_irq_enable(struct ipa
*ipa
);
73 * ipa_interrupt_irq_disable() - Disable IPA interrupts
76 * This disables the IPA interrupt line
78 void ipa_interrupt_irq_disable(struct ipa
*ipa
);
81 * ipa_interrupt_config() - Configure IPA interrupts
84 * Return: 0 if successful, or a negative error code
86 int ipa_interrupt_config(struct ipa
*ipa
);
89 * ipa_interrupt_deconfig() - Inverse of ipa_interrupt_config()
92 void ipa_interrupt_deconfig(struct ipa
*ipa
);
95 * ipa_interrupt_init() - Initialize the IPA interrupt structure
96 * @pdev: IPA platform device pointer
98 * Return: Pointer to an IPA interrupt structure, or a pointer-coded error
100 struct ipa_interrupt
*ipa_interrupt_init(struct platform_device
*pdev
);
103 * ipa_interrupt_exit() - Inverse of ipa_interrupt_init()
104 * @interrupt: IPA interrupt structure
106 void ipa_interrupt_exit(struct ipa_interrupt
*interrupt
);
108 #endif /* _IPA_INTERRUPT_H_ */