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
25 #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 iowrite32(mask, ipa->reg_virt + IPA_REG_IRQ_CLR_OFFSET); in ipa_interrupt_process()
65 interrupt->handler[irq_id](interrupt->ipa, irq_id); in ipa_interrupt_process()
72 iowrite32(mask, ipa->reg_virt + IPA_REG_IRQ_CLR_OFFSET); in ipa_interrupt_process()
75 /* Process all IPA interrupt types that have been signaled */
78 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_process_all() local
86 mask = ioread32(ipa->reg_virt + IPA_REG_IRQ_STTS_OFFSET); in ipa_interrupt_process_all()
95 mask = ioread32(ipa->reg_virt + IPA_REG_IRQ_STTS_OFFSET); in ipa_interrupt_process_all()
99 /* Threaded part of the IPA IRQ handler */
104 ipa_clock_get(interrupt->ipa); in ipa_isr_thread()
108 ipa_clock_put(interrupt->ipa); in ipa_isr_thread()
117 struct ipa *ipa = interrupt->ipa; in ipa_isr() local
120 mask = ioread32(ipa->reg_virt + IPA_REG_IRQ_STTS_OFFSET); in ipa_isr()
125 iowrite32(mask, ipa->reg_virt + IPA_REG_IRQ_CLR_OFFSET); in ipa_isr()
127 dev_err(&ipa->pdev->dev, "%s: unexpected interrupt, mask 0x%08x\n", in ipa_isr()
137 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_suspend_control() local
141 /* assert(mask & ipa->available); */ in ipa_interrupt_suspend_control()
142 val = ioread32(ipa->reg_virt + IPA_REG_SUSPEND_IRQ_EN_OFFSET); in ipa_interrupt_suspend_control()
147 iowrite32(val, ipa->reg_virt + IPA_REG_SUSPEND_IRQ_EN_OFFSET); in ipa_interrupt_suspend_control()
167 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_suspend_clear_all() local
170 val = ioread32(ipa->reg_virt + IPA_REG_IRQ_SUSPEND_INFO_OFFSET); in ipa_interrupt_suspend_clear_all()
171 iowrite32(val, ipa->reg_virt + IPA_REG_SUSPEND_IRQ_CLR_OFFSET); in ipa_interrupt_suspend_clear_all()
174 /* Simulate arrival of an IPA TX_SUSPEND interrupt */
180 /* Add a handler for an IPA interrupt */
184 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_add() local
189 /* Update the IPA interrupt mask to enable it */ in ipa_interrupt_add()
191 iowrite32(interrupt->enabled, ipa->reg_virt + IPA_REG_IRQ_EN_OFFSET); in ipa_interrupt_add()
194 /* Remove the handler for an IPA interrupt type */
198 struct ipa *ipa = interrupt->ipa; in ipa_interrupt_remove() local
201 /* Update the IPA interrupt mask to disable it */ in ipa_interrupt_remove()
203 iowrite32(interrupt->enabled, ipa->reg_virt + IPA_REG_IRQ_EN_OFFSET); in ipa_interrupt_remove()
208 /* Set up the IPA interrupt framework */
209 struct ipa_interrupt *ipa_interrupt_setup(struct ipa *ipa) in ipa_interrupt_setup() argument
211 struct device *dev = &ipa->pdev->dev; in ipa_interrupt_setup()
216 ret = platform_get_irq_byname(ipa->pdev, "ipa"); in ipa_interrupt_setup()
218 dev_err(dev, "DT error %d getting \"ipa\" IRQ property\n", in ipa_interrupt_setup()
227 interrupt->ipa = ipa; in ipa_interrupt_setup()
230 /* Start with all IPA interrupts disabled */ in ipa_interrupt_setup()
231 iowrite32(0, ipa->reg_virt + IPA_REG_IRQ_EN_OFFSET); in ipa_interrupt_setup()
234 "ipa", interrupt); in ipa_interrupt_setup()
236 dev_err(dev, "error %d requesting \"ipa\" IRQ\n", ret); in ipa_interrupt_setup()
242 dev_err(dev, "error %d enabling wakeup for \"ipa\" IRQ\n", ret); in ipa_interrupt_setup()
256 /* Tear down the IPA interrupt framework */
259 struct device *dev = &interrupt->ipa->pdev->dev; in ipa_interrupt_teardown()
264 dev_err(dev, "error %d disabling \"ipa\" IRQ wakeup\n", ret); in ipa_interrupt_teardown()