aboutsummaryrefslogtreecommitdiff
path: root/hw/input
diff options
context:
space:
mode:
authorMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-07-12 22:52:38 +0100
committerMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>2022-07-18 19:28:46 +0100
commitca735a81b27c7b54b26202be479075acbc1657c5 (patch)
tree2d46d1a6b3f054bfcb51023190a8967119414ac1 /hw/input
parentd0af5d6a400974ee508e9ca3da6b1784bea5322a (diff)
lasips2: add named input gpio to handle incoming port IRQs
The LASIPS2 device named input gpio is soon to be connected to the port output IRQs. Add a new int_status field to LASIPS2State which is a bitmap representing the port input IRQ status which will be enabled in the next patch. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Helge Deller <deller@gmx.de> Acked-by: Helge Deller <deller@gmx.de> Message-Id: <20220712215251.7944-28-mark.cave-ayland@ilande.co.uk> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Diffstat (limited to 'hw/input')
-rw-r--r--hw/input/lasips2.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index ec1661a8f1..013d891af6 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -125,6 +125,19 @@ static void lasips2_update_irq(LASIPS2State *s)
s->mouse_port.parent_obj.birq);
}
+static void lasips2_set_irq(void *opaque, int n, int level)
+{
+ LASIPS2State *s = LASIPS2(opaque);
+
+ if (level) {
+ s->int_status |= BIT(n);
+ } else {
+ s->int_status &= ~BIT(n);
+ }
+
+ lasips2_update_irq(s);
+}
+
static void lasips2_reg_write(void *opaque, hwaddr addr, uint64_t val,
unsigned size)
{
@@ -303,6 +316,8 @@ static void lasips2_init(Object *obj)
"ps2-kbd-input-irq", 1);
qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_mouse_irq,
"ps2-mouse-input-irq", 1);
+ qdev_init_gpio_in_named(DEVICE(obj), lasips2_set_irq,
+ "lasips2-port-input-irq", 2);
}
static void lasips2_class_init(ObjectClass *klass, void *data)