Lines Matching full:ipa

7 /* DOC: IPA Interrupts
9 * The IPA has an interrupt line distinct from the interrupt used by the GSI
11 * transfer completions), IPA interrupts are related to other events related
12 * to the IPA. Some of the IPA interrupts come from a microcontroller
13 * embedded in the IPA. Each IPA interrupt type can be both masked and
16 * Two of the IPA interrupts are initiated by the microcontroller. A third
17 * can be generated to signal the need for a wakeup/resume when an IPA
18 * endpoint has been suspended. There are other IPA events, but at this
26 #include "ipa.h"
32 * struct ipa_interrupt - IPA interrupt information
33 * @ipa: IPA pointer
34 * @irq: Linux IRQ number used for IPA interrupts
36 * @handler: Array of handlers indexed by IPA interrupt ID
39 struct ipa *ipa; member
55 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_process() local
62 offset = ipa_reg_irq_clr_offset(ipa->version); in ipa_interrupt_process()
64 iowrite32(mask, ipa->reg_virt + offset); in ipa_interrupt_process()
67 interrupt->handler[irq_id](interrupt->ipa, irq_id); in ipa_interrupt_process()
74 iowrite32(mask, ipa->reg_virt + offset); in ipa_interrupt_process()
77 /* IPA IRQ handler is threaded */
81 struct ipa *ipa = interrupt->ipa; in ipa_isr_thread() local
89 dev = &ipa->pdev->dev; in ipa_isr_thread()
98 offset = ipa_reg_irq_stts_offset(ipa->version); in ipa_isr_thread()
99 pending = ioread32(ipa->reg_virt + offset); in ipa_isr_thread()
108 pending = ioread32(ipa->reg_virt + offset); in ipa_isr_thread()
113 dev_dbg(dev, "clearing disabled IPA interrupts 0x%08x\n", in ipa_isr_thread()
115 offset = ipa_reg_irq_clr_offset(ipa->version); in ipa_isr_thread()
116 iowrite32(pending, ipa->reg_virt + offset); in ipa_isr_thread()
129 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_suspend_control() local
134 WARN_ON(!(mask & ipa->available)); in ipa_interrupt_suspend_control()
136 /* IPA version 3.0 does not support TX_SUSPEND interrupt control */ in ipa_interrupt_suspend_control()
137 if (ipa->version == IPA_VERSION_3_0) in ipa_interrupt_suspend_control()
140 offset = ipa_reg_irq_suspend_en_offset(ipa->version); in ipa_interrupt_suspend_control()
141 val = ioread32(ipa->reg_virt + offset); in ipa_interrupt_suspend_control()
146 iowrite32(val, ipa->reg_virt + offset); in ipa_interrupt_suspend_control()
166 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_suspend_clear_all() local
170 offset = ipa_reg_irq_suspend_info_offset(ipa->version); in ipa_interrupt_suspend_clear_all()
171 val = ioread32(ipa->reg_virt + offset); in ipa_interrupt_suspend_clear_all()
173 /* SUSPEND interrupt status isn't cleared on IPA version 3.0 */ in ipa_interrupt_suspend_clear_all()
174 if (ipa->version == IPA_VERSION_3_0) in ipa_interrupt_suspend_clear_all()
177 offset = ipa_reg_irq_suspend_clr_offset(ipa->version); in ipa_interrupt_suspend_clear_all()
178 iowrite32(val, ipa->reg_virt + offset); in ipa_interrupt_suspend_clear_all()
181 /* Simulate arrival of an IPA TX_SUSPEND interrupt */
187 /* Add a handler for an IPA interrupt */
191 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_add() local
198 /* Update the IPA interrupt mask to enable it */ in ipa_interrupt_add()
200 offset = ipa_reg_irq_en_offset(ipa->version); in ipa_interrupt_add()
201 iowrite32(interrupt->enabled, ipa->reg_virt + offset); in ipa_interrupt_add()
204 /* Remove the handler for an IPA interrupt type */
208 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_remove() local
213 /* Update the IPA interrupt mask to disable it */ in ipa_interrupt_remove()
215 offset = ipa_reg_irq_en_offset(ipa->version); in ipa_interrupt_remove()
216 iowrite32(interrupt->enabled, ipa->reg_virt + offset); in ipa_interrupt_remove()
221 /* Configure the IPA interrupt framework */
222 struct ipa_interrupt *ipa_interrupt_config(struct ipa *ipa) in ipa_interrupt_config() argument
224 struct device *dev = &ipa->pdev->dev; in ipa_interrupt_config()
230 ret = platform_get_irq_byname(ipa->pdev, "ipa"); in ipa_interrupt_config()
232 dev_err(dev, "DT error %d getting \"ipa\" IRQ property\n", in ipa_interrupt_config()
241 interrupt->ipa = ipa; in ipa_interrupt_config()
244 /* Start with all IPA interrupts disabled */ in ipa_interrupt_config()
245 offset = ipa_reg_irq_en_offset(ipa->version); in ipa_interrupt_config()
246 iowrite32(0, ipa->reg_virt + offset); in ipa_interrupt_config()
249 "ipa", interrupt); in ipa_interrupt_config()
251 dev_err(dev, "error %d requesting \"ipa\" IRQ\n", ret); in ipa_interrupt_config()
257 dev_err(dev, "error %d enabling wakeup for \"ipa\" IRQ\n", ret); in ipa_interrupt_config()
274 struct device *dev = &interrupt->ipa->pdev->dev; in ipa_interrupt_deconfig()
279 dev_err(dev, "error %d disabling \"ipa\" IRQ wakeup\n", ret); in ipa_interrupt_deconfig()