[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 16/40] lasips2: QOMify LASIPS2Port
From: |
Mark Cave-Ayland |
Subject: |
[PATCH 16/40] lasips2: QOMify LASIPS2Port |
Date: |
Wed, 29 Jun 2022 13:40:02 +0100 |
This becomes an abstract QOM type which will be a parent type for separate
keyboard and mouse port types.
Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
---
hw/input/lasips2.c | 8 ++++++++
include/hw/input/lasips2.h | 14 ++++++++++----
2 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/hw/input/lasips2.c b/hw/input/lasips2.c
index b539c4de7a..56bfd759af 100644
--- a/hw/input/lasips2.c
+++ b/hw/input/lasips2.c
@@ -311,9 +311,17 @@ static const TypeInfo lasips2_info = {
.class_init = lasips2_class_init,
};
+static const TypeInfo lasips2_port_info = {
+ .name = TYPE_LASIPS2_PORT,
+ .parent = TYPE_DEVICE,
+ .instance_size = sizeof(LASIPS2Port),
+ .abstract = true,
+};
+
static void lasips2_register_types(void)
{
type_register_static(&lasips2_info);
+ type_register_static(&lasips2_port_info);
}
type_init(lasips2_register_types)
diff --git a/include/hw/input/lasips2.h b/include/hw/input/lasips2.h
index 9746b7a132..f4514081fe 100644
--- a/include/hw/input/lasips2.h
+++ b/include/hw/input/lasips2.h
@@ -25,9 +25,15 @@
#include "hw/sysbus.h"
#include "hw/input/ps2.h"
-struct LASIPS2State;
-typedef struct LASIPS2Port {
- struct LASIPS2State *parent;
+#define TYPE_LASIPS2_PORT "lasips2-port"
+OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2Port, LASIPS2_PORT)
+
+typedef struct LASIPS2State LASIPS2State;
+
+struct LASIPS2Port {
+ DeviceState parent_obj;
+
+ LASIPS2State *parent;
MemoryRegion reg;
PS2State *ps2dev;
uint8_t id;
@@ -35,7 +41,7 @@ typedef struct LASIPS2Port {
uint8_t buf;
bool loopback_rbne;
bool irq;
-} LASIPS2Port;
+};
struct LASIPS2State {
SysBusDevice parent_obj;
--
2.30.2
- [PATCH 03/40] pl050: change PL050State dev pointer from void to PS2State, (continued)
- [PATCH 03/40] pl050: change PL050State dev pointer from void to PS2State, Mark Cave-Ayland, 2022/06/29
- [PATCH 04/40] pl050: introduce new PL050_KBD_DEVICE QOM type, Mark Cave-Ayland, 2022/06/29
- [PATCH 07/40] pl050: introduce PL050DeviceClass for the PL050 device, Mark Cave-Ayland, 2022/06/29
- [PATCH 02/40] pl050: rename pl050_keyboard_init() to pl050_kbd_init(), Mark Cave-Ayland, 2022/06/29
- [PATCH 09/40] pl050: introduce pl050_mouse_class_init() and pl050_mouse_realize(), Mark Cave-Ayland, 2022/06/29
- [PATCH 12/40] lasips2: don't use vmstate_register() in lasips2_realize(), Mark Cave-Ayland, 2022/06/29
- [PATCH 13/40] lasips2: remove the qdev base property and the lasips2_properties array, Mark Cave-Ayland, 2022/06/29
- [PATCH 14/40] lasips2: remove legacy lasips2_initfn() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 15/40] lasips2: change LASIPS2State dev pointer from void to PS2State, Mark Cave-Ayland, 2022/06/29
- [PATCH 10/40] pl050: don't use legacy ps2_kbd_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 16/40] lasips2: QOMify LASIPS2Port,
Mark Cave-Ayland <=
- [PATCH 17/40] lasips2: introduce new LASIPS2_KBD_PORT QOM type, Mark Cave-Ayland, 2022/06/29
- [PATCH 19/40] lasips2: move keyboard port initialisation to new lasips2_kbd_port_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 18/40] lasips2: introduce new LASIPS2_MOUSE_PORT QOM type, Mark Cave-Ayland, 2022/06/29
- [PATCH 20/40] lasips2: move mouse port initialisation to new lasips2_mouse_port_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 21/40] lasips2: introduce lasips2_kbd_port_class_init() and lasips2_kbd_port_realize(), Mark Cave-Ayland, 2022/06/29
- [PATCH 23/40] lasips2: rename LASIPS2Port irq field to birq, Mark Cave-Ayland, 2022/06/29
- [PATCH 22/40] lasips2: introduce lasips2_mouse_port_class_init() and lasips2_mouse_port_realize(), Mark Cave-Ayland, 2022/06/29
- [PATCH 25/40] lasips2: introduce LASIPS2PortDeviceClass for the LASIPS2_PORT device, Mark Cave-Ayland, 2022/06/29
- [PATCH 24/40] lasips2: introduce port IRQ and new lasips2_port_init() function, Mark Cave-Ayland, 2022/06/29
- [PATCH 26/40] lasips2: add named input gpio to port for downstream PS2 device IRQ, Mark Cave-Ayland, 2022/06/29