| 1 | /* |
| 2 | * Arm PrimeCell PL050 Keyboard / Mouse Interface |
| 3 | * |
| 4 | * Copyright (c) 2006-2007 CodeSourcery. |
| 5 | * Written by Paul Brook |
| 6 | * |
| 7 | * This code is licensed under the GPL. |
| 8 | */ |
| 9 | |
| 10 | #ifndef HW_PL050_H |
| 11 | #define HW_PL050_H |
| 12 | |
| 13 | #include "hw/core/sysbus.h" |
| 14 | #include "migration/vmstate.h" |
| 15 | #include "hw/input/ps2.h" |
| 16 | #include "hw/core/irq.h" |
| 17 | |
| 18 | struct PL050DeviceClass { |
| 19 | SysBusDeviceClass parent_class; |
| 20 | |
| 21 | DeviceRealize parent_realize; |
| 22 | }; |
| 23 | |
| 24 | #define TYPE_PL050 "pl050" |
| 25 | OBJECT_DECLARE_TYPE(PL050State, PL050DeviceClass, PL050) |
| 26 | |
| 27 | struct PL050State { |
| 28 | SysBusDevice parent_obj; |
| 29 | |
| 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; |
| 38 | }; |
| 39 | |
| 40 | #define TYPE_PL050_KBD_DEVICE "pl050_keyboard" |
| 41 | OBJECT_DECLARE_SIMPLE_TYPE(PL050KbdState, PL050_KBD_DEVICE) |
| 42 | |
| 43 | struct PL050KbdState { |
| 44 | PL050State parent_obj; |
| 45 | |
| 46 | PS2KbdState kbd; |
| 47 | }; |
| 48 | |
| 49 | #define TYPE_PL050_MOUSE_DEVICE "pl050_mouse" |
| 50 | OBJECT_DECLARE_SIMPLE_TYPE(PL050MouseState, PL050_MOUSE_DEVICE) |
| 51 | |
| 52 | struct PL050MouseState { |
| 53 | PL050State parent_obj; |
| 54 | |
| 55 | PS2MouseState mouse; |
| 56 | }; |
| 57 | |
| 58 | #endif |