Currently, the QTest API does not provide a function to capture when an
IRQ line is raised or lowered, although the QTest Protocol already
reports such IRQ transitions. As a consequence, it is also not possible
to capture when an IRQ line is toggled. Functions like qtest_get_irq()
only read the current state of the intercepted IRQ lines, which is
already high (or low) when the function is called if the IRQ line is
toggled. Therefore, these functions miss the IRQ line state transitions.
This commit introduces two new API functions:
qtest_get_irq_raised_counter() and qtest_get_irq_lowered_counter().
These functions allow capturing the number of times an observed IRQ line
transitioned from low to high state or from high to low state,
respectively.
When used together, these new API functions then allow checking if one
or more pulses were generated (indicating if the IRQ line was toggled).
Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
---
tests/qtest/libqtest.c | 24 ++++++++++++++++++++++++
tests/qtest/libqtest.h | 28 ++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)