aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-24 14:40:37 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-06-26 18:40:11 +0100
commit57f6c3aac08d16eb7fe4a447dbbbfeb314d39234 (patch)
tree75c43d80249690d41b8aa93a0f7e999ac6d23d64 /hw
parent150ee013ed3f2af7eec493cd68ae774a85d40a2b (diff)
downloadqemu-57f6c3aac08d16eb7fe4a447dbbbfeb314d39234.zip
qemu-57f6c3aac08d16eb7fe4a447dbbbfeb314d39234.tar.gz
qemu-57f6c3aac08d16eb7fe4a447dbbbfeb314d39234.tar.bz2
pckbd: implement i8042_mmio_reset() for I8042_MMIO device
This allows the I8042_MMIO reset function to be registered directly within the DeviceClass rather than using qemu_register_reset() directly. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220624134109.881989-23-mark.cave-ayland@ilande.co.uk> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw')
-rw-r--r--hw/input/pckbd.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 89a41ed..7b520d0 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -665,10 +665,19 @@ static const MemoryRegionOps i8042_mmio_ops = {
.endianness = DEVICE_NATIVE_ENDIAN,
};
+static void i8042_mmio_reset(DeviceState *dev)
+{
+ MMIOKBDState *s = I8042_MMIO(dev);
+ KBDState *ks = &s->kbd;
+
+ kbd_reset(ks);
+}
+
static void i8042_mmio_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
+ dc->reset = i8042_mmio_reset;
set_bit(DEVICE_CATEGORY_INPUT, dc->categories);
}
@@ -695,7 +704,6 @@ void i8042_mm_init(qemu_irq kbd_irq, qemu_irq mouse_irq,
s->kbd = ps2_kbd_init(kbd_update_kbd_irq, s);
s->mouse = ps2_mouse_init(kbd_update_aux_irq, s);
- qemu_register_reset(kbd_reset, s);
}
static const TypeInfo i8042_mmio_info = {