diff options
author | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-06-24 14:41:09 +0100 |
---|---|---|
committer | Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> | 2022-06-26 18:40:12 +0100 |
commit | 7227de94adce761d9add78ad087a98697b2d82e9 (patch) | |
tree | 9bd50c8e8c1d72db04197aae9feb0f6a7e2e5cbd /hw/input | |
parent | 38f426b8af844c8243b1cd5e6d883c176c527c3b (diff) |
ps2: remove update_irq() function and update_arg parameter
Now that all the PS2 devices have been converted to use GPIOs the update_irq()
callback function and the update_arg parameter can be removed.
This allows these arguments to be completely removed from ps2_kbd_init() and
ps2_mouse_init(), along with the transitional logic that was added to
ps2_raise_irq() and ps2_lower_irq().
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-55-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'hw/input')
-rw-r--r-- | hw/input/lasips2.c | 4 | ||||
-rw-r--r-- | hw/input/pckbd.c | 8 | ||||
-rw-r--r-- | hw/input/pl050.c | 4 | ||||
-rw-r--r-- | hw/input/ps2.c | 25 |
4 files changed, 12 insertions, 29 deletions
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c index a6e14e0e6b..9223cb0af4 100644 --- a/hw/input/lasips2.c +++ b/hw/input/lasips2.c @@ -274,11 +274,11 @@ static void lasips2_realize(DeviceState *dev, Error **errp) vmstate_register(NULL, s->base, &vmstate_lasips2, s); - s->kbd.dev = ps2_kbd_init(NULL, NULL); + s->kbd.dev = ps2_kbd_init(); qdev_connect_gpio_out(DEVICE(s->kbd.dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); - s->mouse.dev = ps2_mouse_init(NULL, NULL); + s->mouse.dev = ps2_mouse_init(); qdev_connect_gpio_out(DEVICE(s->mouse.dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq", 0)); diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c index 18f27abc58..9184411c3e 100644 --- a/hw/input/pckbd.c +++ b/hw/input/pckbd.c @@ -702,11 +702,11 @@ static void i8042_mmio_realize(DeviceState *dev, Error **errp) /* Note we can't use dc->vmsd without breaking migration compatibility */ vmstate_register(NULL, 0, &vmstate_kbd, ks); - ks->kbd = ps2_kbd_init(NULL, NULL); + ks->kbd = ps2_kbd_init(); qdev_connect_gpio_out(DEVICE(ks->kbd), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); - ks->mouse = ps2_mouse_init(NULL, NULL); + ks->mouse = ps2_mouse_init(); qdev_connect_gpio_out(DEVICE(ks->mouse), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq", 0)); @@ -876,11 +876,11 @@ static void i8042_realizefn(DeviceState *dev, Error **errp) isa_register_ioport(isadev, isa_s->io + 0, 0x60); isa_register_ioport(isadev, isa_s->io + 1, 0x64); - s->kbd = ps2_kbd_init(NULL, NULL); + s->kbd = ps2_kbd_init(); qdev_connect_gpio_out(DEVICE(s->kbd), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-kbd-input-irq", 0)); - s->mouse = ps2_mouse_init(NULL, NULL); + s->mouse = ps2_mouse_init(); qdev_connect_gpio_out(DEVICE(s->mouse), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-mouse-input-irq", 0)); diff --git a/hw/input/pl050.c b/hw/input/pl050.c index ffaa72dea4..209cc001cf 100644 --- a/hw/input/pl050.c +++ b/hw/input/pl050.c @@ -172,9 +172,9 @@ static void pl050_realize(DeviceState *dev, Error **errp) sysbus_init_mmio(sbd, &s->iomem); sysbus_init_irq(sbd, &s->irq); if (s->is_mouse) { - s->dev = ps2_mouse_init(NULL, NULL); + s->dev = ps2_mouse_init(); } else { - s->dev = ps2_kbd_init(NULL, NULL); + s->dev = ps2_kbd_init(); } qdev_connect_gpio_out(DEVICE(s->dev), PS2_DEVICE_IRQ, qdev_get_gpio_in_named(dev, "ps2-input-irq", 0)); diff --git a/hw/input/ps2.c b/hw/input/ps2.c index 98c6206fb8..59bac28ac8 100644 --- a/hw/input/ps2.c +++ b/hw/input/ps2.c @@ -175,20 +175,12 @@ void ps2_queue_noirq(PS2State *s, int b) static void ps2_raise_irq(PS2State *s) { - if (qemu_irq_is_connected(s->irq)) { - qemu_set_irq(s->irq, 1); - } else { - s->update_irq(s->update_arg, 1); - } + qemu_set_irq(s->irq, 1); } static void ps2_lower_irq(PS2State *s) { - if (qemu_irq_is_connected(s->irq)) { - qemu_set_irq(s->irq, 0); - } else { - s->update_irq(s->update_arg, 0); - } + qemu_set_irq(s->irq, 0); } void ps2_queue(PS2State *s, int b) @@ -1232,21 +1224,16 @@ static void ps2_kbd_realize(DeviceState *dev, Error **errp) qemu_input_handler_register(dev, &ps2_keyboard_handler); } -void *ps2_kbd_init(void (*update_irq)(void *, int), void *update_arg) +void *ps2_kbd_init(void) { DeviceState *dev; PS2KbdState *s; - PS2State *ps2; dev = qdev_new(TYPE_PS2_KBD_DEVICE); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); s = PS2_KBD_DEVICE(dev); - ps2 = PS2_DEVICE(s); trace_ps2_kbd_init(s); - ps2->update_irq = update_irq; - ps2->update_arg = update_arg; - return s; } @@ -1262,20 +1249,16 @@ static void ps2_mouse_realize(DeviceState *dev, Error **errp) qemu_input_handler_register(dev, &ps2_mouse_handler); } -void *ps2_mouse_init(void (*update_irq)(void *, int), void *update_arg) +void *ps2_mouse_init(void) { DeviceState *dev; PS2MouseState *s; - PS2State *ps2; dev = qdev_new(TYPE_PS2_MOUSE_DEVICE); sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal); s = PS2_MOUSE_DEVICE(dev); - ps2 = PS2_DEVICE(s); trace_ps2_mouse_init(s); - ps2->update_irq = update_irq; - ps2->update_arg = update_arg; return s; } |