summaryrefslogtreecommitdiffstats
path: root/hw/input
diff options
context:
space:
mode:
authorMark Cave-Ayland2022-06-24 15:41:06 +0200
committerMark Cave-Ayland2022-06-26 19:40:12 +0200
commit55870d6f27b2ae181d6f08a8e2c0e718178c72d8 (patch)
tree690372a2758f616975b3eee2941817560d8f3cc3 /hw/input
parentpckbd: add QEMU interface comment for I8042_MMIO device (diff)
downloadqemu-55870d6f27b2ae181d6f08a8e2c0e718178c72d8.tar.gz
qemu-55870d6f27b2ae181d6f08a8e2c0e718178c72d8.tar.xz
qemu-55870d6f27b2ae181d6f08a8e2c0e718178c72d8.zip
pckbd: add i8042_reset() function to I8042 device
This means that it is no longer necessary to call qemu_register_reset() manually within i8042_realizefn(). Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Acked-by: Helge Deller <deller@gmx.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-Id: <20220624134109.881989-52-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/input')
-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 ee306428a3..ff76c0636d 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -808,6 +808,14 @@ static const MemoryRegionOps i8042_cmd_ops = {
.endianness = DEVICE_LITTLE_ENDIAN,
};
+static void i8042_reset(DeviceState *dev)
+{
+ ISAKBDState *s = I8042(dev);
+ KBDState *ks = &s->kbd;
+
+ kbd_reset(ks);
+}
+
static void i8042_initfn(Object *obj)
{
ISAKBDState *isa_s = I8042(obj);
@@ -854,7 +862,6 @@ static void i8042_realizefn(DeviceState *dev, Error **errp)
s->throttle_timer = timer_new_us(QEMU_CLOCK_VIRTUAL,
kbd_throttle_timeout, s);
}
- qemu_register_reset(kbd_reset, s);
}
static void i8042_build_aml(AcpiDevAmlIf *adev, Aml *scope)
@@ -900,6 +907,7 @@ static void i8042_class_initfn(ObjectClass *klass, void *data)
AcpiDevAmlIfClass *adevc = ACPI_DEV_AML_IF_CLASS(klass);
device_class_set_props(dc, i8042_properties);
+ dc->reset = i8042_reset;
dc->realize = i8042_realizefn;
dc->vmsd = &vmstate_kbd_isa;
adevc->build_dev_aml = i8042_build_aml;