[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 27/40] lasips2: add named input gpio to handle incoming port I
From: |
Mark Cave-Ayland |
Subject: |
[PATCH v2 27/40] lasips2: add named input gpio to handle incoming port IRQs |
Date: |
Tue, 12 Jul 2022 22:52:38 +0100 |
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>
---
hw/input/lasips2.c | 15 +++++++++++++++
include/hw/input/lasips2.h | 1 +
2 files changed, 16 insertions(+)
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)
diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h
index 35e0aa26eb..b79febf64b 100644
--- a/include/hw/input/lasips2.h
+++ b/include/hw/input/lasips2.h
@@ -69,6 +69,7 @@ struct LASIPS2State {
LASIPS2KbdPort kbd_port;
LASIPS2MousePort mouse_port;
+ uint8_t int_status;
qemu_irq irq;
};
--
2.30.2
- [PATCH v2 17/40] lasips2: introduce new LASIPS2_KBD_PORT QOM type, (continued)
- [PATCH v2 17/40] lasips2: introduce new LASIPS2_KBD_PORT QOM type, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 18/40] lasips2: introduce new LASIPS2_MOUSE_PORT QOM type, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 20/40] lasips2: move mouse port initialisation to new lasips2_mouse_port_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 19/40] lasips2: move keyboard port initialisation to new lasips2_kbd_port_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 21/40] lasips2: introduce lasips2_kbd_port_class_init() and lasips2_kbd_port_realize(), Mark Cave-Ayland, 2022/07/12
- [PATCH v2 22/40] lasips2: introduce lasips2_mouse_port_class_init() and lasips2_mouse_port_realize(), Mark Cave-Ayland, 2022/07/12
- [PATCH v2 23/40] lasips2: rename LASIPS2Port irq field to birq, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 25/40] lasips2: introduce LASIPS2PortDeviceClass for the LASIPS2_PORT device, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 26/40] lasips2: add named input gpio to port for downstream PS2 device IRQ, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 27/40] lasips2: add named input gpio to handle incoming port IRQs,
Mark Cave-Ayland <=
- [PATCH v2 28/40] lasips2: switch to using port-based IRQs, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 29/40] lasips2: rename LASIPS2Port parent pointer to lasips2, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 30/40] lasips2: standardise on lp name for LASIPS2Port variables, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 32/40] lasips2: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 31/40] lasips2: switch register memory region to DEVICE_BIG_ENDIAN, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 33/40] lasips2: don't use legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 34/40] lasips2: update VMStateDescription for LASIPS2 device, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 35/40] pckbd: introduce new vmstate_kbd_mmio VMStateDescription for the I8042_MMIO device, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 36/40] pckbd: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/07/12
- [PATCH v2 39/40] ps2: remove unused legacy ps2_mouse_init() function, Mark Cave-Ayland, 2022/07/12