devicetree: add DT_INST_NUM_IRQS()

Add `DT_INST_NUM_IRQS()` to get the number of interrupt lines
of the current `DT_DRV_COMPAT`

Signed-off-by: Yong Cong Sin <ycsin@meta.com>
Signed-off-by: Yong Cong Sin <yongcong.sin@gmail.com>
This commit is contained in:
Yong Cong Sin 2024-08-29 22:36:45 +08:00 committed by Alberto Escolar
commit ee08ebd9ca
2 changed files with 11 additions and 0 deletions

View file

@ -751,6 +751,9 @@ ZTEST(devicetree_api, test_irq)
/* DT_INST */
zassert_equal(DT_NUM_INST_STATUS_OKAY(DT_DRV_COMPAT), 1, "");
/* DT_INST_NUM_IRQS */
zassert_equal(DT_INST_NUM_IRQS(0), 3);
/* DT_INST_IRQ_HAS_IDX */
zassert_equal(DT_INST_IRQ_HAS_IDX(0, 0), 1, "");
zassert_equal(DT_INST_IRQ_HAS_IDX(0, 1), 1, "");