int qpnpint_handle_irq(struct spmi_controller *spmi_ctrl, struct qpnp_irq_spec *spec) { struct irq_domain *domain; unsigned long hwirq, busno; int irq; pr_debug("spec slave = %u per = %u irq = %u\n", spec->slave, spec->per, spec->irq); busno = spmi_ctrl->nr; if (!spec || !spmi_ctrl || busno >= QPNPINT_MAX_BUSSES) return -EINVAL; hwirq = qpnpint_encode_hwirq(spec); if (hwirq < 0) { pr_err("invalid irq spec passed\n"); return -EINVAL; } domain = chip_lookup[busno]->domain; irq = irq_radix_revmap_lookup(domain, hwirq); generic_handle_irq(irq); return 0; }
static unsigned int xics_get_irq_lpar(void) { unsigned int xirr = lpar_xirr_info_get(); unsigned int vec = xics_xirr_vector(xirr); unsigned int irq; if (vec == XICS_IRQ_SPURIOUS) return NO_IRQ; irq = irq_radix_revmap_lookup(xics_host, vec); if (likely(irq != NO_IRQ)) return irq; /* We don't have a linux mapping, so have RTAS mask it. */ xics_mask_unknown_vec(vec); /* We might learn about it later, so EOI it */ lpar_xirr_info_set(xirr); return NO_IRQ; }
static unsigned int icp_hv_get_irq(void) { unsigned int xirr = icp_hv_get_xirr(xics_cppr_top()); unsigned int vec = xirr & 0x00ffffff; unsigned int irq; if (vec == XICS_IRQ_SPURIOUS) return NO_IRQ; irq = irq_radix_revmap_lookup(xics_host, vec); if (likely(irq != NO_IRQ)) { xics_push_cppr(vec); return irq; } /* We don't have a linux mapping, so have rtas mask it. */ xics_mask_unknown_vec(vec); /* We might learn about it later, so EOI it */ icp_hv_set_xirr(xirr); return NO_IRQ; }
int qpnpint_handle_irq(struct spmi_controller *spmi_ctrl, struct qpnp_irq_spec *spec) { struct irq_domain *domain; unsigned long hwirq, busno; int irq; #ifndef CONFIG_MACH_MSM8974_VU3_KR if (spec->per == 0x8 || (spec->per == 0x61 && spec->irq == 0x1)) { pr_info("spec slave = %u per = %u irq = %u\n", spec->slave, spec->per, spec->irq); } #else pr_info("spec slave = %u per = %u irq = %u qpnp_irq address is = %x%x10\n", spec->slave, spec->per, spec->irq, spec->slave, spec->per); #endif pr_debug("spec slave = %u per = %u irq = %u\n", spec->slave, spec->per, spec->irq); busno = spmi_ctrl->nr; if (!spec || !spmi_ctrl || busno >= QPNPINT_MAX_BUSSES) return -EINVAL; hwirq = qpnpint_encode_hwirq(spec); if (hwirq < 0) { pr_err("invalid irq spec passed\n"); return -EINVAL; } domain = chip_lookup[busno]->domain; irq = irq_radix_revmap_lookup(domain, hwirq); generic_handle_irq(irq); return 0; }
static int __qpnpint_handle_irq(struct spmi_controller *spmi_ctrl, struct qpnp_irq_spec *spec, bool show) { //yangjq, 20130619, Add log to show MPM irq 62, GIC irq 222 extern int save_irq_wakeup_gpio(int irq, int gpio); struct irq_domain *domain; unsigned long hwirq, busno; int irq; if (!spec || !spmi_ctrl) return -EINVAL; pr_debug("spec slave = %u per = %u irq = %u\n", spec->slave, spec->per, spec->irq); busno = spmi_ctrl->nr; if (busno >= QPNPINT_MAX_BUSSES) return -EINVAL; hwirq = qpnpint_encode_hwirq(spec); if (hwirq < 0) { pr_err("invalid irq spec passed\n"); return -EINVAL; } domain = chip_lookup[busno]->domain; irq = irq_radix_revmap_lookup(domain, hwirq); if (show) { struct irq_desc *desc; const char *name = "null"; desc = irq_to_desc(irq); if (desc == NULL) name = "stray irq"; else if (desc->action && desc->action->name) name = desc->action->name; pr_warn("%d triggered [0x%01x, 0x%02x,0x%01x] %s\n", irq, spec->slave, spec->per, spec->irq, name); } else { //yangjq, 20130617, Add log to show MPM irq 62, GIC irq 222, START #if 0 desc = irq_to_desc(irq); if (desc != NULL) { if (irqd_is_wakeup_set(&desc->irq_data)) { if (save_irq_wakeup(irq)) { #ifdef CONFIG_KALLSYMS printk("%s(), irq=%d, %s, handler=(%pS)\n", __func__, irq, desc->action && desc->action->name ? desc->action->name : "", (void *)desc->action->handler); #else printk("%s(), irq=%d, %s, handler=0x%08x\n", __func__, irq, desc->action && desc->action->name ? desc->action->name : "", (unsigned int)desc->action->handler); #endif } } } #endif //0 //yangjq, 20130619, Add log to show MPM irq 62, GIC irq 222 save_irq_wakeup_gpio(irq, 0); generic_handle_irq(irq); } return 0; }
static int __qpnpint_handle_irq(struct spmi_controller *spmi_ctrl, struct qpnp_irq_spec *spec, bool show) { struct irq_domain *domain; unsigned long hwirq, busno; int irq; if (!spec || !spmi_ctrl) return -EINVAL; pr_debug("spec slave = %u per = %u irq = %u\n", spec->slave, spec->per, spec->irq); busno = spmi_ctrl->nr; if (busno >= QPNPINT_MAX_BUSSES) return -EINVAL; hwirq = qpnpint_encode_hwirq(spec); if (hwirq < 0) { pr_err("invalid irq spec passed\n"); return -EINVAL; } domain = chip_lookup[busno]->domain; irq = irq_radix_revmap_lookup(domain, hwirq); #ifdef CONFIG_SEC_PM_DEBUG if (msm_qpnp_int_debug_mask & MSM_QPNP_INT_DBG_SHOW_IRQ) { struct irq_desc *desc; const char *name = "null"; desc = irq_to_desc(irq); if (desc == NULL) name = "stray irq"; else if (desc->action && desc->action->name) name = desc->action->name; pr_info("%d triggered [0x%01x, 0x%02x,0x%01x] %s\n", irq, spec->slave, spec->per, spec->irq, name); } #endif if (show) { struct irq_desc *desc; const char *name = "null"; desc = irq_to_desc(irq); if (desc == NULL) name = "stray irq"; else if (desc->action && desc->action->name) name = desc->action->name; pr_info("%d triggered [0x%01x, 0x%02x,0x%01x] %s\n", irq, spec->slave, spec->per, spec->irq, name); #ifdef CONFIG_SEC_PM_DEBUG log_wakeup_reason(irq); update_wakeup_reason_stats(irq); #endif } else { generic_handle_irq(irq); } return 0; }