mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-14 21:52:18 -06:00
lasips2: introduce port IRQ and new lasips2_port_init() function
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 <mark.cave-ayland@ilande.co.uk> Tested-by: Helge Deller <deller@gmx.de> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220712215251.7944-25-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
This commit is contained in:
parent
c553d6c054
commit
8db817be78
2 changed files with 9 additions and 0 deletions
|
@ -322,9 +322,17 @@ static const TypeInfo lasips2_info = {
|
||||||
.class_init = lasips2_class_init,
|
.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 = {
|
static const TypeInfo lasips2_port_info = {
|
||||||
.name = TYPE_LASIPS2_PORT,
|
.name = TYPE_LASIPS2_PORT,
|
||||||
.parent = TYPE_DEVICE,
|
.parent = TYPE_DEVICE,
|
||||||
|
.instance_init = lasips2_port_init,
|
||||||
.instance_size = sizeof(LASIPS2Port),
|
.instance_size = sizeof(LASIPS2Port),
|
||||||
.abstract = true,
|
.abstract = true,
|
||||||
};
|
};
|
||||||
|
|
|
@ -41,6 +41,7 @@ struct LASIPS2Port {
|
||||||
uint8_t buf;
|
uint8_t buf;
|
||||||
bool loopback_rbne;
|
bool loopback_rbne;
|
||||||
bool birq;
|
bool birq;
|
||||||
|
qemu_irq irq;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port"
|
#define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue