]> Git Repo - qemu.git/commitdiff
pckbd: add i8042_reset() function to I8042 device
authorMark Cave-Ayland <[email protected]>
Fri, 24 Jun 2022 13:41:06 +0000 (14:41 +0100)
committerMark Cave-Ayland <[email protected]>
Sun, 26 Jun 2022 17:40:12 +0000 (18:40 +0100)
This means that it is no longer necessary to call qemu_register_reset() manually
within i8042_realizefn().

Signed-off-by: Mark Cave-Ayland <[email protected]>
Acked-by: Helge Deller <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Message-Id: <20220624134109[email protected]>

hw/input/pckbd.c

index ee306428a3dc29cfe1104a8bf1adefc313930db6..ff76c0636d34d79253161794f845071d28c55dbb 100644 (file)
@@ -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;
This page took 0.023053 seconds and 4 git commands to generate.