static int qpnpint_irq_domain_dt_translate(struct irq_domain *d, struct device_node *controller, const u32 *intspec, unsigned int intsize, unsigned long *out_hwirq, unsigned int *out_type) { struct qpnp_irq_spec addr; int ret; pr_debug("intspec[0] 0x%x intspec[1] 0x%x intspec[2] 0x%x\n", intspec[0], intspec[1], intspec[2]); if (d->of_node != controller) return -EINVAL; if (intsize != 3) return -EINVAL; addr.irq = intspec[2] & 0x7; addr.per = intspec[1] & 0xFF; addr.slave = intspec[0] & 0xF; ret = qpnpint_encode_hwirq(&addr); if (ret < 0) { pr_err("invalid intspec\n"); return ret; } *out_hwirq = ret; *out_type = IRQ_TYPE_NONE; pr_debug("out_hwirq = %lu\n", *out_hwirq); return 0; }
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 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_find_mapping(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); #ifdef VENDOR_EDIT /* [email protected],add 2015/1/7 Add for wakeup analysis */ if(!wakeup_reason[0]) strncpy(wakeup_reason,name,sizeof(wakeup_reason) -1); #endif /* VENDOR_EDIT */ } else { 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_find_mapping(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 { generic_handle_irq(irq); } return 0; }
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; }