[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 45/50] lasips2: use qdev gpio for output IRQ
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 45/50] lasips2: use qdev gpio for output IRQ |
Date: |
Sun, 22 May 2022 19:18:31 +0100 |
This enables the IRQ to be wired up using qdev_connect_gpio_out() in
lasips2_initfn().
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/input/lasips2.c | 8 ++++----
include/hw/input/lasips2.h | 2 ++
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index 6849b71e5c..644cf70955 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -247,16 +247,14 @@ static void lasips2_port_set_irq(void *opaque, int level)
LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq)
{
- LASIPS2State *s;
DeviceState *dev;
dev = qdev_new(TYPE_LASIPS2);
qdev_prop_set_uint64(dev, "base", base);
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
- s = LASIPS2(dev);
+ qdev_connect_gpio_out(dev, LASIPS2_IRQ, irq);
- s->irq = irq;
- return s;
+ return LASIPS2(dev);
}
static void lasips2_realize(DeviceState *dev, Error **errp)
@@ -285,6 +283,8 @@ static void lasips2_init(Object *obj)
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->kbd.reg);
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mouse.reg);
+
+ qdev_init_gpio_out(DEVICE(obj), &s->irq, 1);
}
static Property lasips2_properties[] = {
diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h
index 7e4437b925..d3e9719d65 100644
--- a/include/hw/input/lasips2.h
+++ b/include/hw/input/lasips2.h
@@ -22,6 +22,8 @@ typedef struct LASIPS2Port {
bool irq;
} LASIPS2Port;
+#define LASIPS2_IRQ 0
+
struct LASIPS2State {
SysBusDevice parent_obj;
--
2.20.1
- [PATCH 33/50] ps2: introduce ps2_lower_irq() instead of calling update_irq() directly, (continued)
- [PATCH 33/50] ps2: introduce ps2_lower_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/05/22
- [PATCH 37/50] lasips2: QOMify LASIPS2State, Mark Cave-Ayland, 2022/05/22
- [PATCH 32/50] ps2: use ps2_raise_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/05/22
- [PATCH 38/50] lasips2: move lasips2 QOM types from lasips2.c to lasips2.h, Mark Cave-Ayland, 2022/05/22
- [PATCH 41/50] lasips2: move mapping of LASIPS2 registers to HPPA machine, Mark Cave-Ayland, 2022/05/22
- [PATCH 40/50] lasips2: implement lasips2_init() function, Mark Cave-Ayland, 2022/05/22
- [PATCH 42/50] lasips2: move initialisation of PS2 ports from lasi_initfn() to lasi_init(), Mark Cave-Ayland, 2022/05/22
- [PATCH 43/50] lasips2: add base property, Mark Cave-Ayland, 2022/05/22
- [PATCH 48/50] pckbd: add i8042_reset() function to I8042 device, Mark Cave-Ayland, 2022/05/22
- [PATCH 44/50] lasips2: implement lasips2_realize(), Mark Cave-Ayland, 2022/05/22
- [PATCH 45/50] lasips2: use qdev gpio for output IRQ,
Mark Cave-Ayland <=
- [PATCH 49/50] pckbd: switch I8042 device from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 47/50] pckbd: switch I8042_MMIO device from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 46/50] lasips2: switch over from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/05/22
- [PATCH 50/50] ps2: remove update_irq() function and update_arg parameter, Mark Cave-Ayland, 2022/05/22
- Re: [PATCH 00/50] PS2 device QOMification - part 1, Philippe Mathieu-Daudé, 2022/05/22
- Re: [PATCH 00/50] PS2 device QOMification - part 1, Helge Deller, 2022/05/24