On 17/10/23 14:23, Peter Maydell wrote:
Convert the hw/input/stellaris_input device to qdev.
The interface uses an array property for the board to specify the
keycodes to use, so the s->keycodes memory is now allocated by the
array-property machinery.
Signed-off-by: Peter Maydell <[email protected]>
---
include/hw/input/stellaris_gamepad.h | 25 +++++++++-
hw/arm/stellaris.c | 26 +++++++---
hw/input/stellaris_gamepad.c | 73 +++++++++++++++++++---------
3 files changed, 92 insertions(+), 32 deletions(-)
+#define TYPE_STELLARIS_GAMEPAD "stellaris-gamepad"
+OBJECT_DECLARE_SIMPLE_TYPE(StellarisGamepad, STELLARIS_GAMEPAD)
+
+struct StellarisGamepad {
+ /*< private >*/
Since commit 067109a11c ("docs/devel: mention the spacing requirement
for QOM") we don't use these private/public comments anymore.
Otherwise,
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
+ SysBusDevice parent_obj;
+
+ /*< public >*/
+ uint32_t num_buttons;
+ qemu_irq *irqs;
+ uint32_t *keycodes;
+ uint8_t *pressed;
+ int extension;
+};