summaryrefslogtreecommitdiffstats
path: root/include/hw/input
diff options
context:
space:
mode:
authorMark Cave-Ayland2020-06-23 22:49:21 +0200
committerMark Cave-Ayland2020-06-26 11:13:51 +0200
commitda52c083ac4af9bf934898470dfdeef0f6ead343 (patch)
tree5db0bc9df8504b3fd64843e7a015c4f109c2e00e /include/hw/input
parentadb: introduce realize/unrealize and VMStateDescription for ADB bus (diff)
downloadqemu-da52c083ac4af9bf934898470dfdeef0f6ead343.tar.gz
qemu-da52c083ac4af9bf934898470dfdeef0f6ead343.tar.xz
qemu-da52c083ac4af9bf934898470dfdeef0f6ead343.zip
adb: create autopoll variables directly within ADBBusState
Rather than each ADB implementation requiring its own functions to manage autopoll state, timers, and autopoll masks prepare to move this information directly into ADBBusState. Add external functions within adb.h to allow each ADB implementation to manage the new autopoll variables. Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk> Tested-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Laurent Vivier <laurent@vivier.eu> Message-Id: <20200623204936.24064-8-mark.cave-ayland@ilande.co.uk>
Diffstat (limited to 'include/hw/input')
-rw-r--r--include/hw/input/adb.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/hw/input/adb.h b/include/hw/input/adb.h
index 4d2c565f54..15b1874a3d 100644
--- a/include/hw/input/adb.h
+++ b/include/hw/input/adb.h
@@ -75,12 +75,25 @@ struct ADBBusState {
ADBDevice *devices[MAX_ADB_DEVICES];
int nb_devices;
int poll_index;
+
+ QEMUTimer *autopoll_timer;
+ bool autopoll_enabled;
+ uint8_t autopoll_rate_ms;
+ uint16_t autopoll_mask;
+ void (*autopoll_cb)(void *opaque);
+ void *autopoll_cb_opaque;
};
int adb_request(ADBBusState *s, uint8_t *buf_out,
const uint8_t *buf, int len);
int adb_poll(ADBBusState *s, uint8_t *buf_out, uint16_t poll_mask);
+void adb_set_autopoll_enabled(ADBBusState *s, bool enabled);
+void adb_set_autopoll_rate_ms(ADBBusState *s, int rate_ms);
+void adb_set_autopoll_mask(ADBBusState *s, uint16_t mask);
+void adb_register_autopoll_callback(ADBBusState *s, void (*cb)(void *opaque),
+ void *opaque);
+
#define TYPE_ADB_KEYBOARD "adb-keyboard"
#define TYPE_ADB_MOUSE "adb-mouse"