From 8db817be78902d1a1c9f0c389d95e61a474dbe79 Mon Sep 17 00:00:00 2001 From: Mark Cave-Ayland Date: Tue, 12 Jul 2022 22:52:35 +0100 Subject: lasips2: introduce port IRQ and new lasips2_port_init() function MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Introduce a new lasips2_port_init() QOM init function for the LASIPS2_PORT type and use it to initialise a new gpio for use as a port IRQ. Add a new qemu_irq representing the gpio as a new irq field within LASIPS2Port. Signed-off-by: Mark Cave-Ayland Tested-by: Helge Deller Acked-by: Helge Deller Reviewed-by: Peter Maydell Message-Id: <20220712215251.7944-25-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé --- hw/input/lasips2.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'hw') diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index 49e5c90..6b53153 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -322,9 +322,17 @@ static const TypeInfo lasips2_info = { .class_init = lasips2_class_init, }; +static void lasips2_port_init(Object *obj) +{ + LASIPS2Port *s = LASIPS2_PORT(obj); + + qdev_init_gpio_out(DEVICE(obj), &s->irq, 1); +} + static const TypeInfo lasips2_port_info = { .name = TYPE_LASIPS2_PORT, .parent = TYPE_DEVICE, + .instance_init = lasips2_port_init, .instance_size = sizeof(LASIPS2Port), .abstract = true, }; -- cgit v1.1