Loading...
1/* SPDX-License-Identifier: GPL-2.0 */
2
3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2018-2022 Linaro Ltd.
5 */
6#ifndef _IPA_INTERRUPT_H_
7#define _IPA_INTERRUPT_H_
8
9#include <linux/types.h>
10#include <linux/bits.h>
11
12struct ipa;
13struct ipa_interrupt;
14enum ipa_irq_id;
15
16/**
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
20 *
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).
25 */
26void ipa_interrupt_suspend_enable(struct ipa_interrupt *interrupt,
27 u32 endpoint_id);
28
29/**
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
33 */
34void ipa_interrupt_suspend_disable(struct ipa_interrupt *interrupt,
35 u32 endpoint_id);
36
37/**
38 * ipa_interrupt_simulate_suspend() - Simulate TX_SUSPEND IPA interrupt
39 * @interrupt: IPA interrupt structure
40 *
41 * This calls the TX_SUSPEND interrupt handler, as if such an interrupt
42 * had been signaled. This is needed to work around a hardware quirk
43 * that occurs if aggregation is active on an endpoint when its underlying
44 * channel is suspended.
45 */
46void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt);
47
48/**
49 * ipa_interrupt_enable() - Enable an IPA interrupt type
50 * @ipa: IPA pointer
51 * @ipa_irq: IPA interrupt ID
52 */
53void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
54
55/**
56 * ipa_interrupt_disable() - Disable an IPA interrupt type
57 * @ipa: IPA pointer
58 * @ipa_irq: IPA interrupt ID
59 */
60void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
61
62/**
63 * ipa_interrupt_irq_enable() - Enable IPA interrupts
64 * @ipa: IPA pointer
65 *
66 * This enables the IPA interrupt line
67 */
68void ipa_interrupt_irq_enable(struct ipa *ipa);
69
70/**
71 * ipa_interrupt_irq_disable() - Disable IPA interrupts
72 * @ipa: IPA pointer
73 *
74 * This disables the IPA interrupt line
75 */
76void ipa_interrupt_irq_disable(struct ipa *ipa);
77
78/**
79 * ipa_interrupt_config() - Configure IPA interrupts
80 * @ipa: IPA pointer
81 *
82 * Return: 0 if successful, or a negative error code
83 */
84int ipa_interrupt_config(struct ipa *ipa);
85
86/**
87 * ipa_interrupt_deconfig() - Inverse of ipa_interrupt_config()
88 * @ipa: IPA pointer
89 */
90void ipa_interrupt_deconfig(struct ipa *ipa);
91
92/**
93 * ipa_interrupt_init() - Initialize the IPA interrupt structure
94 * @pdev: IPA platform device pointer
95 *
96 * Return: Pointer to an IPA interrupt structure, or a pointer-coded error
97 */
98struct ipa_interrupt *ipa_interrupt_init(struct platform_device *pdev);
99
100/**
101 * ipa_interrupt_exit() - Inverse of ipa_interrupt_init()
102 * @interrupt: IPA interrupt structure
103 */
104void ipa_interrupt_exit(struct ipa_interrupt *interrupt);
105
106#endif /* _IPA_INTERRUPT_H_ */
1/* SPDX-License-Identifier: GPL-2.0 */
2
3/* Copyright (c) 2012-2018, The Linux Foundation. All rights reserved.
4 * Copyright (C) 2018-2024 Linaro Ltd.
5 */
6#ifndef _IPA_INTERRUPT_H_
7#define _IPA_INTERRUPT_H_
8
9#include <linux/types.h>
10
11struct platform_device;
12
13struct ipa;
14struct ipa_interrupt;
15
16enum ipa_irq_id;
17
18/**
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
22 *
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).
27 */
28void ipa_interrupt_suspend_enable(struct ipa_interrupt *interrupt,
29 u32 endpoint_id);
30
31/**
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
35 */
36void ipa_interrupt_suspend_disable(struct ipa_interrupt *interrupt,
37 u32 endpoint_id);
38
39/**
40 * ipa_interrupt_simulate_suspend() - Simulate TX_SUSPEND IPA interrupt
41 * @interrupt: IPA interrupt structure
42 *
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.
47 */
48void ipa_interrupt_simulate_suspend(struct ipa_interrupt *interrupt);
49
50/**
51 * ipa_interrupt_enable() - Enable an IPA interrupt type
52 * @ipa: IPA pointer
53 * @ipa_irq: IPA interrupt ID
54 */
55void ipa_interrupt_enable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
56
57/**
58 * ipa_interrupt_disable() - Disable an IPA interrupt type
59 * @ipa: IPA pointer
60 * @ipa_irq: IPA interrupt ID
61 */
62void ipa_interrupt_disable(struct ipa *ipa, enum ipa_irq_id ipa_irq);
63
64/**
65 * ipa_interrupt_irq_enable() - Enable IPA interrupts
66 * @ipa: IPA pointer
67 *
68 * This enables the IPA interrupt line
69 */
70void ipa_interrupt_irq_enable(struct ipa *ipa);
71
72/**
73 * ipa_interrupt_irq_disable() - Disable IPA interrupts
74 * @ipa: IPA pointer
75 *
76 * This disables the IPA interrupt line
77 */
78void ipa_interrupt_irq_disable(struct ipa *ipa);
79
80/**
81 * ipa_interrupt_config() - Configure IPA interrupts
82 * @ipa: IPA pointer
83 *
84 * Return: 0 if successful, or a negative error code
85 */
86int ipa_interrupt_config(struct ipa *ipa);
87
88/**
89 * ipa_interrupt_deconfig() - Inverse of ipa_interrupt_config()
90 * @ipa: IPA pointer
91 */
92void ipa_interrupt_deconfig(struct ipa *ipa);
93
94/**
95 * ipa_interrupt_init() - Initialize the IPA interrupt structure
96 * @pdev: IPA platform device pointer
97 *
98 * Return: Pointer to an IPA interrupt structure, or a pointer-coded error
99 */
100struct ipa_interrupt *ipa_interrupt_init(struct platform_device *pdev);
101
102/**
103 * ipa_interrupt_exit() - Inverse of ipa_interrupt_init()
104 * @interrupt: IPA interrupt structure
105 */
106void ipa_interrupt_exit(struct ipa_interrupt *interrupt);
107
108#endif /* _IPA_INTERRUPT_H_ */