diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-06-24 14:40:59 +0100 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-06-26 18:40:12 +0100 |
commit | 42119fdb2e851b2a0a6cc09197c33ad943dcb6e9 (patch) | |
tree | 99344540ac76d2fe3c7e9ccbfe26cd5f55d8e232 /hw/input | |
parent | 02bb59a0e082a4eb88b797c715ab722bebb95ad4 (diff) | |
download | qemu-42119fdb2e851b2a0a6cc09197c33ad943dcb6e9.zip qemu-42119fdb2e851b2a0a6cc09197c33ad943dcb6e9.tar.gz qemu-42119fdb2e851b2a0a6cc09197c33ad943dcb6e9.tar.bz2 |
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')
-rw-r--r-- | hw/input/lasips2.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index bd89c03..81beb5b 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) |