summaryrefslogtreecommitdiffstats
path: root/hw/input/lasips2.c
diff options
context:
space:
mode:
authorMark Cave-Ayland2022-06-24 15:40:59 +0200
committerMark Cave-Ayland2022-06-26 19:40:12 +0200
commit42119fdb2e851b2a0a6cc09197c33ad943dcb6e9 (patch)
tree99344540ac76d2fe3c7e9ccbfe26cd5f55d8e232 /hw/input/lasips2.c
parentlasips2: move initialisation of PS2 ports from lasi_initfn() to lasi_init() (diff)
downloadqemu-42119fdb2e851b2a0a6cc09197c33ad943dcb6e9.tar.gz
qemu-42119fdb2e851b2a0a6cc09197c33ad943dcb6e9.tar.xz
qemu-42119fdb2e851b2a0a6cc09197c33ad943dcb6e9.zip
lasips2: add base property
This is in preparation for handling vmstate_register() within the device. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-45-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/input/lasips2.c')
-rw-r--r--hw/input/lasips2.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index bd89c03996..81beb5b614 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -251,6 +251,7 @@ LASIPS2State *lasips2_initfn(hwaddr base, qemu_irq irq)
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);
@@ -282,11 +283,25 @@ static void lasips2_init(Object *obj)
sysbus_init_mmio(SYS_BUS_DEVICE(obj), &s->mouse.reg);
}
+static Property lasips2_properties[] = {
+ DEFINE_PROP_UINT64("base", LASIPS2State, base, UINT64_MAX),
+ DEFINE_PROP_END_OF_LIST(),
+};
+
+static void lasips2_class_init(ObjectClass *klass, void *data)
+{
+ DeviceClass *dc = DEVICE_CLASS(klass);
+
+ device_class_set_props(dc, lasips2_properties);
+ set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
+}
+
static const TypeInfo lasips2_info = {
.name = TYPE_LASIPS2,
.parent = TYPE_SYS_BUS_DEVICE,
.instance_init = lasips2_init,
- .instance_size = sizeof(LASIPS2State)
+ .instance_size = sizeof(LASIPS2State),
+ .class_init = lasips2_class_init,
};
static void lasips2_register_types(void)