/* * When GPIO_INT0~7 set to edge trigger, doesn't work properly. * WORKAROUND: change it to level trigger, and toggle the polarity * at ACK/Handler to make the HW work.
*/ #define GPIO_INT0_HWIRQ 120 #define GPIO_INT7_HWIRQ 127 #define IS_GPIO_INT(irq) \
({ \
u32 i = irq; \
(i >= GPIO_INT0_HWIRQ) && (i <= GPIO_INT7_HWIRQ); \
})
/* index of states */ enum {
_IS_EDGE = 0,
_IS_LOW,
_IS_ACTIVE
};
staticint __init sp_intc_init_dt(struct device_node *node, struct device_node *parent)
{ int i, ret;
sp_intc.g0 = of_iomap(node, 0); if (!sp_intc.g0) return -ENXIO;
sp_intc.g1 = of_iomap(node, 1); if (!sp_intc.g1) {
ret = -ENXIO; goto out_unmap0;
}
ret = sp_intc_irq_map(node, 0); // EXT_INT0 if (ret) goto out_unmap1;
ret = sp_intc_irq_map(node, 1); // EXT_INT1 if (ret) goto out_unmap1;
/* initial regs */ for (i = 0; i < SP_INTC_NR_GROUPS; i++) { /* all mask */
writel_relaxed(0, REG_INTR_MASK + i * 4); /* all edge */
writel_relaxed(~0, REG_INTR_TYPE + i * 4); /* all high-active */
writel_relaxed(0, REG_INTR_POLARITY + i * 4); /* all EXT_INT0 */
writel_relaxed(~0, REG_INTR_PRIORITY + i * 4); /* all clear */
writel_relaxed(~0, REG_INTR_CLEAR + i * 4);
}
sp_intc.domain = irq_domain_create_linear(of_fwnode_handle(node), SP_INTC_NR_IRQS,
&sp_intc_dm_ops, &sp_intc); if (!sp_intc.domain) {
ret = -ENOMEM; goto out_unmap1;
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.10Bemerkung:
(vorverarbeitet am 2026-06-07)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.