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>
This commit is contained in:
parent
02bb59a0e0
commit
42119fdb2e
@ -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)
|
||||
|
@ -25,6 +25,7 @@ typedef struct LASIPS2Port {
|
||||
struct LASIPS2State {
|
||||
SysBusDevice parent_obj;
|
||||
|
||||
hwaddr base;
|
||||
LASIPS2Port kbd;
|
||||
LASIPS2Port mouse;
|
||||
qemu_irq irq;
|
||||
|
Loading…
Reference in New Issue
Block a user