From 6beb79e11a48b7876dfd63fcfb51d1a603936928 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Fri, 24 Jun 2022 14:40:49 +0100 Subject: ps2: add gpio for output IRQ and optionally use it in ps2_raise_irq() and ps2_lower_irq() Define the gpio for the PS2 output IRQ in ps2_init() and add logic to optionally use it in ps2_raise_irq() and ps2_lower_irq() if the gpio is connected. If the gpio is not connected then call the legacy update_irq() function as before. This allows the incremental conversion of devices from the legacy update_irq() function to use gpios instead. Signed-off-by: Mark Cave-Ayland Acked-by: Helge Deller Reviewed-by: Peter Maydell Message-Id: <20220624134109.881989-35-mark.cave-ayland@ilande.co.uk> --- include/hw/input/ps2.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/hw/input/ps2.h b/include/hw/input/ps2.h index 410ec66baf..5422aee9aa 100644 --- a/include/hw/input/ps2.h +++ b/include/hw/input/ps2.h @@ -50,11 +50,15 @@ typedef struct { int rptr, wptr, cwptr, count; } PS2Queue; +/* Output IRQ */ +#define PS2_DEVICE_IRQ 0 + struct PS2State { SysBusDevice parent_obj; PS2Queue queue; int32_t write_cmd; + qemu_irq irq; void (*update_irq)(void *, int); void *update_arg; }; -- cgit v1.2.3