Merge tag 'pull-loongarch-20241016' of https://gitlab.com/gaosong/qemu into staging
[qemu/armbru.git] / include / hw / input / pl050.h
blob4cb8985f31a0d5732a6de341b1432e4cf1d69125
1 /*
2 * Arm PrimeCell PL050 Keyboard / Mouse Interface
4 * Copyright (c) 2006-2007 CodeSourcery.
5 * Written by Paul Brook
7 * This code is licensed under the GPL.
8 */
10 #ifndef HW_PL050_H
11 #define HW_PL050_H
13 #include "hw/sysbus.h"
14 #include "migration/vmstate.h"
15 #include "hw/input/ps2.h"
16 #include "hw/irq.h"
18 struct PL050DeviceClass {
19 SysBusDeviceClass parent_class;
21 DeviceRealize parent_realize;
24 #define TYPE_PL050 "pl050"
25 OBJECT_DECLARE_TYPE(PL050State, PL050DeviceClass, PL050)
27 struct PL050State {
28 SysBusDevice parent_obj;
30 MemoryRegion iomem;
31 PS2State *ps2dev;
32 uint32_t cr;
33 uint32_t clk;
34 uint32_t last;
35 int pending;
36 qemu_irq irq;
37 bool is_mouse;
40 #define TYPE_PL050_KBD_DEVICE "pl050_keyboard"
41 OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVICE)
43 struct PL050KbdState {
44 PL050State parent_obj;
46 PS2KbdState kbd;
49 #define TYPE_PL050_MOUSE_DEVICE "pl050_mouse"
50 OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_DEVICE)
52 struct PL050MouseState {
53 PL050State parent_obj;
55 PS2MouseState mouse;
58 #endif