[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 35/54] pckbd: replace irq_kbd and irq_mouse with qemu_irq arra
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v2 35/54] pckbd: replace irq_kbd and irq_mouse with qemu_irq array in KBDState |
Date: |
Fri, 24 Jun 2022 14:40:50 +0100 |
This allows both IRQs to be declared as a single qdev gpio array.
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>
---
hw/input/pckbd.c | 12 ++++++------
include/hw/input/i8042.h | 6 ++++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/hw/input/pckbd.c b/hw/input/pckbd.c
index 72843f770e..5d7c969fc6 100644
--- a/hw/input/pckbd.c
+++ b/hw/input/pckbd.c
@@ -170,8 +170,8 @@ static void kbd_update_irq_lines(KBDState *s)
}
}
}
- qemu_set_irq(s->irq_kbd, irq_kbd_level);
- qemu_set_irq(s->irq_mouse, irq_mouse_level);
+ qemu_set_irq(s->irqs[I8042_KBD_IRQ], irq_kbd_level);
+ qemu_set_irq(s->irqs[I8042_MOUSE_IRQ], irq_mouse_level);
}
static void kbd_deassert_irq(KBDState *s)
@@ -726,8 +726,8 @@ MMIOKBDState *i8042_mm_init(qemu_irq kbd_irq, qemu_irq
mouse_irq,
sysbus_realize_and_unref(SYS_BUS_DEVICE(dev), &error_fatal);
s = &I8042_MMIO(dev)->kbd;
- s->irq_kbd = kbd_irq;
- s->irq_mouse = mouse_irq;
+ s->irqs[I8042_KBD_IRQ] = kbd_irq;
+ s->irqs[I8042_MOUSE_IRQ] = mouse_irq;
return I8042_MMIO(dev);
}
@@ -813,8 +813,8 @@ static void i8042_realizefn(DeviceState *dev, Error **errp)
return;
}
- s->irq_kbd = isa_get_irq(isadev, isa_s->kbd_irq);
- s->irq_mouse = isa_get_irq(isadev, isa_s->mouse_irq);
+ s->irqs[I8042_KBD_IRQ] = isa_get_irq(isadev, isa_s->kbd_irq);
+ s->irqs[I8042_MOUSE_IRQ] = isa_get_irq(isadev, isa_s->mouse_irq);
isa_register_ioport(isadev, isa_s->io + 0, 0x60);
isa_register_ioport(isadev, isa_s->io + 1, 0x64);
diff --git a/include/hw/input/i8042.h b/include/hw/input/i8042.h
index 9d1f8af964..4ba2664377 100644
--- a/include/hw/input/i8042.h
+++ b/include/hw/input/i8042.h
@@ -12,6 +12,9 @@
#include "hw/sysbus.h"
#include "qom/object.h"
+#define I8042_KBD_IRQ 0
+#define I8042_MOUSE_IRQ 1
+
typedef struct KBDState {
uint8_t write_cmd; /* if non zero, write data to port 60 is expected */
uint8_t status;
@@ -31,8 +34,7 @@ typedef struct KBDState {
void *mouse;
QEMUTimer *throttle_timer;
- qemu_irq irq_kbd;
- qemu_irq irq_mouse;
+ qemu_irq irqs[2];
qemu_irq a20_out;
hwaddr mask;
} KBDState;
--
2.30.2
- Re: [PATCH v2 26/54] pckbd: implement i8042_mmio_init() function, (continued)
- [PATCH v2 27/54] pckbd: alter i8042_mm_init() to return a I8042_MMIO device, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 28/54] pckbd: move mapping of I8042_MMIO registers to MIPS magnum machine, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 29/54] pckbd: more vmstate_register() from i8042_mm_init() to i8042_mmio_realize(), Mark Cave-Ayland, 2022/06/24
- [PATCH v2 30/54] pckbd: move ps2_kbd_init() and ps2_mouse_init() to i8042_mmio_realize(), Mark Cave-Ayland, 2022/06/24
- [PATCH v2 31/54] ps2: make ps2_raise_irq() function static, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 32/54] ps2: use ps2_raise_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 33/54] ps2: introduce ps2_lower_irq() instead of calling update_irq() directly, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 34/54] ps2: add gpio for output IRQ and optionally use it in ps2_raise_irq() and ps2_lower_irq(), Mark Cave-Ayland, 2022/06/24
- [PATCH v2 35/54] pckbd: replace irq_kbd and irq_mouse with qemu_irq array in KBDState,
Mark Cave-Ayland <=
- [PATCH v2 38/54] lasips2: QOMify LASIPS2State, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 37/54] pl050: add QEMU interface comment, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 36/54] pl050: switch over from update_irq() function to PS2 device gpio, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 39/54] lasips2: move lasips2 QOM types from lasips2.c to lasips2.h, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 40/54] lasips2: rename lasips2_init() to lasips2_initfn() and update it to return the LASIPS2 device, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 41/54] lasips2: implement lasips2_init() function, Mark Cave-Ayland, 2022/06/24
- [PATCH v2 43/54] lasips2: move initialisation of PS2 ports from lasi_initfn() to lasi_init(), Mark Cave-Ayland, 2022/06/24
- [PATCH v2 45/54] lasips2: implement lasips2_realize(), Mark Cave-Ayland, 2022/06/24