summaryrefslogtreecommitdiffstats
path: root/include/hw/input/pl050.h
blob: 89ec4fafc9a0896f7b799da5c2034b0e5d3c4a53 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
 * Arm PrimeCell PL050 Keyboard / Mouse Interface
 *
 * Copyright (c) 2006-2007 CodeSourcery.
 * Written by Paul Brook
 *
 * This code is licensed under the GPL.
 */

#ifndef HW_PL050_H
#define HW_PL050_H

#include "qemu/osdep.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
#include "hw/input/ps2.h"
#include "hw/irq.h"

struct PL050DeviceClass {
    SysBusDeviceClass parent_class;

    DeviceRealize parent_realize;
};

#define TYPE_PL050 "pl050"
OBJECT_DECLARE_TYPE(PL050State, PL050DeviceClass, PL050)

struct PL050State {
    SysBusDevice parent_obj;

    MemoryRegion iomem;
    PS2State *ps2dev;
    uint32_t cr;
    uint32_t clk;
    uint32_t last;
    int pending;
    qemu_irq irq;
    bool is_mouse;
};

#define TYPE_PL050_KBD_DEVICE "pl050_keyboard"
OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVICE)

struct PL050KbdState {
    PL050State parent_obj;

    PS2KbdState kbd;
};

#define TYPE_PL050_MOUSE_DEVICE "pl050_mouse"
OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_DEVICE)

struct PL050MouseState {
    PL050State parent_obj;

    PS2MouseState mouse;
};

#endif