The reset handler clears the pressed state but does not deassert
the IRQ outputs. If a button was pressed before reset, its IRQ
line remains high even though the internal state shows it as
released.
Deassert all IRQ lines during reset to keep GPIO state consistent
with the pressed array.
Fixes: a75f336b97a6 ("hw/input/stellaris_input: Convert to qdev")
Signed-off-by: Marc-André Lureau <[email protected]>
---
hw/input/stellaris_gamepad.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/hw/input/stellaris_gamepad.c b/hw/input/stellaris_gamepad.c
index 376d91abad70..90780613069e 100644
--- a/hw/input/stellaris_gamepad.c
+++ b/hw/input/stellaris_gamepad.c
@@ -76,6 +76,9 @@ static void stellaris_gamepad_reset_enter(Object *obj,
ResetType type)
StellarisGamepad *s = STELLARIS_GAMEPAD(obj);
memset(s->pressed, 0, s->num_buttons * sizeof(uint8_t));
+ for (uint32_t i = 0; i < s->num_buttons; i++) {
+ qemu_set_irq(s->irqs[i], 0);
+ }
}
static const Property stellaris_gamepad_properties[] = {
--
2.56.0.rc0.29.g47ce80527c56