hw/input/pckbd: Open-code i8042_setup_a20_line() wrapper
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>
Fri, 5 Nov 2021 16:54:18 +0000 (17:54 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 22 Feb 2024 11:47:35 +0000 (12:47 +0100)
Since the named GPIO lines are a "public" interface to the device,
we can directly call qdev_connect_gpio_out_named(), making it
consistent with how the other A20 input source (port92) is wired.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Yanan Wang <wangyanan55@huawei.com>
Message-Id: <20211218130437.1516929-6-f4bug@amsat.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
hw/i386/pc.c
hw/input/pckbd.c
include/hw/input/i8042.h

index 28194014f825f0700c0f35de3e877f11841270b2..9cbc59665fb34a6742d48d90b306b6aecf846426 100644 (file)
@@ -1195,7 +1195,8 @@ static void pc_superio_init(ISABus *isa_bus, bool create_fdctrl,
     port92 = isa_create_simple(isa_bus, TYPE_PORT92);
 
     a20_line = qemu_allocate_irqs(handle_a20_line_change, first_cpu, 2);
-    i8042_setup_a20_line(i8042, a20_line[0]);
+    qdev_connect_gpio_out_named(DEVICE(i8042),
+                                I8042_A20_LINE, 0, a20_line[0]);
     qdev_connect_gpio_out_named(DEVICE(port92),
                                 PORT92_A20_LINE, 0, a20_line[1]);
     g_free(a20_line);
index 90a4d9eb406f7779a59bb8d20bd8c68c196ed82f..74f10b640fd5f4c1dd05b311a51965e03d47a76e 100644 (file)
@@ -777,11 +777,6 @@ void i8042_isa_mouse_fake_event(ISAKBDState *isa)
     ps2_mouse_fake_event(&s->ps2mouse);
 }
 
-void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out)
-{
-    qdev_connect_gpio_out_named(DEVICE(dev), I8042_A20_LINE, 0, a20_out);
-}
-
 static const VMStateDescription vmstate_kbd_isa = {
     .name = "pckbd",
     .version_id = 3,
index 9fb3f8d78754408310c18c446c448d5d3ebea706..e90f008b667deb7fc2ccd8dafafd68c79078ef14 100644 (file)
@@ -89,7 +89,6 @@ struct MMIOKBDState {
 
 
 void i8042_isa_mouse_fake_event(ISAKBDState *isa);
-void i8042_setup_a20_line(ISADevice *dev, qemu_irq a20_out);
 
 static inline bool i8042_present(void)
 {