[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 22/55] pckbd: implement i8042_mmio_reset() for I8042_MMIO device
From: |
Mark Cave-Ayland |
Subject: |
[PULL 22/55] pckbd: implement i8042_mmio_reset() for I8042_MMIO device |
Date: |
Sun, 26 Jun 2022 18:44:58 +0100 |
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>
---
hw/input/pckbd.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 89a41ed566..7b520d0eb4 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 = {
--
2.30.2
- [PULL 17/55] lasips2: rename ps2dev_update_irq() to lasips2_port_set_irq(), (continued)
- [PULL 17/55] lasips2: rename ps2dev_update_irq() to lasips2_port_set_irq(), Mark Cave-Ayland, 2022/06/26
- [PULL 16/55] lasips2: spacing fixes, Mark Cave-Ayland, 2022/06/26
- [PULL 20/55] pckbd: move ISAKBDState from pckbd.c to i8042.h, Mark Cave-Ayland, 2022/06/26
- [PULL 19/55] pckbd: move KBDState from pckbd.c to i8042.h, Mark Cave-Ayland, 2022/06/26
- [PULL 18/55] pckbd: checkpatch fixes, Mark Cave-Ayland, 2022/06/26
- [PULL 21/55] pckbd: introduce new I8042_MMIO QOM type, Mark Cave-Ayland, 2022/06/26
- [PULL 24/55] pckbd: add size qdev property to I8042_MMIO device, Mark Cave-Ayland, 2022/06/26
- [PULL 25/55] pckbd: implement i8042_mmio_realize() function, Mark Cave-Ayland, 2022/06/26
- [PULL 27/55] pckbd: alter i8042_mm_init() to return a I8042_MMIO device, Mark Cave-Ayland, 2022/06/26
- [PULL 23/55] pckbd: add mask qdev property to I8042_MMIO device, Mark Cave-Ayland, 2022/06/26
- [PULL 22/55] pckbd: implement i8042_mmio_reset() for I8042_MMIO device,
Mark Cave-Ayland <=
- [PULL 29/55] pckbd: more vmstate_register() from i8042_mm_init() to i8042_mmio_realize(), Mark Cave-Ayland, 2022/06/26
- [PULL 28/55] pckbd: move mapping of I8042_MMIO registers to MIPS magnum machine, Mark Cave-Ayland, 2022/06/26
- [PULL 26/55] pckbd: implement i8042_mmio_init() function, Mark Cave-Ayland, 2022/06/26
- [PULL 30/55] pckbd: move ps2_kbd_init() and ps2_mouse_init() to i8042_mmio_realize(), Mark Cave-Ayland, 2022/06/26
- [PULL 32/55] ps2: use ps2_raise_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/06/26
- [PULL 31/55] ps2: make ps2_raise_irq() function static, Mark Cave-Ayland, 2022/06/26
- [PULL 33/55] ps2: introduce ps2_lower_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/06/26
- [PULL 34/55] ps2: add gpio for output IRQ and optionally use it in ps2_raise_irq() and ps2_lower_irq(), Mark Cave-Ayland, 2022/06/26
- [PULL 37/55] pl050: add QEMU interface comment, Mark Cave-Ayland, 2022/06/26
- [PULL 35/55] pckbd: replace irq_kbd and irq_mouse with qemu_irq array in KBDState, Mark Cave-Ayland, 2022/06/26