181ef8bf8SLina Iyer /* SPDX-License-Identifier: GPL-2.0-only */ 281ef8bf8SLina Iyer 381ef8bf8SLina Iyer #ifndef __QCOM_IRQ_H 481ef8bf8SLina Iyer #define __QCOM_IRQ_H 581ef8bf8SLina Iyer 681ef8bf8SLina Iyer #include <linux/irqdomain.h> 781ef8bf8SLina Iyer 881ef8bf8SLina Iyer #define GPIO_NO_WAKE_IRQ ~0U 981ef8bf8SLina Iyer 1081ef8bf8SLina Iyer /** 1181ef8bf8SLina Iyer * QCOM specific IRQ domain flags that distinguishes the handling of wakeup 1281ef8bf8SLina Iyer * capable interrupts by different interrupt controllers. 1381ef8bf8SLina Iyer * 1481ef8bf8SLina Iyer * IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP: Line must be masked at TLMM and the 1581ef8bf8SLina Iyer * interrupt configuration is done at PDC 1681ef8bf8SLina Iyer * IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP: Interrupt configuration is handled at TLMM 1781ef8bf8SLina Iyer */ 1881ef8bf8SLina Iyer #define IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 0) 1981ef8bf8SLina Iyer #define IRQ_DOMAIN_FLAG_QCOM_MPM_WAKEUP (IRQ_DOMAIN_FLAG_NONCORE << 1) 2081ef8bf8SLina Iyer 21*e35a6ae0SLina Iyer /** 22*e35a6ae0SLina Iyer * irq_domain_qcom_handle_wakeup: Return if the domain handles interrupt 23*e35a6ae0SLina Iyer * configuration 24*e35a6ae0SLina Iyer * @d: irq domain 25*e35a6ae0SLina Iyer * 26*e35a6ae0SLina Iyer * This QCOM specific irq domain call returns if the interrupt controller 27*e35a6ae0SLina Iyer * requires the interrupt be masked at the child interrupt controller. 28*e35a6ae0SLina Iyer */ 29*e35a6ae0SLina Iyer static inline bool irq_domain_qcom_handle_wakeup(const struct irq_domain *d) 30*e35a6ae0SLina Iyer { 31*e35a6ae0SLina Iyer return (d->flags & IRQ_DOMAIN_FLAG_QCOM_PDC_WAKEUP); 32*e35a6ae0SLina Iyer } 33*e35a6ae0SLina Iyer 3481ef8bf8SLina Iyer #endif 35