]> git.proxmox.com Git - mirror_qemu.git/blob - include/hw/input/lasips2.h
lasips2: move keyboard port initialisation to new lasips2_kbd_port_init() function
[mirror_qemu.git] / include / hw / input / lasips2.h
1 /*
2 * QEMU LASI PS/2 emulation
3 *
4 * Copyright (c) 2019 Sven Schnelle
5 *
6 */
7
8 /*
9 * QEMU interface:
10 * + sysbus MMIO region 0: MemoryRegion defining the LASI PS2 keyboard
11 * registers
12 * + sysbus MMIO region 1: MemoryRegion defining the LASI PS2 mouse
13 * registers
14 * + sysbus IRQ 0: LASI PS2 output irq
15 * + Named GPIO input "ps2-kbd-input-irq": set to 1 if the downstream PS2
16 * keyboard device has asserted its irq
17 * + Named GPIO input "ps2-mouse-input-irq": set to 1 if the downstream PS2
18 * mouse device has asserted its irq
19 */
20
21 #ifndef HW_INPUT_LASIPS2_H
22 #define HW_INPUT_LASIPS2_H
23
24 #include "exec/hwaddr.h"
25 #include "hw/sysbus.h"
26 #include "hw/input/ps2.h"
27
28 #define TYPE_LASIPS2_PORT "lasips2-port"
29 OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2Port, LASIPS2_PORT)
30
31 typedef struct LASIPS2State LASIPS2State;
32
33 struct LASIPS2Port {
34 DeviceState parent_obj;
35
36 LASIPS2State *parent;
37 MemoryRegion reg;
38 PS2State *ps2dev;
39 uint8_t id;
40 uint8_t control;
41 uint8_t buf;
42 bool loopback_rbne;
43 bool irq;
44 };
45
46 #define TYPE_LASIPS2_KBD_PORT "lasips2-kbd-port"
47 OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2KbdPort, LASIPS2_KBD_PORT)
48
49 struct LASIPS2KbdPort {
50 LASIPS2Port parent_obj;
51 };
52
53 #define TYPE_LASIPS2_MOUSE_PORT "lasips2-mouse-port"
54 OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2MousePort, LASIPS2_MOUSE_PORT)
55
56 struct LASIPS2MousePort {
57 LASIPS2Port parent_obj;
58 };
59
60 struct LASIPS2State {
61 SysBusDevice parent_obj;
62
63 LASIPS2KbdPort kbd_port;
64 LASIPS2Port mouse;
65 qemu_irq irq;
66 };
67
68 #define TYPE_LASIPS2 "lasips2"
69 OBJECT_DECLARE_SIMPLE_TYPE(LASIPS2State, LASIPS2)
70
71 #endif /* HW_INPUT_LASIPS2_H */